@webex/plugin-meetings 3.12.0-next.12 → 3.12.0-next.121

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 (227) 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/breakouts/breakout.js +8 -3
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/events.js +29 -14
  7. package/dist/breakouts/events.js.map +1 -1
  8. package/dist/breakouts/index.js +90 -3
  9. package/dist/breakouts/index.js.map +1 -1
  10. package/dist/common/errors/webex-errors.js +49 -5
  11. package/dist/common/errors/webex-errors.js.map +1 -1
  12. package/dist/config.js +2 -2
  13. package/dist/config.js.map +1 -1
  14. package/dist/constants.js +37 -10
  15. package/dist/constants.js.map +1 -1
  16. package/dist/controls-options-manager/index.js +46 -10
  17. package/dist/controls-options-manager/index.js.map +1 -1
  18. package/dist/hashTree/constants.js +4 -1
  19. package/dist/hashTree/constants.js.map +1 -1
  20. package/dist/hashTree/hashTreeParser.js +1045 -393
  21. package/dist/hashTree/hashTreeParser.js.map +1 -1
  22. package/dist/hashTree/utils.js +20 -0
  23. package/dist/hashTree/utils.js.map +1 -1
  24. package/dist/index.js +7 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  27. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  28. package/dist/interceptors/locusRetry.js +23 -8
  29. package/dist/interceptors/locusRetry.js.map +1 -1
  30. package/dist/interpretation/index.js +10 -1
  31. package/dist/interpretation/index.js.map +1 -1
  32. package/dist/interpretation/interpretation.types.js +7 -0
  33. package/dist/interpretation/interpretation.types.js.map +1 -0
  34. package/dist/interpretation/siLanguage.js +1 -1
  35. package/dist/locus-info/controlsUtils.js +4 -1
  36. package/dist/locus-info/controlsUtils.js.map +1 -1
  37. package/dist/locus-info/index.js +406 -121
  38. package/dist/locus-info/index.js.map +1 -1
  39. package/dist/locus-info/infoUtils.js +36 -5
  40. package/dist/locus-info/infoUtils.js.map +1 -1
  41. package/dist/locus-info/types.js +19 -0
  42. package/dist/locus-info/types.js.map +1 -1
  43. package/dist/media/MediaConnectionAwaiter.js +15 -2
  44. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  45. package/dist/media/index.js +8 -2
  46. package/dist/media/index.js.map +1 -1
  47. package/dist/media/properties.js +4 -5
  48. package/dist/media/properties.js.map +1 -1
  49. package/dist/meeting/in-meeting-actions.js +5 -1
  50. package/dist/meeting/in-meeting-actions.js.map +1 -1
  51. package/dist/meeting/index.js +1667 -834
  52. package/dist/meeting/index.js.map +1 -1
  53. package/dist/meeting/locusMediaRequest.js +229 -82
  54. package/dist/meeting/locusMediaRequest.js.map +1 -1
  55. package/dist/meeting/muteState.js +10 -1
  56. package/dist/meeting/muteState.js.map +1 -1
  57. package/dist/meeting/request.js +5 -2
  58. package/dist/meeting/request.js.map +1 -1
  59. package/dist/meeting/util.js +34 -2
  60. package/dist/meeting/util.js.map +1 -1
  61. package/dist/meeting-info/meeting-info-v2.js +2 -2
  62. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  63. package/dist/meetings/index.js +256 -118
  64. package/dist/meetings/index.js.map +1 -1
  65. package/dist/meetings/meetings.types.js +6 -1
  66. package/dist/meetings/meetings.types.js.map +1 -1
  67. package/dist/meetings/request.js +39 -0
  68. package/dist/meetings/request.js.map +1 -1
  69. package/dist/meetings/util.js +116 -18
  70. package/dist/meetings/util.js.map +1 -1
  71. package/dist/member/index.js +10 -0
  72. package/dist/member/index.js.map +1 -1
  73. package/dist/member/types.js.map +1 -1
  74. package/dist/member/util.js +30 -0
  75. package/dist/member/util.js.map +1 -1
  76. package/dist/members/index.js +101 -43
  77. package/dist/members/index.js.map +1 -1
  78. package/dist/members/util.js +8 -1
  79. package/dist/members/util.js.map +1 -1
  80. package/dist/metrics/constants.js +7 -1
  81. package/dist/metrics/constants.js.map +1 -1
  82. package/dist/multistream/codec/constants.js +63 -0
  83. package/dist/multistream/codec/constants.js.map +1 -0
  84. package/dist/multistream/mediaRequestManager.js +62 -15
  85. package/dist/multistream/mediaRequestManager.js.map +1 -1
  86. package/dist/multistream/receiveSlot.js +9 -0
  87. package/dist/multistream/receiveSlot.js.map +1 -1
  88. package/dist/reachability/clusterReachability.js.map +1 -1
  89. package/dist/reachability/index.js +121 -83
  90. package/dist/reachability/index.js.map +1 -1
  91. package/dist/reachability/reachability.types.js +2 -0
  92. package/dist/reachability/reachability.types.js.map +1 -1
  93. package/dist/reachability/util.js +45 -0
  94. package/dist/reachability/util.js.map +1 -1
  95. package/dist/reactions/reactions.type.js.map +1 -1
  96. package/dist/recording-controller/index.js +1 -3
  97. package/dist/recording-controller/index.js.map +1 -1
  98. package/dist/roap/turnDiscovery.js +8 -1
  99. package/dist/roap/turnDiscovery.js.map +1 -1
  100. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  101. package/dist/types/config.d.ts +2 -2
  102. package/dist/types/constants.d.ts +13 -1
  103. package/dist/types/controls-options-manager/index.d.ts +16 -0
  104. package/dist/types/hashTree/constants.d.ts +1 -0
  105. package/dist/types/hashTree/hashTreeParser.d.ts +189 -22
  106. package/dist/types/hashTree/utils.d.ts +7 -0
  107. package/dist/types/index.d.ts +3 -0
  108. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  109. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  110. package/dist/types/locus-info/index.d.ts +61 -7
  111. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  112. package/dist/types/locus-info/types.d.ts +21 -1
  113. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  114. package/dist/types/media/properties.d.ts +6 -2
  115. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  116. package/dist/types/meeting/index.d.ts +175 -11
  117. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  118. package/dist/types/meeting/request.d.ts +1 -0
  119. package/dist/types/meeting/util.d.ts +9 -0
  120. package/dist/types/meetings/index.d.ts +38 -18
  121. package/dist/types/meetings/meetings.types.d.ts +15 -0
  122. package/dist/types/meetings/request.d.ts +14 -0
  123. package/dist/types/member/index.d.ts +1 -0
  124. package/dist/types/member/types.d.ts +1 -0
  125. package/dist/types/member/util.d.ts +9 -0
  126. package/dist/types/members/index.d.ts +15 -2
  127. package/dist/types/members/util.d.ts +1 -5
  128. package/dist/types/metrics/constants.d.ts +6 -0
  129. package/dist/types/multistream/codec/constants.d.ts +7 -0
  130. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  131. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  132. package/dist/types/reachability/index.d.ts +10 -3
  133. package/dist/types/reachability/reachability.types.d.ts +7 -0
  134. package/dist/types/reachability/util.d.ts +17 -0
  135. package/dist/types/reactions/reactions.type.d.ts +3 -0
  136. package/dist/webinar/index.js +307 -161
  137. package/dist/webinar/index.js.map +1 -1
  138. package/package.json +23 -23
  139. package/src/aiEnableRequest/index.ts +16 -0
  140. package/src/breakouts/breakout.ts +3 -1
  141. package/src/breakouts/events.ts +33 -11
  142. package/src/breakouts/index.ts +110 -1
  143. package/src/common/errors/webex-errors.ts +50 -3
  144. package/src/config.ts +2 -2
  145. package/src/constants.ts +21 -3
  146. package/src/controls-options-manager/index.ts +62 -10
  147. package/src/hashTree/constants.ts +7 -0
  148. package/src/hashTree/hashTreeParser.ts +796 -192
  149. package/src/hashTree/utils.ts +19 -0
  150. package/src/index.ts +6 -0
  151. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  152. package/src/interceptors/locusRetry.ts +25 -4
  153. package/src/interpretation/index.ts +27 -9
  154. package/src/interpretation/interpretation.types.ts +11 -0
  155. package/src/locus-info/controlsUtils.ts +3 -1
  156. package/src/locus-info/index.ts +412 -130
  157. package/src/locus-info/infoUtils.ts +41 -6
  158. package/src/locus-info/types.ts +25 -1
  159. package/src/media/MediaConnectionAwaiter.ts +21 -4
  160. package/src/media/index.ts +10 -1
  161. package/src/media/properties.ts +8 -3
  162. package/src/meeting/in-meeting-actions.ts +8 -0
  163. package/src/meeting/index.ts +922 -116
  164. package/src/meeting/locusMediaRequest.ts +106 -6
  165. package/src/meeting/muteState.ts +10 -1
  166. package/src/meeting/request.ts +11 -0
  167. package/src/meeting/util.ts +46 -5
  168. package/src/meeting-info/meeting-info-v2.ts +4 -2
  169. package/src/meetings/index.ts +168 -79
  170. package/src/meetings/meetings.types.ts +19 -0
  171. package/src/meetings/request.ts +43 -0
  172. package/src/meetings/util.ts +117 -4
  173. package/src/member/index.ts +10 -0
  174. package/src/member/types.ts +1 -0
  175. package/src/member/util.ts +29 -0
  176. package/src/members/index.ts +70 -7
  177. package/src/members/util.ts +12 -4
  178. package/src/metrics/constants.ts +6 -0
  179. package/src/multistream/codec/constants.ts +58 -0
  180. package/src/multistream/mediaRequestManager.ts +119 -28
  181. package/src/multistream/receiveSlot.ts +18 -0
  182. package/src/reachability/clusterReachability.ts +3 -2
  183. package/src/reachability/index.ts +47 -16
  184. package/src/reachability/reachability.types.ts +11 -0
  185. package/src/reachability/util.ts +36 -0
  186. package/src/reactions/reactions.type.ts +3 -0
  187. package/src/recording-controller/index.ts +1 -2
  188. package/src/roap/turnDiscovery.ts +9 -1
  189. package/src/webinar/index.ts +216 -38
  190. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  191. package/test/unit/spec/breakouts/breakout.ts +9 -3
  192. package/test/unit/spec/breakouts/events.ts +120 -2
  193. package/test/unit/spec/breakouts/index.ts +191 -2
  194. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  195. package/test/unit/spec/controls-options-manager/index.js +139 -32
  196. package/test/unit/spec/hashTree/hashTreeParser.ts +2299 -243
  197. package/test/unit/spec/hashTree/utils.ts +37 -0
  198. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  199. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  200. package/test/unit/spec/interpretation/index.ts +26 -4
  201. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  202. package/test/unit/spec/locus-info/index.js +643 -63
  203. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  204. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  205. package/test/unit/spec/media/index.ts +92 -0
  206. package/test/unit/spec/media/properties.ts +23 -23
  207. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  208. package/test/unit/spec/meeting/index.js +2704 -135
  209. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  210. package/test/unit/spec/meeting/muteState.js +81 -0
  211. package/test/unit/spec/meeting/request.js +12 -0
  212. package/test/unit/spec/meeting/utils.js +153 -1
  213. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  214. package/test/unit/spec/meetings/index.js +479 -48
  215. package/test/unit/spec/meetings/request.js +141 -0
  216. package/test/unit/spec/meetings/utils.js +402 -51
  217. package/test/unit/spec/member/index.js +7 -0
  218. package/test/unit/spec/member/util.js +89 -0
  219. package/test/unit/spec/members/index.js +216 -0
  220. package/test/unit/spec/members/request.js +37 -1
  221. package/test/unit/spec/members/utils.js +63 -0
  222. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  223. package/test/unit/spec/reachability/index.ts +128 -46
  224. package/test/unit/spec/reachability/util.ts +31 -0
  225. package/test/unit/spec/recording-controller/index.js +9 -8
  226. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  227. 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,106 @@ describe('plugin-meetings', () => {
1635
1878
  );
1636
1879
  });
