@webex/plugin-meetings 3.12.0-next.13 → 3.12.0-next.131

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 (232) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/annotation/index.js +2 -2
  5. package/dist/annotation/index.js.map +1 -1
  6. package/dist/breakouts/breakout.js +8 -3
  7. package/dist/breakouts/breakout.js.map +1 -1
  8. package/dist/breakouts/events.js +29 -14
  9. package/dist/breakouts/events.js.map +1 -1
  10. package/dist/breakouts/index.js +99 -4
  11. package/dist/breakouts/index.js.map +1 -1
  12. package/dist/common/errors/webex-errors.js +49 -5
  13. package/dist/common/errors/webex-errors.js.map +1 -1
  14. package/dist/config.js +2 -2
  15. package/dist/config.js.map +1 -1
  16. package/dist/constants.js +37 -10
  17. package/dist/constants.js.map +1 -1
  18. package/dist/controls-options-manager/index.js +46 -10
  19. package/dist/controls-options-manager/index.js.map +1 -1
  20. package/dist/hashTree/constants.js +4 -1
  21. package/dist/hashTree/constants.js.map +1 -1
  22. package/dist/hashTree/hashTreeParser.js +1045 -393
  23. package/dist/hashTree/hashTreeParser.js.map +1 -1
  24. package/dist/hashTree/utils.js +20 -0
  25. package/dist/hashTree/utils.js.map +1 -1
  26. package/dist/index.js +7 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  29. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  30. package/dist/interceptors/locusRetry.js +23 -8
  31. package/dist/interceptors/locusRetry.js.map +1 -1
  32. package/dist/interpretation/index.js +10 -1
  33. package/dist/interpretation/index.js.map +1 -1
  34. package/dist/interpretation/interpretation.types.js +7 -0
  35. package/dist/interpretation/interpretation.types.js.map +1 -0
  36. package/dist/interpretation/siLanguage.js +1 -1
  37. package/dist/locus-info/controlsUtils.js +4 -1
  38. package/dist/locus-info/controlsUtils.js.map +1 -1
  39. package/dist/locus-info/index.js +409 -122
  40. package/dist/locus-info/index.js.map +1 -1
  41. package/dist/locus-info/infoUtils.js +36 -5
  42. package/dist/locus-info/infoUtils.js.map +1 -1
  43. package/dist/locus-info/types.js +19 -0
  44. package/dist/locus-info/types.js.map +1 -1
  45. package/dist/media/MediaConnectionAwaiter.js +15 -2
  46. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  47. package/dist/media/index.js +8 -2
  48. package/dist/media/index.js.map +1 -1
  49. package/dist/media/properties.js +4 -5
  50. package/dist/media/properties.js.map +1 -1
  51. package/dist/meeting/in-meeting-actions.js +5 -1
  52. package/dist/meeting/in-meeting-actions.js.map +1 -1
  53. package/dist/meeting/index.js +1669 -835
  54. package/dist/meeting/index.js.map +1 -1
  55. package/dist/meeting/locusMediaRequest.js +229 -82
  56. package/dist/meeting/locusMediaRequest.js.map +1 -1
  57. package/dist/meeting/muteState.js +10 -1
  58. package/dist/meeting/muteState.js.map +1 -1
  59. package/dist/meeting/request.js +5 -2
  60. package/dist/meeting/request.js.map +1 -1
  61. package/dist/meeting/util.js +34 -2
  62. package/dist/meeting/util.js.map +1 -1
  63. package/dist/meeting-info/meeting-info-v2.js +9 -3
  64. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  65. package/dist/meetings/index.js +281 -124
  66. package/dist/meetings/index.js.map +1 -1
  67. package/dist/meetings/meetings.types.js +6 -1
  68. package/dist/meetings/meetings.types.js.map +1 -1
  69. package/dist/meetings/request.js +39 -0
  70. package/dist/meetings/request.js.map +1 -1
  71. package/dist/meetings/util.js +116 -18
  72. package/dist/meetings/util.js.map +1 -1
  73. package/dist/member/index.js +10 -0
  74. package/dist/member/index.js.map +1 -1
  75. package/dist/member/types.js.map +1 -1
  76. package/dist/member/util.js +30 -0
  77. package/dist/member/util.js.map +1 -1
  78. package/dist/members/index.js +101 -43
  79. package/dist/members/index.js.map +1 -1
  80. package/dist/members/util.js +8 -1
  81. package/dist/members/util.js.map +1 -1
  82. package/dist/metrics/constants.js +7 -1
  83. package/dist/metrics/constants.js.map +1 -1
  84. package/dist/multistream/codec/constants.js +63 -0
  85. package/dist/multistream/codec/constants.js.map +1 -0
  86. package/dist/multistream/mediaRequestManager.js +62 -15
  87. package/dist/multistream/mediaRequestManager.js.map +1 -1
  88. package/dist/multistream/receiveSlot.js +9 -0
  89. package/dist/multistream/receiveSlot.js.map +1 -1
  90. package/dist/reachability/clusterReachability.js.map +1 -1
  91. package/dist/reachability/index.js +121 -83
  92. package/dist/reachability/index.js.map +1 -1
  93. package/dist/reachability/reachability.types.js +2 -0
  94. package/dist/reachability/reachability.types.js.map +1 -1
  95. package/dist/reachability/util.js +45 -0
  96. package/dist/reachability/util.js.map +1 -1
  97. package/dist/reactions/reactions.type.js.map +1 -1
  98. package/dist/recording-controller/index.js +1 -3
  99. package/dist/recording-controller/index.js.map +1 -1
  100. package/dist/roap/turnDiscovery.js +8 -1
  101. package/dist/roap/turnDiscovery.js.map +1 -1
  102. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  103. package/dist/types/config.d.ts +2 -2
  104. package/dist/types/constants.d.ts +13 -1
  105. package/dist/types/controls-options-manager/index.d.ts +16 -0
  106. package/dist/types/hashTree/constants.d.ts +1 -0
  107. package/dist/types/hashTree/hashTreeParser.d.ts +189 -22
  108. package/dist/types/hashTree/utils.d.ts +7 -0
  109. package/dist/types/index.d.ts +3 -0
  110. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  111. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  112. package/dist/types/locus-info/index.d.ts +61 -7
  113. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  114. package/dist/types/locus-info/types.d.ts +21 -1
  115. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  116. package/dist/types/media/properties.d.ts +6 -2
  117. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  118. package/dist/types/meeting/index.d.ts +175 -11
  119. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  120. package/dist/types/meeting/request.d.ts +1 -0
  121. package/dist/types/meeting/util.d.ts +9 -0
  122. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  123. package/dist/types/meetings/index.d.ts +38 -18
  124. package/dist/types/meetings/meetings.types.d.ts +15 -0
  125. package/dist/types/meetings/request.d.ts +14 -0
  126. package/dist/types/member/index.d.ts +1 -0
  127. package/dist/types/member/types.d.ts +1 -0
  128. package/dist/types/member/util.d.ts +9 -0
  129. package/dist/types/members/index.d.ts +15 -2
  130. package/dist/types/members/util.d.ts +1 -5
  131. package/dist/types/metrics/constants.d.ts +6 -0
  132. package/dist/types/multistream/codec/constants.d.ts +7 -0
  133. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  134. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  135. package/dist/types/reachability/index.d.ts +10 -3
  136. package/dist/types/reachability/reachability.types.d.ts +7 -0
  137. package/dist/types/reachability/util.d.ts +17 -0
  138. package/dist/types/reactions/reactions.type.d.ts +3 -0
  139. package/dist/webinar/index.js +307 -161
  140. package/dist/webinar/index.js.map +1 -1
  141. package/package.json +23 -23
  142. package/src/aiEnableRequest/index.ts +16 -0
  143. package/src/annotation/index.ts +6 -4
  144. package/src/breakouts/breakout.ts +3 -1
  145. package/src/breakouts/events.ts +33 -11
  146. package/src/breakouts/index.ts +122 -2
  147. package/src/common/errors/webex-errors.ts +50 -3
  148. package/src/config.ts +2 -2
  149. package/src/constants.ts +21 -3
  150. package/src/controls-options-manager/index.ts +62 -10
  151. package/src/hashTree/constants.ts +7 -0
  152. package/src/hashTree/hashTreeParser.ts +796 -192
  153. package/src/hashTree/utils.ts +19 -0
  154. package/src/index.ts +6 -0
  155. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  156. package/src/interceptors/locusRetry.ts +25 -4
  157. package/src/interpretation/index.ts +27 -9
  158. package/src/interpretation/interpretation.types.ts +11 -0
  159. package/src/locus-info/controlsUtils.ts +3 -1
  160. package/src/locus-info/index.ts +413 -130
  161. package/src/locus-info/infoUtils.ts +41 -6
  162. package/src/locus-info/types.ts +25 -1
  163. package/src/media/MediaConnectionAwaiter.ts +21 -4
  164. package/src/media/index.ts +10 -1
  165. package/src/media/properties.ts +8 -3
  166. package/src/meeting/in-meeting-actions.ts +8 -0
  167. package/src/meeting/index.ts +923 -117
  168. package/src/meeting/locusMediaRequest.ts +106 -6
  169. package/src/meeting/muteState.ts +10 -1
  170. package/src/meeting/request.ts +11 -0
  171. package/src/meeting/util.ts +46 -5
  172. package/src/meeting-info/meeting-info-v2.ts +10 -4
  173. package/src/meetings/index.ts +178 -78
  174. package/src/meetings/meetings.types.ts +19 -0
  175. package/src/meetings/request.ts +43 -0
  176. package/src/meetings/util.ts +117 -4
  177. package/src/member/index.ts +10 -0
  178. package/src/member/types.ts +1 -0
  179. package/src/member/util.ts +29 -0
  180. package/src/members/index.ts +70 -7
  181. package/src/members/util.ts +12 -4
  182. package/src/metrics/constants.ts +6 -0
  183. package/src/multistream/codec/constants.ts +58 -0
  184. package/src/multistream/mediaRequestManager.ts +119 -28
  185. package/src/multistream/receiveSlot.ts +18 -0
  186. package/src/reachability/clusterReachability.ts +3 -2
  187. package/src/reachability/index.ts +47 -16
  188. package/src/reachability/reachability.types.ts +11 -0
  189. package/src/reachability/util.ts +36 -0
  190. package/src/reactions/reactions.type.ts +3 -0
  191. package/src/recording-controller/index.ts +1 -2
  192. package/src/roap/turnDiscovery.ts +9 -1
  193. package/src/webinar/index.ts +216 -38
  194. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  195. package/test/unit/spec/annotation/index.ts +3 -3
  196. package/test/unit/spec/breakouts/breakout.ts +9 -3
  197. package/test/unit/spec/breakouts/events.ts +120 -2
  198. package/test/unit/spec/breakouts/index.ts +223 -3
  199. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  200. package/test/unit/spec/controls-options-manager/index.js +139 -32
  201. package/test/unit/spec/hashTree/hashTreeParser.ts +2299 -243
  202. package/test/unit/spec/hashTree/utils.ts +37 -0
  203. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  204. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  205. package/test/unit/spec/interpretation/index.ts +26 -4
  206. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  207. package/test/unit/spec/locus-info/index.js +671 -63
  208. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  209. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  210. package/test/unit/spec/media/index.ts +92 -0
  211. package/test/unit/spec/media/properties.ts +23 -23
  212. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  213. package/test/unit/spec/meeting/index.js +2733 -116
  214. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  215. package/test/unit/spec/meeting/muteState.js +81 -0
  216. package/test/unit/spec/meeting/request.js +12 -0
  217. package/test/unit/spec/meeting/utils.js +153 -1
  218. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  219. package/test/unit/spec/meetings/index.js +486 -49
  220. package/test/unit/spec/meetings/request.js +141 -0
  221. package/test/unit/spec/meetings/utils.js +402 -51
  222. package/test/unit/spec/member/index.js +7 -0
  223. package/test/unit/spec/member/util.js +89 -0
  224. package/test/unit/spec/members/index.js +216 -0
  225. package/test/unit/spec/members/request.js +37 -1
  226. package/test/unit/spec/members/utils.js +63 -0
  227. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  228. package/test/unit/spec/reachability/index.ts +128 -46
  229. package/test/unit/spec/reachability/util.ts +31 -0
  230. package/test/unit/spec/recording-controller/index.js +9 -8
  231. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  232. package/test/unit/spec/webinar/index.ts +332 -31
