@webex/plugin-meetings 3.12.0-webex-services-ready.3 → 3.12.0-webex-services-ready.4

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.
Files changed (54) hide show
  1. package/dist/aiEnableRequest/index.js +1 -1
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/events.js +29 -14
  4. package/dist/breakouts/events.js.map +1 -1
  5. package/dist/breakouts/index.js +65 -2
  6. package/dist/breakouts/index.js.map +1 -1
  7. package/dist/constants.js +2 -1
  8. package/dist/constants.js.map +1 -1
  9. package/dist/hashTree/hashTreeParser.js +193 -23
  10. package/dist/hashTree/hashTreeParser.js.map +1 -1
  11. package/dist/interpretation/index.js +1 -1
  12. package/dist/interpretation/siLanguage.js +1 -1
  13. package/dist/locus-info/index.js +141 -56
  14. package/dist/locus-info/index.js.map +1 -1
  15. package/dist/media/properties.js +3 -5
  16. package/dist/media/properties.js.map +1 -1
  17. package/dist/meeting/index.js +351 -52
  18. package/dist/meeting/index.js.map +1 -1
  19. package/dist/meetings/index.js +25 -0
  20. package/dist/meetings/index.js.map +1 -1
  21. package/dist/metrics/constants.js +3 -1
  22. package/dist/metrics/constants.js.map +1 -1
  23. package/dist/roap/turnDiscovery.js +8 -1
  24. package/dist/roap/turnDiscovery.js.map +1 -1
  25. package/dist/types/constants.d.ts +1 -0
  26. package/dist/types/hashTree/hashTreeParser.d.ts +51 -3
  27. package/dist/types/locus-info/index.d.ts +19 -4
  28. package/dist/types/media/properties.d.ts +5 -2
  29. package/dist/types/meeting/index.d.ts +63 -1
  30. package/dist/types/meetings/index.d.ts +8 -0
  31. package/dist/types/metrics/constants.d.ts +2 -0
  32. package/dist/webinar/index.js +4 -4
  33. package/dist/webinar/index.js.map +1 -1
  34. package/package.json +23 -23
  35. package/src/breakouts/events.ts +33 -11
  36. package/src/breakouts/index.ts +79 -1
  37. package/src/constants.ts +1 -0
  38. package/src/hashTree/hashTreeParser.ts +254 -18
  39. package/src/locus-info/index.ts +143 -51
  40. package/src/media/properties.ts +7 -3
  41. package/src/meeting/index.ts +329 -25
  42. package/src/meetings/index.ts +35 -1
  43. package/src/metrics/constants.ts +2 -0
  44. package/src/roap/turnDiscovery.ts +9 -1
  45. package/src/webinar/index.ts +2 -2
  46. package/test/unit/spec/breakouts/events.ts +120 -2
  47. package/test/unit/spec/breakouts/index.ts +142 -2
  48. package/test/unit/spec/hashTree/hashTreeParser.ts +556 -3
  49. package/test/unit/spec/locus-info/index.js +148 -5
  50. package/test/unit/spec/media/properties.ts +23 -23
  51. package/test/unit/spec/meeting/index.js +832 -126
  52. package/test/unit/spec/meetings/index.js +116 -12
  53. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  54. package/test/unit/spec/webinar/index.ts +3 -3
@@ -25,6 +25,7 @@ import {SitePreferenceSelectOption} from '@webex/plugin-meetings/src/meetings/me
25
25
  import PersonalMeetingRoom from '@webex/plugin-meetings/src/personal-meeting-room';
26
26
  import Reachability from '@webex/plugin-meetings/src/reachability';
27
27
  import Metrics from '@webex/plugin-meetings/src/metrics';
28
+ import {WasmRuntimeProbe} from '@webex/web-capabilities';
28
29
 
29
30
  import testUtils from '../../../utils/testUtils';