1637
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
+
1638
1981
  it('should call MeetingInfo#fetchInfoOptions() with proper params', () => {
1639
1982
  webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves(infoOptions);
1640
1983
 
@@ -2015,7 +2358,7 @@ describe('plugin-meetings', () => {
2015
2358
  },
2016
2359
  },
2017
2360
  hashTreeMessage: undefined,
2018
- });
2361
+ }, sinon.match.func);
2019
2362
  });
2020
2363
  it('should setup the meeting from a hash tree event', async () => {
2021
2364
  const selfData = {};
@@ -2049,7 +2392,7 @@ describe('plugin-meetings', () => {
2049
2392
  info: infoData,
2050
2393
  },
2051
2394
  hashTreeMessage,
2052
- });
2395
+ }, sinon.match.func);
2053
2396
  });
2054
2397
 
2055
2398
  it('should ignore hash tree event when created locus has INACTIVE fullState', async () => {
@@ -2129,7 +2472,7 @@ describe('plugin-meetings', () => {
2129
2472
  },
2130
2473
  },
2131
2474
  hashTreeMessage: undefined,
2132
- });
2475
+ }, sinon.match.func);
2133
2476
  });
2134
2477
 
2135
2478
  it('sends client event correctly on finally', async () => {
@@ -2205,7 +2548,7 @@ describe('plugin-meetings', () => {
2205
2548
  },
2206
2549
  },
2207
2550
  hashTreeMessage: undefined,
2208
- });
2551
+ }, sinon.match.func);
2209
2552
  });