@@ -14,15 +14,18 @@ import StaticConfig from '@webex/plugin-meetings/src/common/config';
14
14
  import TriggerProxy from '@webex/plugin-meetings/src/common/events/trigger-proxy';
15
15
  import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
16
16
  import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
17
+ import ParameterError from '@webex/plugin-meetings/src/common/errors/parameter';
17
18
  import Meeting, {CallStateForMetrics} from '@webex/plugin-meetings/src/meeting';
18
19
  import {Services} from '@webex/webex-core';
19
20
  import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
20
21
  import Meetings from '@webex/plugin-meetings/src/meetings';
21
22
  import MeetingCollection from '@webex/plugin-meetings/src/meetings/collection';
22
23
  import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
24
+ import {SitePreferenceSelectOption} from '@webex/plugin-meetings/src/meetings/meetings.types';
23
25
  import PersonalMeetingRoom from '@webex/plugin-meetings/src/personal-meeting-room';
24
26
  import Reachability from '@webex/plugin-meetings/src/reachability';
25
27
  import Metrics from '@webex/plugin-meetings/src/metrics';
28
+ import {WasmRuntimeProbe} from '@webex/web-capabilities';
26
29
 
27
30
  import testUtils from '../../../utils/testUtils';
28
31
  import {
@@ -91,6 +94,7 @@ describe('plugin-meetings', () => {
91
94
  locusInfo = {
92
95
  parse: sinon.stub().returns(true),
93
96
  updateMainSessionLocusCache: sinon.stub(),
97
+ syncAllHashTreeDatasets: sinon.stub(),
94
98
  };
95
99
  webex = new MockWebex({
96
100
  children: {
@@ -355,32 +359,6 @@ describe('plugin-meetings', () => {
355
359
  });
356
360
  });
357
361
 
358
- describe('#_toggleTcpReachability', () => {
359
- it('should have _toggleTcpReachability', () => {
360
- assert.equal(typeof webex.meetings._toggleTcpReachability, 'function');
361
- });
362
-
363
- describe('success', () => {
364
- it('should update meetings to do TCP reachability', () => {
365
- webex.meetings._toggleTcpReachability(true);
366
- assert.equal(webex.meetings.config.experimental.enableTcpReachability, true);
367
- });
368
- });
369
- });
370
-
371
- describe('#_toggleTlsReachability', () => {
372
- it('should have _toggleTlsReachability', () => {
373
- assert.equal(typeof webex.meetings._toggleTlsReachability, 'function');
374
- });
375
-
376
- describe('success', () => {
377
- it('should update meetings to do TLS reachability', () => {
378
- webex.meetings._toggleTlsReachability(true);
379
- assert.equal(webex.meetings.config.experimental.enableTlsReachability, true);
380
- });
381
- });
382
- });
383
-
384
362
  describe('#_toggleIpv6BackendNativeSupport', () => {
385
363
  it('should have _toggleIpv6BackendNativeSupport', () => {
386
364
  assert.equal(typeof webex.meetings._toggleIpv6BackendNativeSupport, 'function');
@@ -423,6 +401,33 @@ describe('plugin-meetings', () => {
423
401
  });
424
402
  });
425
403
 
404
+ describe('#_toggleEnableAv1SlidesSupport', () => {
405
+ it('should have _toggleEnableAv1SlidesSupport', () => {
406
+ assert.equal(typeof webex.meetings._toggleEnableAv1SlidesSupport, 'function');
407
+ });
408
+
409
+ describe('success', () => {
410
+ it('should update meetings config to enable AV1 slides support', () => {
411
+ webex.meetings._toggleEnableAv1SlidesSupport(true);
412
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
413
+
414
+ webex.meetings._toggleEnableAv1SlidesSupport(false);
415
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, false);
416
+ });
417
+
418
+ it('should not update config when called with a non-boolean value', () => {
419
+ webex.meetings._toggleEnableAv1SlidesSupport(true);
420
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
421
+
422
+ webex.meetings._toggleEnableAv1SlidesSupport('invalid');
423
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
424
+
425
+ webex.meetings._toggleEnableAv1SlidesSupport(undefined);
426
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
427
+ });
428
+ });
429
+ });
430
+
426
431
  describe('#_toggleStopIceGatheringAfterFirstRelayCandidate', () => {
427
432
  it('should have _toggleStopIceGatheringAfterFirstRelayCandidate', () => {
428
433
  assert.equal(
@@ -1267,14 +1272,16 @@ describe('plugin-meetings', () => {
1267
1272
  });
1268
1273
 
1269
1274
  it('creates noise reduction effect with BNR model', async () => {
1270
- const result = await webex.meetings.createNoiseReductionEffect({audioContext: {}});
1275
+ const result = await webex.meetings.createNoiseReductionEffect({
1276
+ audioContext: {addEventListener: sinon.stub()},
1277
+ });
1271
1278
 
1272
1279
  assert.exists(result);
1273
1280
  assert.instanceOf(result, NoiseReductionEffect);
1274
1281
  assert.containsAllKeys(result, ['audioContext', 'isEnabled', 'isReady', 'options']);
1275
1282
  assert.equal(result.options.authToken, 'fake_token');
1276
1283
  assert.deepEqual(result.options, {
1277
- audioContext: {},
1284
+ audioContext: {addEventListener: result.options.audioContext.addEventListener},
1278
1285
  authToken: 'fake_token',
1279
1286
  mode: 'WORKLET',
1280
1287
  avoidSimd: false,
@@ -1287,7 +1294,7 @@ describe('plugin-meetings', () => {
1287
1294
 
1288
1295
  it('creates noise reduction effect with OFMV model', async () => {
1289
1296
  const result = await webex.meetings.createNoiseReductionEffect({
1290
- audioContext: {},
1297
+ audioContext: {addEventListener: sinon.stub()},
1291
1298
  model: 'ofmv',
1292
1299
  });
1293
1300
 
@@ -1296,7 +1303,7 @@ describe('plugin-meetings', () => {
1296
1303
  assert.containsAllKeys(result, ['audioContext', 'isEnabled', 'isReady', 'options']);
1297
1304
  assert.equal(result.options.authToken, 'fake_token');
1298
1305
  assert.deepEqual(result.options, {
1299
- audioContext: {},
1306
+ audioContext: {addEventListener: result.options.audioContext.addEventListener},
1300
1307
  authToken: 'fake_token',
1301
1308
  mode: 'WORKLET',
1302
1309
  avoidSimd: false,
@@ -1309,7 +1316,7 @@ describe('plugin-meetings', () => {
1309
1316
 
1310
1317
  it('passes custom options to noise reduction effect', async () => {
1311
1318
  const result = await webex.meetings.createNoiseReductionEffect({
1312
- audioContext: {},
1319
+ audioContext: {addEventListener: sinon.stub()},
1313
1320
  mode: 'LEGACY',
1314
1321
  env: 'int',
1315
1322
  avoidSimd: true,
@@ -1355,6 +1362,87 @@ describe('plugin-meetings', () => {
1355
1362
  );
1356
1363
  });
1357
1364
  });
1365
+ describe('#fetchSitePreferencesMeViaSite', () => {
1366
+ const sitePreferencesResponse = {
1367
+ scheduling: {
1368
+ supportScheduleWebinar: true,
1369
+ webinarWebLink: 'https://go.webex.com/webappng/sites/go/webinar/scheduler',
1370
+ },
1371
+ };
1372
+
1373
+ beforeEach(() => {
1374
+ webex.meetings.request.fetchSitePreferencesMeViaSite = sinon
1375
+ .stub()
1376
+ .resolves(sitePreferencesResponse);
1377
+ });
1378
+
1379
+ it('should have #fetchSitePreferencesMeViaSite', () => {
1380
+ assert.exists(webex.meetings.fetchSitePreferencesMeViaSite);
1381
+ });
1382
+
1383
+ it('fetches scheduling preferences for the preferred Webex site by default', async () => {
1384
+ webex.meetings.preferredWebexSite = 'go.webex.com';
1385
+
1386
+ const result = await webex.meetings.fetchSitePreferencesMeViaSite();
1387
+
1388
+ assert.deepEqual(result, sitePreferencesResponse);
1389
+ assert.calledOnceWithExactly(
1390
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1391
+ {
1392
+ siteUrl: 'go.webex.com',
1393
+ }
1394
+ );
1395
+ });
1396
+
1397
+ it('uses the provided Webex site instead of the preferred Webex site', async () => {
1398
+ webex.meetings.preferredWebexSite = 'preferred.webex.com';
1399
+
1400
+ await webex.meetings.fetchSitePreferencesMeViaSite({siteUrl: 'go.webex.com'});
1401
+
1402
+ assert.calledOnceWithExactly(
1403
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1404
+ {
1405
+ siteUrl: 'go.webex.com',
1406
+ }
1407
+ );
1408
+ });
1409
+
1410
+ it('forwards custom site name and preference sections to the request helper', async () => {
1411
+ webex.meetings.preferredWebexSite = 'go.webex.com';
1412
+
1413
+ await webex.meetings.fetchSitePreferencesMeViaSite({
1414
+ siteName: 'custom-site',
1415
+ selectOptions: [SitePreferenceSelectOption.SCHEDULING],
1416
+ });
1417
+
1418
+ assert.calledOnceWithExactly(
1419
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1420
+ {
1421
+ siteUrl: 'go.webex.com',
1422
+ siteName: 'custom-site',
1423
+ selectOptions: [SitePreferenceSelectOption.SCHEDULING],
1424
+ }
1425
+ );
1426
+ });
1427
+
1428
+ it('throws when no Webex site is available', () => {
1429
+ webex.meetings.preferredWebexSite = '';
1430
+ webex.meetings.request.fetchSitePreferencesMeViaSite.throws(
1431
+ new ParameterError(
1432
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
1433
+ )
1434
+ );
1435
+
1436
+ assert.throws(
1437
+ () => webex.meetings.fetchSitePreferencesMeViaSite(),
1438
+ ParameterError,
1439
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
1440
+ );
1441
+ assert.calledOnceWithExactly(webex.meetings.request.fetchSitePreferencesMeViaSite, {
1442
+ siteUrl: '',
1443
+ });
1444
+ });
1445
+ });
1358
1446
  describe('Static shortcut proxy methods', () => {
1359
1447
  describe('MeetingCollection getByKey proxies', () => {
1360
1448
  beforeEach(() => {
@@ -1391,7 +1479,7 @@ describe('plugin-meetings', () => {
1391
1479
  it('should have #syncMeetings', () => {
1392
1480
  assert.exists(webex.meetings.syncMeetings);
1393
1481
  });
1394
- it('should do nothing and return a resolved promise if unverified guest', async () => {
1482
+ it('should skip getActiveMeetings but still call syncAllHashTreeDatasets if unverified guest', async () => {
1395
1483
  webex.meetings.request.getActiveMeetings = sinon.stub().returns(
1396
1484
  Promise.resolve({
1397
1485
  loci: [
@@ -1404,13 +1492,23 @@ describe('plugin-meetings', () => {
1404
1492
  webex.credentials.isUnverifiedGuest = true;
1405
1493
  LoggerProxy.logger.info = sinon.stub();
1406
1494
 
1495
+ const mockLocusInfo = {
1496
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1497
+ };
1498
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1499
+ meeting1: {locusInfo: mockLocusInfo},
1500
+ meeting2: {locusInfo: undefined},
1501
+ meeting3: {},
1502
+ });
1503
+
1407
1504
  await webex.meetings.syncMeetings();
1408
1505
 
1409
1506
  assert.notCalled(webex.meetings.request.getActiveMeetings);
1410
1507
  assert.calledWith(
1411
1508
  LoggerProxy.logger.info,
1412
- 'Meetings:index#syncMeetings --> skipping meeting sync as unverified guest'
1509
+ 'Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync'
1413
1510
  );
1511
+ assert.calledOnce(mockLocusInfo.syncAllHashTreeDatasets);
1414
1512
  });
1415
1513
  describe('succesful requests', () => {
1416
1514
  beforeEach(() => {
@@ -1429,6 +1527,9 @@ describe('plugin-meetings', () => {
1429
1527
  webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
1430
1528
  locusInfo,
1431
1529
  });
1530
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1531
+ meeting1: {locusInfo, locusUrl: url1},
1532
+ });
1432
1533
  });
1433
1534
  it('tests the sync meeting calls for existing meeting', async () => {
1434
1535
  await webex.meetings.syncMeetings();
@@ -1436,6 +1537,7 @@ describe('plugin-meetings', () => {
1436
1537
  assert.calledOnce(webex.meetings.meetingCollection.getByKey);
1437
1538
  assert.calledOnce(locusInfo.parse);
1438
1539
  assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
1540
+ assert.calledOnce(locusInfo.syncAllHashTreeDatasets);
1439
1541
  });
1440
1542
  });
1441
1543
  describe('when meeting is not returned', () => {
@@ -1474,7 +1576,7 @@ describe('plugin-meetings', () => {
1474
1576
  url: url1,
1475
1577
  },
1476
1578
  hashTreeMessage: undefined,
1477
- });
1579
+ }, sinon.match.func);
1478
1580
  });
1479
1581
  });
1480
1582
  describe('when destroying meeting is needed', () => {
@@ -1520,7 +1622,7 @@ describe('plugin-meetings', () => {
1520
1622
  it('destroy any meeting that has no active locus url if keepOnlyLocusMeetings is not defined', async () => {
1521
1623
  await webex.meetings.syncMeetings();
1522
1624
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1523
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1625
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1524
1626
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1525
1627
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting1);
1526
1628
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting2);
@@ -1532,7 +1634,7 @@ describe('plugin-meetings', () => {
1532
1634
  it('destroy any meeting that has no active locus url if keepOnlyLocusMeetings === true', async () => {
1533
1635
  await webex.meetings.syncMeetings({keepOnlyLocusMeetings: true});
1534
1636
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1535
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1637
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1536
1638
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1537
1639
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting1);
1538
1640
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting2);
@@ -1544,7 +1646,7 @@ describe('plugin-meetings', () => {
1544
1646
  it('destroy any LOCUS meetings that have no active locus url if keepOnlyLocusMeetings === false', async () => {
1545
1647
  await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1546
1648
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1547
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1649
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1548
1650
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1549
1651
  assert.callCount(destroySpy, 1);
1550
1652
 
@@ -1552,6 +1654,147 @@ describe('plugin-meetings', () => {
1552
1654
  });
1553
1655
  });
1554
1656
  });
1657
+
1658
+ describe('when globalMeetingId preserves breakout meetings', () => {
1659
+ let destroySpy;
1660
+ let cleanUpSpy;
1661
+
1662
+ beforeEach(() => {
1663
+ destroySpy = sinon.spy(webex.meetings, 'destroy');
1664
+ cleanUpSpy = sinon.stub(MeetingUtil, 'cleanUp').returns(Promise.resolve());
1665
+ });
1666
+
1667
+ afterEach(() => {
1668
+ cleanUpSpy.restore();
1669
+ });
1670
+
1671
+ it('should not destroy a meeting whose globalMeetingId matches an active locus', async () => {
1672
+ const meetingCollectionMeetings = {
1673
+ breakoutMeeting: {
1674
+ locusUrl: 'breakout-url',
1675
+ locusInfo: {
1676
+ info: {globalMeetingId: 'gmid-123'},
1677
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1678
+ },
1679
+ sendCallAnalyzerMetrics: sinon.stub(),
1680
+ },
1681
+ };
1682
+
1683
+ webex.meetings.meetingCollection.getAll = sinon
1684
+ .stub()
1685
+ .returns(meetingCollectionMeetings);
1686
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1687
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1688
+ });
1689
+
1690
+ await webex.meetings.syncMeetings();
1691
+
1692
+ assert.notCalled(destroySpy);
1693
+ });
1694
+
1695
+ it('should destroy a meeting whose globalMeetingId does NOT match any active locus', async () => {
1696
+ const meetingCollectionMeetings = {
1697
+ breakoutMeeting: {
1698
+ locusUrl: 'breakout-url',
1699
+ locusInfo: {
1700
+ info: {globalMeetingId: 'gmid-other'},
1701
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1702
+ },
1703
+ sendCallAnalyzerMetrics: sinon.stub(),
1704
+ },
1705
+ };
1706
+
1707
+ webex.meetings.meetingCollection.getAll = sinon
1708
+ .stub()
1709
+ .returns(meetingCollectionMeetings);
1710
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1711
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1712
+ });
1713
+
1714
+ await webex.meetings.syncMeetings();
1715
+
1716
+ assert.calledOnce(destroySpy);
1717
+ assert.calledWith(destroySpy, meetingCollectionMeetings.breakoutMeeting);
1718
+ });
1719
+ });
1720
+
1721
+ describe('skipHashTreeSync parameter', () => {
1722
+ it('should skip syncAllHashTreeDatasets when skipHashTreeSync is true', async () => {
1723
+ const mockLocusInfo = {
1724
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1725
+ };
1726
+
1727
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1728
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1729
+ meeting1: {locusInfo: mockLocusInfo},
1730
+ });
1731
+
1732
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: true});
1733
+
1734
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1735
+ assert.notCalled(mockLocusInfo.syncAllHashTreeDatasets);
1736
+ });
1737
+
1738
+ it('should call syncAllHashTreeDatasets when skipHashTreeSync is false (default)', async () => {
1739
+ const mockLocusInfo = {
1740
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1741
+ };
1742
+
1743
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1744
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1745
+ meeting1: {locusInfo: mockLocusInfo},
1746
+ });
1747
+
1748
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: false});
1749
+
1750
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1751
+ assert.calledOnce(mockLocusInfo.syncAllHashTreeDatasets);
1752
+ });
1753
+ });
1754
+
1755
+ describe('syncAllHashTreeDatasets in syncMeetings', () => {
1756
+ it('should call syncAllHashTreeDatasets for multiple meetings, skipping those without locusInfo', async () => {
1757
+ const mockLocusInfo1 = {
1758
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1759
+ };
1760
+ const mockLocusInfo2 = {
1761
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1762
+ };
1763
+
1764
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1765
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1766
+ meeting1: {locusInfo: mockLocusInfo1},
1767
+ meeting2: {locusInfo: undefined},
1768
+ meeting3: {locusInfo: mockLocusInfo2},
1769
+ meeting4: {},
1770
+ });
1771
+
1772
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1773
+
1774
+ assert.calledOnce(mockLocusInfo1.syncAllHashTreeDatasets);
1775
+ assert.calledOnce(mockLocusInfo2.syncAllHashTreeDatasets);
1776
+ });
1777
+
1778
+ it('should not call syncAllHashTreeDatasets when getActiveMeetings throws an error', async () => {
1779
+ const mockLocusInfo = {
1780
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1781
+ };
1782
+
1783
+ webex.meetings.request.getActiveMeetings = sinon.stub().rejects(new Error('network error'));
1784
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1785
+ meeting1: {locusInfo: mockLocusInfo},
1786
+ });
1787
+
1788
+ try {
1789
+ await webex.meetings.syncMeetings();
1790
+ assert.fail('should have thrown');
1791
+ } catch (err) {
1792
+ assert.equal(err.message, 'network error');
1793
+ }
1794
+
1795
+ assert.notCalled(mockLocusInfo.syncAllHashTreeDatasets);
1796
+ });
1797
+ });
1555
1798
  });
1556
1799
  describe('#fetchStaticMeetingLink', () => {
1557
1800
  const conversationUrl = 'conv.fakeconversationurl.com';
@@ -1635,6 +1878,141 @@ describe('plugin-meetings', () => {
1635
1878
  );
1636
1879
  });
1637
1880
 
1881
+ describe('wasm runtime performance telemetry', () => {
1882
+ const correlationId = 'wasm-corr-id';
1883
+ const benchmarkMeasurements = {
1884
+ divRatio: 1.888,
1885
+ sqrtRatio: 3.474,
1886
+ addNsPerOp: 2.006,
1887
+ addMedianMs: 32.1,
1888
+ divMedianMs: 60.6,
1889
+ sqrtMedianMs: 111.5,
1890
+ };
1891
+ const probeResult = {
1892
+ status: 'slow',
1893
+ capability: 'not capable',
1894
+ reason: null,
1895
+ measurements: benchmarkMeasurements,
1896
+ };
1897
+ const expectedMetricFields = {
1898
+ status: probeResult.status,
1899
+ capability: probeResult.capability,
1900
+ reason: probeResult.reason,
1901
+ ...benchmarkMeasurements,
1902
+ correlation_id: correlationId,
1903
+ };
1904
+ let metricsSpy;
1905
+ let probeCheckStub;
1906
+
1907
+ beforeEach(() => {
1908
+ webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves({});
1909
+ webex.meetings.createMeeting = sinon
1910
+ .stub()
1911
+ .returns(Promise.resolve({on: () => true, correlationId}));
1912
+ probeCheckStub = sinon.stub(WasmRuntimeProbe, 'check').resolves(probeResult);
1913
+ metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
1914
+ });
1915
+
1916
+ afterEach(() => {
1917
+ probeCheckStub.restore();
1918
+ metricsSpy.restore();
1919
+ });
1920
+
1921
+ it('emits js_sdk_wasm_runtime_performance once after a meeting is created', async () => {
1922
+ await webex.meetings.create(test1, test2);
1923
+ await testUtils.flushPromises();
1924
+
1925
+ assert.calledOnceWithExactly(probeCheckStub);
1926
+ assert.calledOnceWithExactly(
1927
+ metricsSpy,
1928
+ 'js_sdk_wasm_runtime_performance',
1929
+ expectedMetricFields
1930
+ );
1931
+ });
1932
+
1933
+ it('logs the WASM runtime status after a meeting is created', async () => {
1934
+ const loggerLogStub = sinon.stub(LoggerProxy.logger, 'log');
1935
+
1936
+ await webex.meetings.create(test1, test2);
1937
+ await testUtils.flushPromises();
1938
+
1939
+ assert.calledOnceWithExactly(probeCheckStub);
1940
+ assert.calledOnceWithExactly(
1941
+ loggerLogStub,
1942
+ sinon.match(
1943
+ /Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status/
1944
+ )
1945
+ );
1946
+ loggerLogStub.restore();
1947
+ });
1948
+
1949
+ it('emits only once even when create() is called multiple times', async () => {
1950
+ await webex.meetings.create(test1, test2);
1951
+ await webex.meetings.create(test1, test2);
1952
+ await testUtils.flushPromises();
1953
+
1954
+ assert.calledOnceWithExactly(probeCheckStub);
1955
+ assert.calledOnceWithExactly(
1956
+ metricsSpy,
1957
+ 'js_sdk_wasm_runtime_performance',
1958
+ expectedMetricFields
1959
+ );
1960
+ });
1961
+
1962
+ it('emits the reason with null measurement fields when no measurements are available', async () => {
1963
+ probeCheckStub.resolves({
1964
+ status: 'unknown',
1965
+ capability: 'unknown',
1966
+ reason: 'worker_timeout',
1967
+ measurements: null,
1968
+ });
1969
+
1970
+ await webex.meetings.create(test1, test2);
1971
+ await testUtils.flushPromises();
1972
+
1973
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
1974
+ status: 'unknown',
1975
+ capability: 'unknown',
1976
+ reason: 'worker_timeout',
1977
+ divRatio: null,
1978
+ sqrtRatio: null,
1979
+ addNsPerOp: null,
1980
+ addMedianMs: null,
1981
+ divMedianMs: null,
1982
+ sqrtMedianMs: null,
1983
+ correlation_id: correlationId,
1984
+ });
1985
+ });
1986
+
1987
+ it('still resolves the meeting when the probe fails', async () => {
1988
+ const loggerErrorStub = sinon.stub(LoggerProxy.logger, 'error');
1989
+ probeCheckStub.rejects(new Error('probe failed'));
1990
+
1991
+ const created = await webex.meetings.create(test1, test2);
1992
+ await testUtils.flushPromises();
1993
+
1994
+ assert.equal(created.correlationId, correlationId);
1995
+ assert.notCalled(metricsSpy);
1996
+ assert.calledOnceWithExactly(
1997
+ loggerErrorStub,
1998
+ sinon.match(/Meetings:index#emitWasmRuntimePerformance --> ERROR/)
1999
+ );
2000
+ loggerErrorStub.restore();
2001
+ });
2002
+
2003
+ it('does not re-run the probe when create() returns an already-created meeting', async () => {
2004
+ webex.meetings.meetingCollection.getByKey = sinon
2005
+ .stub()
2006
+ .returns({updateCallStateForMetrics: sinon.stub()});
2007
+
2008
+ await webex.meetings.create(test1, test2);
2009
+ await testUtils.flushPromises();
2010
+
2011
+ assert.notCalled(probeCheckStub);
2012
+ assert.notCalled(metricsSpy);
2013
+ });
2014
+ });
2015
+
1638
2016
  it('should call MeetingInfo#fetchInfoOptions() with proper params', () => {
1639
2017
  webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves(infoOptions);
1640
2018
 
@@ -2015,7 +2393,7 @@ describe('plugin-meetings', () => {
2015
2393
  },
2016
2394
  },
2017
2395
  hashTreeMessage: undefined,
2018
- });
2396
+ }, sinon.match.func);
2019
2397
  });
2020
2398
  it('should setup the meeting from a hash tree event', async () => {
2021
2399
  const selfData = {};
@@ -2049,7 +2427,7 @@ describe('plugin-meetings', () => {
2049
2427
  info: infoData,
2050
2428
  },
2051
2429
  hashTreeMessage,
2052
- });
2430
+ }, sinon.match.func);
2053
2431
  });
2054
2432
 
2055
2433
  it('should ignore hash tree event when created locus has INACTIVE fullState', async () => {
@@ -2129,7 +2507,7 @@ describe('plugin-meetings', () => {
2129
2507
  },
2130
2508
  },
2131
2509
  hashTreeMessage: undefined,
2132
- });
2510
+ }, sinon.match.func);
2133
2511
  });
2134
2512
 
2135
2513
  it('sends client event correctly on finally', async () => {
@@ -2205,7 +2583,7 @@ describe('plugin-meetings', () => {
2205
2583
  },
2206
2584
  },
2207
2585
  hashTreeMessage: undefined,
2208
- });
2586
+ }, sinon.match.func);
2209
2587
  });
2210
2588
 
2211
2589
  const generateFakeLocusData = (isUnifiedSpaceMeeting) => ({
@@ -2337,7 +2715,11 @@ describe('plugin-meetings', () => {
2337
2715
  undefined,
2338
2716
  undefined,
2339
2717
  extraParams,
2340
- {meetingId: meeting.id, sendCAevents}
2718
+ {
2719
+ meetingId: meeting.id,
2720
+ sendCAevents,
2721
+ correlationId: meeting.correlationId,
2722
+ }
2341
2723
  );
2342
2724
  }
2343
2725
 
@@ -2880,6 +3262,30 @@ describe('plugin-meetings', () => {
2880
3262
 
2881
3263
  assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
2882
3264
  });
3265
+
3266
+ [
3267
+ {fullStateType: 'CALL'},
3268
+ {fullStateType: 'SIP_BRIDGE'},
3269
+ {fullStateType: 'SPACE_SHARE'},
3270
+ ].forEach(({fullStateType}) => {
3271
+ it(`skips meeting info fetch when LOCUS_ID destination is a 1:1 call (fullState.type ${fullStateType})`, async () => {
3272
+ const locusDestination = {
3273
+ fullState: {type: fullStateType},
3274
+ };
3275
+
3276
+ const meeting = await webex.meetings.createMeeting(
3277
+ locusDestination,
3278
+ DESTINATION_TYPE.LOCUS_ID
3279
+ );
3280
+
3281
+ assert.instanceOf(
3282
+ meeting,
3283
+ Meeting,
3284
+ 'createMeeting should eventually resolve to a Meeting Object'
3285
+ );
3286
+ assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
3287
+ });
3288
+ });
2883
3289
  });
2884
3290
 
2885
3291
  describe('rejected MeetingInfo.#fetchMeetingInfo - does not log for known Error types', () => {
@@ -3119,7 +3525,7 @@ describe('plugin-meetings', () => {
3119
3525
  loggerProxySpy,
3120
3526
  'Failed to fetch preferred site from user - no site will be set'
3121
3527
  );
3122
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3528
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3123
3529
  });
3124
3530
 
3125
3531
  it('should fall back to fetching the site from the user', async () => {
@@ -3137,7 +3543,6 @@ describe('plugin-meetings', () => {
3137
3543
 
3138
3544
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3139
3545
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3140
- '',
3141
3546
  'site.webex.com',
3142
3547
  ]);
3143
3548
  assert.notCalled(loggerProxySpy);
@@ -3161,7 +3566,7 @@ describe('plugin-meetings', () => {
3161
3566
  loggerProxySpy,
3162
3567
  'Failed to fetch preferred site from user - no site will be set'
3163
3568
  );
3164
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3569
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3165
3570
  });
3166
3571
  }
3167
3572
  );
@@ -3178,7 +3583,7 @@ describe('plugin-meetings', () => {
3178
3583
  loggerProxySpy,
3179
3584
  'Failed to fetch preferred site from user - no site will be set'
3180
3585
  );
3181
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3586
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3182
3587
  });
3183
3588
 
3184
3589
  it('should fall back to fetching the site from the user', async () => {
@@ -3197,7 +3602,6 @@ describe('plugin-meetings', () => {
3197
3602
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3198
3603
  assert.notCalled(loggerProxySpy);
3199
3604
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3200
- '',
3201
3605
  'site.webex.com',
3202
3606
  ]);
3203
3607
  });
@@ -3220,7 +3624,7 @@ describe('plugin-meetings', () => {
3220
3624
  loggerProxySpy,
3221
3625
  'Failed to fetch preferred site from user - no site will be set'
3222
3626
  );
3223
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3627
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3224
3628
  });
3225
3629
  }
3226
3630
  );
@@ -3237,7 +3641,7 @@ describe('plugin-meetings', () => {
3237
3641
  loggerProxySpy,
3238
3642
  'Failed to fetch preferred site from user - no site will be set'
3239
3643
  );
3240
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3644
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3241
3645
  });
3242
3646
  });
