@webex/plugin-meetings 3.12.0-next.112 → 3.12.0-next.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -869,7 +869,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
869
869
  }, _callee1);
870
870
  }))();
871
871
  },
872
- version: "3.12.0-next.112"
872
+ version: "3.12.0-next.114"
873
873
  });
874
874
  var _default = exports.default = Webinar;
875
875
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -94,5 +94,5 @@
94
94
  "//": [
95
95
  "TODO: upgrade jwt-decode when moving to node 18"
96
96
  ],
97
- "version": "3.12.0-next.112"
97
+ "version": "3.12.0-next.114"
98
98
  }
@@ -7543,14 +7543,21 @@ export default class Meeting extends StatelessWebexPlugin {
7543
7543
  // @ts-ignore
7544
7544
  const cdl = this.webex.internal.newMetrics.callDiagnosticLatencies;
7545
7545
 
7546
- // Save the remote-sdp-received timestamp before submitting the client event so we can
7547
- // calculate and include localSDPGenRemoteSDPRecv in the client event payload
7548
- cdl.saveTimestamp({
7549
- key: 'client.media-engine.remote-sdp-received',
7550
- options: {meetingId: this.id},
7551
- });
7552
-
7553
- const localSDPGenRemoteSDPRecv = cdl.getLocalSDPGenRemoteSDPRecv();
7546
+ // Compute the offer->answer latency from when the local SDP offer was generated up to now,
7547
+ // rather than from the stored remote-sdp-received timestamp. That stored timestamp uses
7548
+ // saveFirstTimestampOnly, so if waitForRemoteSDPAnswer() already timed out and submitted a
7549
+ // remote-sdp-received event, the stored value would be pinned to the timeout time and would
7550
+ // under-report an answer that arrives late. This handler fires exactly when the answer is
7551
+ // processed, so Date.now() is the accurate "received" time.
7552
+ // (submitClientEvent below still records the remote-sdp-received timestamp used by the CA
7553
+ // join-time metric, so we don't need to save it here.)
7554
+ const localSdpGeneratedTimestamp = cdl.latencyTimestamps.get(
7555
+ 'client.media-engine.local-sdp-generated'
7556
+ );
7557
+ const localSDPGenRemoteSDPRecv =
7558
+ localSdpGeneratedTimestamp !== undefined
7559
+ ? Date.now() - localSdpGeneratedTimestamp
7560
+ : undefined;
7554
7561
 
7555
7562
  // @ts-ignore
7556
7563
  this.webex.internal.newMetrics.submitClientEvent({
@@ -7562,11 +7569,6 @@ export default class Meeting extends StatelessWebexPlugin {
7562
7569
  },
7563
7570
  options: {meetingId: this.id},
7564
7571
  });
7565
- Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ROAP_OFFER_TO_ANSWER_LATENCY, {
7566
- correlation_id: this.correlationId,
7567
- latency: localSDPGenRemoteSDPRecv,
7568
- meetingId: this.id,
7569
- });
7570
7572
 