2210
2553
 
2211
2554
  const generateFakeLocusData = (isUnifiedSpaceMeeting) => ({
@@ -2833,6 +3176,39 @@ describe('plugin-meetings', () => {
2833
3176
  checkCreateMeetingWithNoMeetingInfo(true, true);
2834
3177
  });
2835
3178
 
3179
+ it('does not emit meeting:added when meeting is destroyed due to missing meeting info', async () => {
3180
+ // Make destroy actually remove the meeting from the collection
3181
+ // so that getMeetingByType returns null in the finally block
3182
+ webex.meetings.destroy = sinon.stub().callsFake((meeting) => {
3183
+ webex.meetings.meetingCollection.delete(meeting.id);
3184
+ });
3185
+
3186
+ try {
3187
+ await webex.meetings.createMeeting(
3188
+ 'test destination',
3189
+ 'test type',
3190
+ undefined,
3191
+ undefined,
3192
+ undefined,
3193
+ true
3194
+ );
3195
+ assert.fail('should have thrown NoMeetingInfoError');
3196
+ } catch (err) {
3197
+ assert.instanceOf(err, NoMeetingInfoError);
3198
+ }
3199
+
3200
+ assert.calledOnce(webex.meetings.destroy);
3201
+
3202
+ // meeting:added should NOT have been triggered since the meeting was destroyed
3203
+ assert.neverCalledWith(
3204
+ TriggerProxy.trigger,
3205
+ sinon.match.any,
3206
+ sinon.match({function: 'createMeeting'}),
3207
+ 'meeting:added',
3208
+ sinon.match.any
3209
+ );
3210
+ });
3211
+
2836
3212
  it('creates the meeting avoiding meeting info fetch by passing type as DESTINATION_TYPE.ONE_ON_ONE_CALL', async () => {
2837
3213
  const meeting = await webex.meetings.createMeeting(
2838
3214
  'test destination',
@@ -2847,6 +3223,30 @@ describe('plugin-meetings', () => {
2847
3223
 
2848
3224
  assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
2849
3225
  });
3226
+
3227
+ [
3228
+ {fullStateType: 'CALL'},
3229
+ {fullStateType: 'SIP_BRIDGE'},
3230
+ {fullStateType: 'SPACE_SHARE'},
3231
+ ].forEach(({fullStateType}) => {
3232
+ it(`skips meeting info fetch when LOCUS_ID destination is a 1:1 call (fullState.type ${fullStateType})`, async () => {
3233
+ const locusDestination = {
3234
+ fullState: {type: fullStateType},
3235
+ };
3236
+
3237
+ const meeting = await webex.meetings.createMeeting(
3238
+ locusDestination,
3239
+ DESTINATION_TYPE.LOCUS_ID
3240
+ );
3241
+
3242
+ assert.instanceOf(
3243
+ meeting,
3244
+ Meeting,
3245
+ 'createMeeting should eventually resolve to a Meeting Object'
3246
+ );
3247
+ assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
3248
+ });
3249
+ });
2850
3250
  });
2851
3251
 
2852
3252
  describe('rejected MeetingInfo.#fetchMeetingInfo - does not log for known Error types', () => {
@@ -3086,7 +3486,7 @@ describe('plugin-meetings', () => {
3086
3486
  loggerProxySpy,
3087
3487
  'Failed to fetch preferred site from user - no site will be set'
3088
3488
  );
3089
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3489
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3090
3490
  });
3091
3491
 
3092
3492
  it('should fall back to fetching the site from the user', async () => {
@@ -3104,7 +3504,6 @@ describe('plugin-meetings', () => {
3104
3504
 
3105
3505
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3106
3506
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3107
- '',
3108
3507
  'site.webex.com',
3109
3508
  ]);
3110
3509
  assert.notCalled(loggerProxySpy);
@@ -3128,7 +3527,7 @@ describe('plugin-meetings', () => {
3128
3527
  loggerProxySpy,
3129
3528
  'Failed to fetch preferred site from user - no site will be set'
3130
3529
  );
3131
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3530
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3132
3531
  });
3133
3532
  }
3134
3533
  );
@@ -3145,7 +3544,7 @@ describe('plugin-meetings', () => {
3145
3544
  loggerProxySpy,
3146
3545
  'Failed to fetch preferred site from user - no site will be set'
3147
3546
  );
3148
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3547
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3149
3548
  });
3150
3549
 
3151
3550
  it('should fall back to fetching the site from the user', async () => {
@@ -3164,7 +3563,6 @@ describe('plugin-meetings', () => {
3164
3563
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3165
3564
  assert.notCalled(loggerProxySpy);
3166
3565
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3167
- '',
3168
3566
  'site.webex.com',
3169
3567
  ]);
3170
3568
  });
@@ -3187,7 +3585,7 @@ describe('plugin-meetings', () => {
3187
3585
  loggerProxySpy,
3188
3586
  'Failed to fetch preferred site from user - no site will be set'
3189
3587
  );
3190
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3588
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3191
3589
  });
3192
3590
  }