3243
3647
  });
@@ -3303,10 +3707,13 @@ describe('plugin-meetings', () => {
3303
3707
  };
3304
3708
 
3305
3709
  it('triggers correct event when SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE emitted', async () => {
3710
+ sinon.stub(meeting, 'updateMeetingActions');
3306
3711
  checkSelfTrigger(
3307
3712
  LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
3308
3713
  EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST
3309
3714
  );
3715
+ assert.calledOnce(meeting.updateMeetingActions);
3716
+ meeting.updateMeetingActions.restore();
3310
3717
  });
3311
3718
 
3312
3719
  it('triggers correct event when SELF_IS_SHARING_BLOCKED_CHANGE emitted', async () => {
@@ -3459,6 +3866,21 @@ describe('plugin-meetings', () => {
3459
3866
  'Meetings:index#isNeedHandleMainLocus --> self device left&moved in main locus with self joined status, not need to handle'
3460
3867
  );
3461
3868
  });
3869
+
3870
+ it('check breakout ended with self removed, return false', () => {
3871
+ webex.meetings.meetingCollection.getActiveBreakoutLocus = sinon.stub().returns(null);
3872
+ newLocus.self.state = 'LEFT';
3873
+ newLocus.self.reason = 'OTHER';
3874
+ newLocus.self.removed = true;
3875
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3876
+ LoggerProxy.logger.log = sinon.stub();
3877
+ const result = webex.meetings.isNeedHandleMainLocus(meeting, newLocus);
3878
+ assert.equal(result, false);
3879
+ assert.calledWith(
3880
+ LoggerProxy.logger.log,
3881
+ 'Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle'
3882
+ );
3883
+ });
3462
3884
  });