30
31
  import {
@@ -1271,14 +1272,16 @@ describe('plugin-meetings', () => {
1271
1272
  });
1272
1273
 
1273
1274
  it('creates noise reduction effect with BNR model', async () => {
1274
- const result = await webex.meetings.createNoiseReductionEffect({audioContext: {}});
1275
+ const result = await webex.meetings.createNoiseReductionEffect({
1276
+ audioContext: {addEventListener: sinon.stub()},
1277
+ });
1275
1278
 
1276
1279
  assert.exists(result);
1277
1280
  assert.instanceOf(result, NoiseReductionEffect);
1278
1281
  assert.containsAllKeys(result, ['audioContext', 'isEnabled', 'isReady', 'options']);
1279
1282
  assert.equal(result.options.authToken, 'fake_token');
1280
1283
  assert.deepEqual(result.options, {
1281
- audioContext: {},
1284
+ audioContext: {addEventListener: result.options.audioContext.addEventListener},
1282
1285
  authToken: 'fake_token',
1283
1286
  mode: 'WORKLET',
1284
1287
  avoidSimd: false,
@@ -1291,7 +1294,7 @@ describe('plugin-meetings', () => {
1291
1294
 
1292
1295
  it('creates noise reduction effect with OFMV model', async () => {
1293
1296
  const result = await webex.meetings.createNoiseReductionEffect({
1294
- audioContext: {},
1297
+ audioContext: {addEventListener: sinon.stub()},
1295
1298
  model: 'ofmv',
1296
1299
  });
1297
1300
 
@@ -1300,7 +1303,7 @@ describe('plugin-meetings', () => {
1300
1303
  assert.containsAllKeys(result, ['audioContext', 'isEnabled', 'isReady', 'options']);
1301
1304
  assert.equal(result.options.authToken, 'fake_token');
1302
1305
  assert.deepEqual(result.options, {
1303
- audioContext: {},
1306
+ audioContext: {addEventListener: result.options.audioContext.addEventListener},
1304
1307
  authToken: 'fake_token',
1305
1308
  mode: 'WORKLET',
1306
1309
  avoidSimd: false,
@@ -1313,7 +1316,7 @@ describe('plugin-meetings', () => {
1313
1316
 
1314
1317
  it('passes custom options to noise reduction effect', async () => {
1315
1318
  const result = await webex.meetings.createNoiseReductionEffect({
1316
- audioContext: {},
1319
+ audioContext: {addEventListener: sinon.stub()},
1317
1320
  mode: 'LEGACY',
1318
1321
  env: 'int',
1319
1322
  avoidSimd: true,
@@ -1875,6 +1878,106 @@ describe('plugin-meetings', () => {
1875
1878
  );
1876
1879
  });
1877
1880
 
1881
+ describe('wasm runtime performance telemetry', () => {
1882
+ const probeResult = {
1883
+ status: 'slow',
1884
+ capability: 'not capable',
1885
+ ratio: 0.25,
1886
+ wasmMs: 25,
1887
+ jsMs: 100,
1888
+ };
1889
+ let metricsSpy;
1890
+ let probeCheckStub;
1891
+
1892
+ beforeEach(() => {
1893
+ webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves({});
1894
+ webex.meetings.createMeeting = sinon
1895
+ .stub()
1896
+ .returns(Promise.resolve({on: () => true, correlationId: 'wasm-corr-id'}));
1897
+ probeCheckStub = sinon.stub(WasmRuntimeProbe, 'check').resolves(probeResult);
1898
+ metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
1899
+ });
1900
+
1901
+ afterEach(() => {
1902
+ probeCheckStub.restore();
1903
+ metricsSpy.restore();
1904
+ });
1905
+
1906
+ it('emits js_sdk_wasm_runtime_performance once after a meeting is created', async () => {
1907
+ await webex.meetings.create(test1, test2);
1908
+ await testUtils.flushPromises();
1909
+
1910
+ assert.calledOnceWithExactly(probeCheckStub);
1911
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
1912
+ status: 'slow',
1913
+ ratio: 0.25,
1914
+ wasmMs: 25,
1915
+ jsMs: 100,
1916
+ correlation_id: 'wasm-corr-id',
1917
+ });
1918
+ });
1919
+
1920
+ it('logs the WASM runtime status after a meeting is created', async () => {
1921
+ const loggerLogStub = sinon.stub(LoggerProxy.logger, 'log');
1922
+
1923
+ await webex.meetings.create(test1, test2);
1924
+ await testUtils.flushPromises();
1925
+
1926
+ assert.calledOnceWithExactly(probeCheckStub);
1927
+ assert.calledOnceWithExactly(
1928
+ loggerLogStub,
1929
+ sinon.match(
1930
+ /Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status/
1931
+ )
1932
+ );
1933
+ loggerLogStub.restore();
1934
+ });
1935
+
1936
+ it('emits only once even when create() is called multiple times', async () => {
1937
+ await webex.meetings.create(test1, test2);
1938
+ await webex.meetings.create(test1, test2);
1939
+ await testUtils.flushPromises();
1940
+
1941
+ assert.calledOnceWithExactly(probeCheckStub);
1942
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
1943
+ status: 'slow',
1944
+ ratio: 0.25,
1945
+ wasmMs: 25,
1946
+ jsMs: 100,
1947
+ correlation_id: 'wasm-corr-id',
1948
+ });
1949
+ });
1950
+
1951
+ it('still resolves the meeting when the probe fails', async () => {
1952
+ const loggerErrorStub = sinon.stub(LoggerProxy.logger, 'error');
1953
+ probeCheckStub.rejects(new Error('probe failed'));
1954
+
1955
+ const created = await webex.meetings.create(test1, test2);
1956
+ await testUtils.flushPromises();
1957
+
1958
+ // create() resolved normally with the meeting, i.e. the failed probe did not break it.
1959
+ assert.equal(created.correlationId, 'wasm-corr-id');
1960
+ assert.notCalled(metricsSpy);
1961
+ assert.calledOnceWithExactly(
1962
+ loggerErrorStub,
1963
+ sinon.match(/Meetings:index#emitWasmRuntimePerformance --> ERROR/)
1964
+ );
1965
+ loggerErrorStub.restore();
1966
+ });
1967
+
1968
+ it('does not re-run the probe when create() returns an already-created meeting', async () => {
1969
+ webex.meetings.meetingCollection.getByKey = sinon
1970
+ .stub()
1971
+ .returns({updateCallStateForMetrics: sinon.stub()});
1972
+
1973
+ await webex.meetings.create(test1, test2);
1974
+ await testUtils.flushPromises();
1975
+
1976
+ assert.notCalled(probeCheckStub);
1977
+ assert.notCalled(metricsSpy);
1978
+ });
1979
+ });
1980
+
1878
1981
  it('should call MeetingInfo#fetchInfoOptions() with proper params', () => {
1879
1982
  webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves(infoOptions);
1880
1983
 
@@ -3383,7 +3486,7 @@ describe('plugin-meetings', () => {
3383
3486
  loggerProxySpy,
3384
3487
  'Failed to fetch preferred site from user - no site will be set'
3385
3488
  );
3386
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3489
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3387
3490
  });
3388
3491
 
3389
3492
  it('should fall back to fetching the site from the user', async () => {
@@ -3401,7 +3504,6 @@ describe('plugin-meetings', () => {
3401
3504
 
3402
3505
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3403
3506
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3404
- '',
3405
3507
  'site.webex.com',
3406
3508
  ]);
3407
3509
  assert.notCalled(loggerProxySpy);
@@ -3425,7 +3527,7 @@ describe('plugin-meetings', () => {
3425
3527
  loggerProxySpy,
3426
3528
  'Failed to fetch preferred site from user - no site will be set'
3427
3529
  );
3428
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3530
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3429
3531
  });
3430
3532
  }
3431
3533
  );
@@ -3442,7 +3544,7 @@ describe('plugin-meetings', () => {
3442
3544
  loggerProxySpy,
3443
3545
  'Failed to fetch preferred site from user - no site will be set'
3444
3546
  );
3445
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3547
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3446
3548
  });
3447
3549
 
3448
3550
  it('should fall back to fetching the site from the user', async () => {
@@ -3461,7 +3563,6 @@ describe('plugin-meetings', () => {
3461
3563
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3462
3564
  assert.notCalled(loggerProxySpy);
3463
3565
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3464
- '',
3465
3566
  'site.webex.com',
3466
3567
  ]);
3467
3568
  });
@@ -3484,7 +3585,7 @@ describe('plugin-meetings', () => {
3484
3585
  loggerProxySpy,
3485
3586
  'Failed to fetch preferred site from user - no site will be set'
3486
3587
  );
3487
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3588
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3488
3589
  });
3489
3590
  }
3490
3591
  );
@@ -3501,7 +3602,7 @@ describe('plugin-meetings', () => {
3501
3602
  loggerProxySpy,
3502
3603
  'Failed to fetch preferred site from user - no site will be set'
3503
3604
  );
3504
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3605
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3505
3606
  });
3506
3607
  });
3507
3608
  });
@@ -4290,6 +4391,9 @@ describe('plugin-meetings', () => {
4290
4391
 
4291
4392
  triggerProxyStub.restore();
4292
4393
 
4394
+ // Never resolve, so the create()-triggered WASM emit can't reach the metrics spy below.
4395
+ sinon.stub(WasmRuntimeProbe, 'check').returns(new Promise(() => {}));
4396
+
4293
4397
  metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
4294
4398
 
4295
4399
  meeting = await webex.meetings.create('test');
@@ -612,6 +612,26 @@ describe('TurnDiscovery', () => {
612
612
  checkFailureMetricsSent();
613
613
  });
614
614
 
615
+ [409, 403].forEach((statusCode) => {
616
+ it(`re-throws ${statusCode} error instead of swallowing it and cleans up defer`, async () => {
617
+ const td = new TurnDiscovery(mockRoapRequest);
618
+ const error = Object.assign(new Error(`locus ${statusCode}`), {statusCode});
619
+
620
+ mockRoapRequest.sendRoap = sinon.fake.rejects(error);
621
+
622
+ const thrownError = await assert.isRejected(td.doTurnDiscovery(testMeeting, false));
623
+
624
+ assert.equal(thrownError, error);
625
+
626
+ // verify defer is cleaned up so subsequent TURN discovery is not blocked
627
+ const {roapMessage, turnDiscoverySkippedReason} =
628
+ await td.generateTurnDiscoveryRequestMessage(testMeeting, true);
629
+
630
+ assert.isDefined(roapMessage);
631
+ assert.isUndefined(turnDiscoverySkippedReason);
632
+ });
633
+ });
634
+
615
635
  it('resolves with undefined turnServerInfo when cluster is reachable', async () => {
616
636
  const prev = testMeeting.webex.meetings.reachability.isAnyPublicClusterReachable;
617
637
  testMeeting.webex.meetings.reachability.isAnyPublicClusterReachable = () =>
@@ -409,7 +409,7 @@ describe('plugin-meetings', () => {
409
409
  // Ensure connect path is eligible
410
410
  webinar.selfIsPanelist = true;
411
411
  webinar.practiceSessionEnabled = true;
412
- webex.internal.voicea.getIsCaptionBoxOn = sinon.stub().returns(false);
412
+ webex.internal.voicea.getKeepTranscriptionSubscribed = sinon.stub().returns(false);
413
413
  webex.internal.voicea.updateSubchannelSubscriptions = sinon.stub();
414
414
  });
415
415
 
@@ -624,7 +624,7 @@ describe('plugin-meetings', () => {
624
624
  });
625
625
 
626
626
  it('subscribes to transcription when caption intent is enabled', async () => {
627
- webex.internal.voicea.getIsCaptionBoxOn = sinon.stub().returns(true);
627
+ webex.internal.voicea.getKeepTranscriptionSubscribed = sinon.stub().returns(true);
628
628
 
629
629
  await webinar.updatePSDataChannel();
630
630
 
@@ -632,7 +632,7 @@ describe('plugin-meetings', () => {
632
632
  });
633
633
 
634
634
  it('does not subscribe to transcription when caption intent is disabled', async () => {
635
- webex.internal.voicea.getIsCaptionBoxOn = sinon.stub().returns(false);
635
+ webex.internal.voicea.getKeepTranscriptionSubscribed = sinon.stub().returns(false);
636
636
 
637
637
  await webinar.updatePSDataChannel();
638
638