3193
3591
  );
@@ -3204,7 +3602,7 @@ describe('plugin-meetings', () => {
3204
3602
  loggerProxySpy,
3205
3603
  'Failed to fetch preferred site from user - no site will be set'
3206
3604
  );
3207
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3605
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3208
3606
  });
3209
3607
  });
3210
3608
  });
@@ -3270,10 +3668,13 @@ describe('plugin-meetings', () => {
3270
3668
  };
3271
3669
 
3272
3670
  it('triggers correct event when SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE emitted', async () => {
3671
+ sinon.stub(meeting, 'updateMeetingActions');
3273
3672
  checkSelfTrigger(
3274
3673
  LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
3275
3674
  EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST
3276
3675
  );
3676
+ assert.calledOnce(meeting.updateMeetingActions);
3677
+ meeting.updateMeetingActions.restore();
3277
3678
  });
3278
3679
 
3279
3680
  it('triggers correct event when SELF_IS_SHARING_BLOCKED_CHANGE emitted', async () => {
@@ -3426,6 +3827,21 @@ describe('plugin-meetings', () => {
3426
3827
  'Meetings:index#isNeedHandleMainLocus --> self device left&moved in main locus with self joined status, not need to handle'
3427
3828
  );
3428
3829
  });
3830
+
3831
+ it('check breakout ended with self removed, return false', () => {
3832
+ webex.meetings.meetingCollection.getActiveBreakoutLocus = sinon.stub().returns(null);
3833
+ newLocus.self.state = 'LEFT';
3834
+ newLocus.self.reason = 'OTHER';
3835
+ newLocus.self.removed = true;
3836
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3837
+ LoggerProxy.logger.log = sinon.stub();
3838
+ const result = webex.meetings.isNeedHandleMainLocus(meeting, newLocus);
3839
+ assert.equal(result, false);
3840
+ assert.calledWith(
3841
+ LoggerProxy.logger.log,
3842
+ 'Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle'
3843
+ );
3844
+ });
3429
3845
  });
3430
3846
 
3431
3847
  describe('#isNeedHandleLocusDTO', () => {
@@ -3486,6 +3902,18 @@ describe('plugin-meetings', () => {
3486
3902
  const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3487
3903
  assert.equal(result, false);
3488
3904
  });
3905
+ it('breakout session with breakout ended, return false', () => {
3906
+ newLocus.controls.breakout = {
3907
+ sessionType: 'BREAKOUT',
3908
+ };
3909
+ newLocus.self.state = 'LEFT';
3910
+ newLocus.self.reason = 'OTHER';
3911
+ newLocus.self.devices = [];
3912
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3913
+ LoggerProxy.logger.log = sinon.stub();
3914
+ const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3915
+ assert.equal(result, false);
3916
+ });
3489
3917
  it('moved to lobby, return true', () => {
3490
3918
  newLocus.controls.breakout = {
3491
3919
  sessionType: 'MAIN',
@@ -3963,6 +4391,9 @@ describe('plugin-meetings', () => {
3963
4391
 
3964
4392
  triggerProxyStub.restore();
3965
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
+
3966
4397
  metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
3967
4398
 
3968
4399
  meeting = await webex.meetings.create('test');