3463
3885
 
3464
3886
  describe('#isNeedHandleLocusDTO', () => {
@@ -3519,6 +3941,18 @@ describe('plugin-meetings', () => {
3519
3941
  const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3520
3942
  assert.equal(result, false);
3521
3943
  });
3944
+ it('breakout session with breakout ended, return false', () => {
3945
+ newLocus.controls.breakout = {
3946
+ sessionType: 'BREAKOUT',
3947
+ };
3948
+ newLocus.self.state = 'LEFT';
3949
+ newLocus.self.reason = 'OTHER';
3950
+ newLocus.self.devices = [];
3951
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3952
+ LoggerProxy.logger.log = sinon.stub();
3953
+ const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3954
+ assert.equal(result, false);
3955
+ });
3522
3956
  it('moved to lobby, return true', () => {
3523
3957
  newLocus.controls.breakout = {
3524
3958
  sessionType: 'MAIN',
@@ -3996,6 +4430,9 @@ describe('plugin-meetings', () => {
3996
4430
 
3997
4431
  triggerProxyStub.restore();
3998
4432
 
4433
+ // Never resolve, so the create()-triggered WASM emit can't reach the metrics spy below.
4434
+ sinon.stub(WasmRuntimeProbe, 'check').returns(new Promise(() => {}));
4435
+
3999
4436
  metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
4000
4437
 
4001
4438
  meeting = await webex.meetings.create('test');