7571
7573
  if (this.deferSDPAnswer) {
7572
7574
  this.deferSDPAnswer.resolve();
@@ -8301,6 +8303,7 @@ export default class Meeting extends StatelessWebexPlugin {
8301
8303
  this.mediaProperties.mediaDirection.receiveShare,
8302
8304
  ];
8303
8305
 
8306
+ this.sendSlotManager.reset();
8304
8307
  this.sendSlotManager.createSlot(mc, MediaType.VideoMain, videoEnabled);
8305
8308
  this.sendSlotManager.createSlot(mc, MediaType.AudioMain, audioEnabled);
8306
8309
  this.sendSlotManager.createSlot(mc, MediaType.VideoSlides, shareEnabled);
@@ -2082,8 +2082,16 @@ describe('plugin-meetings', () => {
2082
2082
  [
2083
2083
  {description: '409 error from join()', statusCode: 409, useCause: false},
2084
2084
  {description: '403 error from join()', statusCode: 403, useCause: false},
2085
- {description: '409 error in cause (e.g. AddMediaFailed)', statusCode: 409, useCause: true},
2086
- {description: '403 error in cause (e.g. AddMediaFailed)', statusCode: 403, useCause: true},
2085
+ {
2086
+ description: '409 error in cause (e.g. AddMediaFailed)',
2087
+ statusCode: 409,
2088
+ useCause: true,
2089
+ },
2090
+ {
2091
+ description: '403 error in cause (e.g. AddMediaFailed)',
2092
+ statusCode: 403,
2093
+ useCause: true,
2094
+ },
2087
2095
  ].forEach(({description, statusCode, useCause}) => {
2088
2096
  it(`should re-join on retry when ${description}`, async () => {
2089
2097
  const error = useCause
@@ -2099,7 +2107,11 @@ describe('plugin-meetings', () => {
2099
2107
 
2100
2108
  const result = await meeting.joinWithMedia({joinOptions, mediaOptions});
2101
2109
 
2102
- assert.deepEqual(result, {join: fakeJoinResult, media: test4, multistreamEnabled: true});
2110
+ assert.deepEqual(result, {
2111
+ join: fakeJoinResult,
2112
+ media: test4,
2113
+ multistreamEnabled: true,
2114
+ });
2103
2115
 
2104
2116
  // join() should be called twice — once for the first attempt, once for the re-join
2105
2117
  assert.calledTwice(meeting.join);
@@ -2114,9 +2126,7 @@ describe('plugin-meetings', () => {
2114
2126
  meeting.join = sinon.stub().callsFake(() => Promise.resolve(fakeJoinResult));
2115
2127
  sinon.stub(meeting, 'leave').resolves();
2116
2128
 
2117
- await assert.isRejected(
2118
- meeting.joinWithMedia({joinOptions, mediaOptions})
2119
- );
2129
+ await assert.isRejected(meeting.joinWithMedia({joinOptions, mediaOptions}));
2120
2130
 
2121
2131
  // JOIN_WITH_MEDIA_RETRY_MAX_COUNT is 2, so we expect 3 attempts total (initial + 2 retries)
2122
2132
  assert.callCount(meeting.join, 3);
@@ -4264,6 +4274,7 @@ describe('plugin-meetings', () => {
4264
4274
  unpublishStream: sinon.stub(),
4265
4275
  setNamedMediaGroups: sinon.stub(),
4266
4276
  });
4277
+ sinon.spy(meeting.sendSlotManager, 'reset');
4267
4278
 
4268
4279
  await meeting.addMedia({
4269
4280
  allowMediaInLobby: true,
@@ -4276,6 +4287,7 @@ describe('plugin-meetings', () => {
4276
4287
  },
4277
4288
  });
4278
4289
 
4290
+ assert.calledOnce(meeting.sendSlotManager.reset);
4279
4291
  assert.notCalled(publishStreamStub);
4280
4292
  });
4281
4293
 
@@ -4299,6 +4311,7 @@ describe('plugin-meetings', () => {
4299
4311
  }
4300
4312
  return videoSlot;
4301
4313
  });
4314
+ sinon.spy(meeting.sendSlotManager, 'reset');
4302
4315
 
4303
4316
  await meeting.addMedia({
4304
4317
  allowMediaInLobby: true,
@@ -4311,6 +4324,7 @@ describe('plugin-meetings', () => {
4311
4324
  },
4312
4325
  });
4313
4326
 
4327
+ assert.calledOnce(meeting.sendSlotManager.reset);
4314
4328
  assert.calledOnceWithExactly(audioSlot.publishStream, fakeMicrophoneStream);
4315
4329
  assert.calledOnceWithExactly(videoSlot.publishStream, fakeCameraStream);
4316
4330
  });
@@ -4333,11 +4347,13 @@ describe('plugin-meetings', () => {
4333
4347
 
4334
4348
  meeting.meetingState = 'ACTIVE';
4335
4349
  meeting.isMultistream = true;
4350
+ sinon.spy(meeting.sendSlotManager, 'reset');
4336
4351
 
4337
4352
  await meeting.addMedia({
4338
4353
  mediaSettings: {},
4339
4354
  });
4340
4355
 
4356
+ assert.calledOnce(meeting.sendSlotManager.reset);
4341
4357
  // check that rtcMetrics was passed to Media.createMediaConnection
4342
4358
  assert.calledOnce(Media.createMediaConnection);
4343
4359
  assert.calledWith(
@@ -11687,6 +11703,8 @@ describe('plugin-meetings', () => {
11687
11703
  });
11688
11704
 
11689
11705
  it('handles REMOTE_SDP_ANSWER_PROCESSED correctly', () => {
11706
+ // capture the start timestamp before any fake timers are installed
11707
+ const localSdpGeneratedTimestamp = Date.now() - 100;
11690
11708
  const clock = sinon.useFakeTimers();
11691
11709
  sinon.spy(clock, 'clearTimeout');
11692
11710
  meeting.deferSDPAnswer = {
@@ -11694,49 +11712,29 @@ describe('plugin-meetings', () => {
11694
11712
  };
11695
11713
  meeting.sdpResponseTimer = '1234';
11696
11714
 
11697
- webex.internal.newMetrics.callDiagnosticLatencies.saveTimestamp = sinon.stub();
11698
- webex.internal.newMetrics.callDiagnosticLatencies.getLocalSDPGenRemoteSDPRecv = sinon
11699
- .stub()
11700
- .returns(100);
11715
+ // latency is computed as Date.now() - the stored local-sdp-generated timestamp,
11716
+ // so it is unaffected by any earlier remote-sdp-received timestamp saved on timeout
11717
+ webex.internal.newMetrics.callDiagnosticLatencies.latencyTimestamps = new Map([
11718
+ ['client.media-engine.local-sdp-generated', localSdpGeneratedTimestamp],
11719
+ ]);
11701
11720
 
11702
11721
  eventListeners[MediaConnectionEventNames.REMOTE_SDP_ANSWER_PROCESSED]();
11703
11722
 
11704
- // the remote-sdp-received timestamp must be saved before the latency is computed
11705
- // so that getLocalSDPGenRemoteSDPRecv() has an end timestamp to use
11706
- assert.calledOnceWithExactly(
11707
- webex.internal.newMetrics.callDiagnosticLatencies.saveTimestamp,
11708
- {
11709
- key: 'client.media-engine.remote-sdp-received',
11710
- options: {meetingId: meeting.id},
11711
- }
11712
- );
11713
- assert(
11714
- webex.internal.newMetrics.callDiagnosticLatencies.saveTimestamp.calledBefore(
11715
- webex.internal.newMetrics.callDiagnosticLatencies.getLocalSDPGenRemoteSDPRecv
11716
- )
11717
- );
11718
-
11719
11723
  assert.calledOnce(webex.internal.newMetrics.submitClientEvent);
11720
11724
  assert.calledWithMatch(webex.internal.newMetrics.submitClientEvent, {
11721
11725
  name: 'client.media-engine.remote-sdp-received',
11722
11726
  payload: {
11723
11727
  eventData: {
11724
- localSDPGenRemoteSDPRecv: 100,
11728
+ localSDPGenRemoteSDPRecv: sinon.match(
11729
+ (value) => typeof value === 'number' && value >= 100 && value < 5000
11730
+ ),
11725
11731
  },
11726
11732
  },
11727
11733
  options: {meetingId: meeting.id},
11728
11734
  });
11729
11735
 
11730
- assert.calledOnce(Metrics.sendBehavioralMetric);
11731
- assert.calledWith(
11732
- Metrics.sendBehavioralMetric,
11733
- BEHAVIORAL_METRICS.ROAP_OFFER_TO_ANSWER_LATENCY,
11734
- {
11735
- correlation_id: meeting.correlationId,
11736
- meetingId: meeting.id,
11737
- latency: 100,
11738
- }
11739
- );
11736
+ // the high-volume ROAP_OFFER_TO_ANSWER_LATENCY behavioral metric is no longer sent
11737
+ assert.notCalled(Metrics.sendBehavioralMetric);
11740
11738
 
11741
11739
  assert.calledOnce(meeting.deferSDPAnswer.resolve);
11742
11740
  assert.calledOnce(clock.clearTimeout);
@@ -11744,6 +11742,28 @@ describe('plugin-meetings', () => {
11744
11742
  assert.equal(meeting.sdpResponseTimer, undefined);
11745
11743
  });
11746
11744
 
11745
+ it('sends undefined localSDPGenRemoteSDPRecv when the local-sdp-generated timestamp is missing', () => {
11746
+ meeting.deferSDPAnswer = {
11747
+ resolve: sinon.stub(),
11748
+ };
11749
+
11750
+ // no local-sdp-generated timestamp stored -> latency cannot be computed
11751
+ webex.internal.newMetrics.callDiagnosticLatencies.latencyTimestamps = new Map();
11752
+
11753
+ eventListeners[MediaConnectionEventNames.REMOTE_SDP_ANSWER_PROCESSED]();
11754
+
11755
+ assert.calledOnce(webex.internal.newMetrics.submitClientEvent);
11756
+ assert.calledWithMatch(webex.internal.newMetrics.submitClientEvent, {
11757
+ name: 'client.media-engine.remote-sdp-received',
11758
+ payload: {
11759
+ eventData: {
11760
+ localSDPGenRemoteSDPRecv: undefined,
11761
+ },
11762
+ },
11763
+ options: {meetingId: meeting.id},
11764
+ });
11765
+ });
11766
+
11747
11767
  it('handles LOCAL_SDP_OFFER_GENERATED correctly', () => {
11748
11768
  assert.equal(meeting.deferSDPAnswer, undefined);
11749
11769
 
@@ -15564,11 +15584,7 @@ describe('plugin-meetings', () => {
15564
15584
  // Only the client whose /sync request tracking id matches the tracking id echoed back on
15565
15585
  // the top-level LLM event envelope records the LLM arrival; onLocusSyncLlmMessage is a
15566
15586
  // no-op otherwise.
15567
- assert.calledOnceWithExactly(
15568
- meeting.onLocusSyncLlmMessage,
15569
- meeting.id,
15570
- event.trackingId
15571
- );
15587
+ assert.calledOnceWithExactly(meeting.onLocusSyncLlmMessage, meeting.id, event.trackingId);
15572
15588
  });
15573
15589
 
15574
15590
  it('does not attempt sync completion when the tracking id is missing', () => {
@@ -15587,7 +15603,6 @@ describe('plugin-meetings', () => {
15587
15603
  assert.calledOnceWithExactly(meeting.locusInfo.parse, meeting, event.data);
15588
15604
  assert.notCalled(meeting.onLocusSyncLlmMessage);
15589
15605
  });
15590
-
15591
15606
  });
15592
15607
 
15593
15608
  describe('#onLocusSyncLlmMessage', () => {
@@ -15634,11 +15649,7 @@ describe('plugin-meetings', () => {
15634
15649
  'meeting-1',
15635
15650
  'sync-tracking-id'
15636
15651
  );
15637
- assert.calledOnceWithExactly(
15638
- meeting.emitLocusSyncCompleteMetric,
15639
- 'meeting-1',
15640
- completed
15641
- );
15652
+ assert.calledOnceWithExactly(meeting.emitLocusSyncCompleteMetric, 'meeting-1', completed);
15642
15653
  });
15643
15654
 
15644
15655
  it('does not emit when completion returns undefined (only one milestone is in)', () => {
@@ -15662,13 +15673,10 @@ describe('plugin-meetings', () => {
15662
15673
  webex.internal.newMetrics.submitClientEvent.resetHistory();
15663
15674
  webex.internal.llm.getWebSocketUrl = sinon.stub().returns('wss://llm-websocket-url');
15664
15675
 
15665
- meeting.emitLocusSyncCompleteMetric(
15666
- 'meeting-1',
15667
- {
15668
- dataSet: 'main',
15669
- syncLatency: {totalTime: 50},
15670
- }
15671
- );
15676
+ meeting.emitLocusSyncCompleteMetric('meeting-1', {
15677
+ dataSet: 'main',
15678
+ syncLatency: {totalTime: 50},
15679
+ });
15672
15680
 
15673
15681
  assert.calledOnceWithExactly(webex.internal.newMetrics.submitClientEvent, {
15674
15682
  name: 'client.locus.sync.complete',
@@ -15691,13 +15699,10 @@ describe('plugin-meetings', () => {
15691
15699
  webex.internal.newMetrics.submitClientEvent.resetHistory();
15692
15700
  webex.internal.llm.getWebSocketUrl = sinon.stub().returns(undefined);
15693
15701
 
15694
- meeting.emitLocusSyncCompleteMetric(
15695
- 'meeting-1',
15696
- {
15697
- dataSet: 'main',
15698
- syncLatency: {totalTime: 50},
15699
- }
15700
- );
15702
+ meeting.emitLocusSyncCompleteMetric('meeting-1', {
15703
+ dataSet: 'main',
15704
+ syncLatency: {totalTime: 50},
15705
+ });
15701
15706
 
15702
15707
  assert.calledOnceWithExactly(webex.internal.newMetrics.submitClientEvent, {
15703
15708
  name: 'client.locus.sync.complete',