@webex/plugin-meetings 3.12.0-next.14 → 3.12.0-next.140

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 (236) 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 +1096 -391
  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 +615 -176
  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 +20 -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 +1680 -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/voicea-meeting.js +2 -1
  64. package/dist/meeting/voicea-meeting.js.map +1 -1
  65. package/dist/meeting-info/meeting-info-v2.js +9 -3
  66. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  67. package/dist/meetings/index.js +293 -124
  68. package/dist/meetings/index.js.map +1 -1
  69. package/dist/meetings/meetings.types.js +6 -1
  70. package/dist/meetings/meetings.types.js.map +1 -1
  71. package/dist/meetings/request.js +39 -0
  72. package/dist/meetings/request.js.map +1 -1
  73. package/dist/meetings/util.js +116 -18
  74. package/dist/meetings/util.js.map +1 -1
  75. package/dist/member/index.js +10 -0
  76. package/dist/member/index.js.map +1 -1
  77. package/dist/member/types.js.map +1 -1
  78. package/dist/member/util.js +30 -0
  79. package/dist/member/util.js.map +1 -1
  80. package/dist/members/index.js +101 -43
  81. package/dist/members/index.js.map +1 -1
  82. package/dist/members/util.js +8 -1
  83. package/dist/members/util.js.map +1 -1
  84. package/dist/metrics/constants.js +7 -1
  85. package/dist/metrics/constants.js.map +1 -1
  86. package/dist/multistream/codec/constants.js +63 -0
  87. package/dist/multistream/codec/constants.js.map +1 -0
  88. package/dist/multistream/mediaRequestManager.js +62 -15
  89. package/dist/multistream/mediaRequestManager.js.map +1 -1
  90. package/dist/multistream/receiveSlot.js +9 -0
  91. package/dist/multistream/receiveSlot.js.map +1 -1
  92. package/dist/reachability/clusterReachability.js.map +1 -1
  93. package/dist/reachability/index.js +121 -83
  94. package/dist/reachability/index.js.map +1 -1
  95. package/dist/reachability/reachability.types.js +2 -0
  96. package/dist/reachability/reachability.types.js.map +1 -1
  97. package/dist/reachability/util.js +45 -0
  98. package/dist/reachability/util.js.map +1 -1
  99. package/dist/reactions/reactions.type.js.map +1 -1
  100. package/dist/recording-controller/index.js +1 -3
  101. package/dist/recording-controller/index.js.map +1 -1
  102. package/dist/roap/turnDiscovery.js +8 -1
  103. package/dist/roap/turnDiscovery.js.map +1 -1
  104. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  105. package/dist/types/config.d.ts +2 -2
  106. package/dist/types/constants.d.ts +13 -1
  107. package/dist/types/controls-options-manager/index.d.ts +16 -0
  108. package/dist/types/hashTree/constants.d.ts +1 -0
  109. package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
  110. package/dist/types/hashTree/utils.d.ts +7 -0
  111. package/dist/types/index.d.ts +3 -0
  112. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  113. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  114. package/dist/types/locus-info/index.d.ts +106 -8
  115. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  116. package/dist/types/locus-info/types.d.ts +22 -1
  117. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  118. package/dist/types/media/properties.d.ts +6 -2
  119. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  120. package/dist/types/meeting/index.d.ts +176 -11
  121. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  122. package/dist/types/meeting/request.d.ts +1 -0
  123. package/dist/types/meeting/util.d.ts +9 -0
  124. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  125. package/dist/types/meetings/index.d.ts +40 -19
  126. package/dist/types/meetings/meetings.types.d.ts +15 -0
  127. package/dist/types/meetings/request.d.ts +14 -0
  128. package/dist/types/member/index.d.ts +1 -0
  129. package/dist/types/member/types.d.ts +1 -0
  130. package/dist/types/member/util.d.ts +9 -0
  131. package/dist/types/members/index.d.ts +15 -2
  132. package/dist/types/members/util.d.ts +1 -5
  133. package/dist/types/metrics/constants.d.ts +6 -0
  134. package/dist/types/multistream/codec/constants.d.ts +7 -0
  135. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  136. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  137. package/dist/types/reachability/index.d.ts +10 -3
  138. package/dist/types/reachability/reachability.types.d.ts +7 -0
  139. package/dist/types/reachability/util.d.ts +17 -0
  140. package/dist/types/reactions/reactions.type.d.ts +3 -0
  141. package/dist/webinar/index.js +307 -161
  142. package/dist/webinar/index.js.map +1 -1
  143. package/package.json +23 -23
  144. package/src/aiEnableRequest/index.ts +16 -0
  145. package/src/annotation/index.ts +6 -4
  146. package/src/breakouts/breakout.ts +3 -1
  147. package/src/breakouts/events.ts +33 -11
  148. package/src/breakouts/index.ts +122 -2
  149. package/src/common/errors/webex-errors.ts +50 -3
  150. package/src/config.ts +2 -2
  151. package/src/constants.ts +21 -3
  152. package/src/controls-options-manager/index.ts +62 -10
  153. package/src/hashTree/constants.ts +7 -0
  154. package/src/hashTree/hashTreeParser.ts +861 -193
  155. package/src/hashTree/utils.ts +19 -0
  156. package/src/index.ts +6 -0
  157. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  158. package/src/interceptors/locusRetry.ts +25 -4
  159. package/src/interpretation/index.ts +27 -9
  160. package/src/interpretation/interpretation.types.ts +11 -0
  161. package/src/locus-info/controlsUtils.ts +3 -1
  162. package/src/locus-info/index.ts +566 -164
  163. package/src/locus-info/infoUtils.ts +41 -6
  164. package/src/locus-info/types.ts +26 -1
  165. package/src/media/MediaConnectionAwaiter.ts +21 -4
  166. package/src/media/index.ts +10 -1
  167. package/src/media/properties.ts +8 -3
  168. package/src/meeting/in-meeting-actions.ts +8 -0
  169. package/src/meeting/index.ts +933 -119
  170. package/src/meeting/locusMediaRequest.ts +106 -6
  171. package/src/meeting/muteState.ts +10 -1
  172. package/src/meeting/request.ts +11 -0
  173. package/src/meeting/util.ts +46 -5
  174. package/src/meeting/voicea-meeting.ts +1 -1
  175. package/src/meeting-info/meeting-info-v2.ts +10 -4
  176. package/src/meetings/index.ts +197 -80
  177. package/src/meetings/meetings.types.ts +19 -0
  178. package/src/meetings/request.ts +43 -0
  179. package/src/meetings/util.ts +117 -4
  180. package/src/member/index.ts +10 -0
  181. package/src/member/types.ts +1 -0
  182. package/src/member/util.ts +29 -0
  183. package/src/members/index.ts +70 -7
  184. package/src/members/util.ts +12 -4
  185. package/src/metrics/constants.ts +6 -0
  186. package/src/multistream/codec/constants.ts +58 -0
  187. package/src/multistream/mediaRequestManager.ts +119 -28
  188. package/src/multistream/receiveSlot.ts +18 -0
  189. package/src/reachability/clusterReachability.ts +3 -2
  190. package/src/reachability/index.ts +47 -16
  191. package/src/reachability/reachability.types.ts +11 -0
  192. package/src/reachability/util.ts +36 -0
  193. package/src/reactions/reactions.type.ts +3 -0
  194. package/src/recording-controller/index.ts +1 -2
  195. package/src/roap/turnDiscovery.ts +9 -1
  196. package/src/webinar/index.ts +216 -38
  197. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  198. package/test/unit/spec/annotation/index.ts +3 -3
  199. package/test/unit/spec/breakouts/breakout.ts +9 -3
  200. package/test/unit/spec/breakouts/events.ts +120 -2
  201. package/test/unit/spec/breakouts/index.ts +223 -3
  202. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  203. package/test/unit/spec/controls-options-manager/index.js +139 -32
  204. package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
  205. package/test/unit/spec/hashTree/utils.ts +37 -0
  206. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  207. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  208. package/test/unit/spec/interpretation/index.ts +26 -4
  209. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  210. package/test/unit/spec/locus-info/index.js +1014 -58
  211. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  212. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  213. package/test/unit/spec/media/index.ts +92 -0
  214. package/test/unit/spec/media/properties.ts +23 -23
  215. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  216. package/test/unit/spec/meeting/index.js +2805 -116
  217. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  218. package/test/unit/spec/meeting/muteState.js +81 -0
  219. package/test/unit/spec/meeting/request.js +12 -0
  220. package/test/unit/spec/meeting/utils.js +153 -1
  221. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  222. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  223. package/test/unit/spec/meetings/index.js +533 -49
  224. package/test/unit/spec/meetings/request.js +141 -0
  225. package/test/unit/spec/meetings/utils.js +402 -51
  226. package/test/unit/spec/member/index.js +7 -0
  227. package/test/unit/spec/member/util.js +89 -0
  228. package/test/unit/spec/members/index.js +216 -0
  229. package/test/unit/spec/members/request.js +37 -1
  230. package/test/unit/spec/members/utils.js +63 -0
  231. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  232. package/test/unit/spec/reachability/index.ts +128 -46
  233. package/test/unit/spec/reachability/util.ts +31 -0
  234. package/test/unit/spec/recording-controller/index.js +9 -8
  235. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  236. 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,8 @@ describe('plugin-meetings', () => {
91
94
  locusInfo = {
92
95
  parse: sinon.stub().returns(true),
93
96
  updateMainSessionLocusCache: sinon.stub(),
97
+ syncAllHashTreeDatasets: sinon.stub(),
98
+ sync: sinon.stub().resolves(),
94
99
  };
95
100
  webex = new MockWebex({
96
101
  children: {
@@ -355,32 +360,6 @@ describe('plugin-meetings', () => {
355
360
  });
356
361
  });
357
362
 
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
363
  describe('#_toggleIpv6BackendNativeSupport', () => {
385
364
  it('should have _toggleIpv6BackendNativeSupport', () => {
386
365
  assert.equal(typeof webex.meetings._toggleIpv6BackendNativeSupport, 'function');
@@ -423,6 +402,33 @@ describe('plugin-meetings', () => {
423
402
  });
424
403
  });
425
404
 
405
+ describe('#_toggleEnableAv1SlidesSupport', () => {
406
+ it('should have _toggleEnableAv1SlidesSupport', () => {
407
+ assert.equal(typeof webex.meetings._toggleEnableAv1SlidesSupport, 'function');
408
+ });
409
+
410
+ describe('success', () => {
411
+ it('should update meetings config to enable AV1 slides support', () => {
412
+ webex.meetings._toggleEnableAv1SlidesSupport(true);
413
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
414
+
415
+ webex.meetings._toggleEnableAv1SlidesSupport(false);
416
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, false);
417
+ });
418
+
419
+ it('should not update config when called with a non-boolean value', () => {
420
+ webex.meetings._toggleEnableAv1SlidesSupport(true);
421
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
422
+
423
+ webex.meetings._toggleEnableAv1SlidesSupport('invalid');
424
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
425
+
426
+ webex.meetings._toggleEnableAv1SlidesSupport(undefined);
427
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
428
+ });
429
+ });
430
+ });
431
+
426
432
  describe('#_toggleStopIceGatheringAfterFirstRelayCandidate', () => {
427
433
  it('should have _toggleStopIceGatheringAfterFirstRelayCandidate', () => {
428
434
  assert.equal(
@@ -1267,14 +1273,16 @@ describe('plugin-meetings', () => {
1267
1273
  });
1268
1274
 
1269
1275
  it('creates noise reduction effect with BNR model', async () => {
1270
- const result = await webex.meetings.createNoiseReductionEffect({audioContext: {}});
1276
+ const result = await webex.meetings.createNoiseReductionEffect({
1277
+ audioContext: {addEventListener: sinon.stub()},
1278
+ });
1271
1279
 
1272
1280
  assert.exists(result);
1273
1281
  assert.instanceOf(result, NoiseReductionEffect);
1274
1282
  assert.containsAllKeys(result, ['audioContext', 'isEnabled', 'isReady', 'options']);
1275
1283
  assert.equal(result.options.authToken, 'fake_token');
1276
1284
  assert.deepEqual(result.options, {
1277
- audioContext: {},
1285
+ audioContext: {addEventListener: result.options.audioContext.addEventListener},
1278
1286
  authToken: 'fake_token',
1279
1287
  mode: 'WORKLET',
1280
1288
  avoidSimd: false,
@@ -1287,7 +1295,7 @@ describe('plugin-meetings', () => {
1287
1295
 
1288
1296
  it('creates noise reduction effect with OFMV model', async () => {
1289
1297
  const result = await webex.meetings.createNoiseReductionEffect({
1290
- audioContext: {},
1298
+ audioContext: {addEventListener: sinon.stub()},
1291
1299
  model: 'ofmv',
1292
1300
  });
1293
1301
 
@@ -1296,7 +1304,7 @@ describe('plugin-meetings', () => {
1296
1304
  assert.containsAllKeys(result, ['audioContext', 'isEnabled', 'isReady', 'options']);
1297
1305
  assert.equal(result.options.authToken, 'fake_token');
1298
1306
  assert.deepEqual(result.options, {
1299
- audioContext: {},
1307
+ audioContext: {addEventListener: result.options.audioContext.addEventListener},
1300
1308
  authToken: 'fake_token',
1301
1309
  mode: 'WORKLET',
1302
1310
  avoidSimd: false,
@@ -1309,7 +1317,7 @@ describe('plugin-meetings', () => {
1309
1317
 
1310
1318
  it('passes custom options to noise reduction effect', async () => {
1311
1319
  const result = await webex.meetings.createNoiseReductionEffect({
1312
- audioContext: {},
1320
+ audioContext: {addEventListener: sinon.stub()},
1313
1321
  mode: 'LEGACY',
1314
1322
  env: 'int',
1315
1323
  avoidSimd: true,
@@ -1355,6 +1363,87 @@ describe('plugin-meetings', () => {
1355
1363
  );
1356
1364
  });
1357
1365
  });
1366
+ describe('#fetchSitePreferencesMeViaSite', () => {
1367
+ const sitePreferencesResponse = {
1368
+ scheduling: {
1369
+ supportScheduleWebinar: true,
1370
+ webinarWebLink: 'https://go.webex.com/webappng/sites/go/webinar/scheduler',
1371
+ },
1372
+ };
1373
+
1374
+ beforeEach(() => {
1375
+ webex.meetings.request.fetchSitePreferencesMeViaSite = sinon
1376
+ .stub()
1377
+ .resolves(sitePreferencesResponse);
1378
+ });
1379
+
1380
+ it('should have #fetchSitePreferencesMeViaSite', () => {
1381
+ assert.exists(webex.meetings.fetchSitePreferencesMeViaSite);
1382
+ });
1383
+
1384
+ it('fetches scheduling preferences for the preferred Webex site by default', async () => {
1385
+ webex.meetings.preferredWebexSite = 'go.webex.com';
1386
+
1387
+ const result = await webex.meetings.fetchSitePreferencesMeViaSite();
1388
+
1389
+ assert.deepEqual(result, sitePreferencesResponse);
1390
+ assert.calledOnceWithExactly(
1391
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1392
+ {
1393
+ siteUrl: 'go.webex.com',
1394
+ }
1395
+ );
1396
+ });
1397
+
1398
+ it('uses the provided Webex site instead of the preferred Webex site', async () => {
1399
+ webex.meetings.preferredWebexSite = 'preferred.webex.com';
1400
+
1401
+ await webex.meetings.fetchSitePreferencesMeViaSite({siteUrl: 'go.webex.com'});
1402
+
1403
+ assert.calledOnceWithExactly(
1404
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1405
+ {
1406
+ siteUrl: 'go.webex.com',
1407
+ }
1408
+ );
1409
+ });
1410
+
1411
+ it('forwards custom site name and preference sections to the request helper', async () => {
1412
+ webex.meetings.preferredWebexSite = 'go.webex.com';
1413
+
1414
+ await webex.meetings.fetchSitePreferencesMeViaSite({
1415
+ siteName: 'custom-site',
1416
+ selectOptions: [SitePreferenceSelectOption.SCHEDULING],
1417
+ });
1418
+
1419
+ assert.calledOnceWithExactly(
1420
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1421
+ {
1422
+ siteUrl: 'go.webex.com',
1423
+ siteName: 'custom-site',
1424
+ selectOptions: [SitePreferenceSelectOption.SCHEDULING],
1425
+ }
1426
+ );
1427
+ });
1428
+
1429
+ it('throws when no Webex site is available', () => {
1430
+ webex.meetings.preferredWebexSite = '';
1431
+ webex.meetings.request.fetchSitePreferencesMeViaSite.throws(
1432
+ new ParameterError(
1433
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
1434
+ )
1435
+ );
1436
+
1437
+ assert.throws(
1438
+ () => webex.meetings.fetchSitePreferencesMeViaSite(),
1439
+ ParameterError,
1440
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
1441
+ );
1442
+ assert.calledOnceWithExactly(webex.meetings.request.fetchSitePreferencesMeViaSite, {
1443
+ siteUrl: '',
1444
+ });
1445
+ });
1446
+ });
1358
1447
  describe('Static shortcut proxy methods', () => {
1359
1448
  describe('MeetingCollection getByKey proxies', () => {
1360
1449
  beforeEach(() => {
@@ -1391,7 +1480,7 @@ describe('plugin-meetings', () => {
1391
1480
  it('should have #syncMeetings', () => {
1392
1481
  assert.exists(webex.meetings.syncMeetings);
1393
1482
  });
1394
- it('should do nothing and return a resolved promise if unverified guest', async () => {
1483
+ it('should skip getActiveMeetings but still sync each meeting with canSyncClassicLocus enabled if unverified guest', async () => {
1395
1484
  webex.meetings.request.getActiveMeetings = sinon.stub().returns(
1396
1485
  Promise.resolve({
1397
1486
  loci: [
@@ -1404,13 +1493,27 @@ describe('plugin-meetings', () => {
1404
1493
  webex.credentials.isUnverifiedGuest = true;
1405
1494
  LoggerProxy.logger.info = sinon.stub();
1406
1495
 
1496
+ const mockLocusInfo = {
1497
+ sync: sinon.stub().resolves(),
1498
+ };
1499
+ const meeting1 = {locusInfo: mockLocusInfo};
1500
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1501
+ meeting1,
1502
+ meeting2: {locusInfo: undefined},
1503
+ meeting3: {},
1504
+ });
1505
+
1407
1506
  await webex.meetings.syncMeetings();
1408
1507
 
1409
1508
  assert.notCalled(webex.meetings.request.getActiveMeetings);
1410
1509
  assert.calledWith(
1411
1510
  LoggerProxy.logger.info,
1412
- 'Meetings:index#syncMeetings --> skipping meeting sync as unverified guest'
1511
+ 'Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync'
1413
1512
  );
1513
+ assert.calledOnceWithExactly(mockLocusInfo.sync, meeting1, {
1514
+ canSyncClassicLocus: true,
1515
+ canSyncHashTree: true,
1516
+ });
1414
1517
  });
1415
1518
  describe('succesful requests', () => {
1416
1519
  beforeEach(() => {
@@ -1429,6 +1532,9 @@ describe('plugin-meetings', () => {
1429
1532
  webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
1430
1533
  locusInfo,
1431
1534
  });
1535
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1536
+ meeting1: {locusInfo, locusUrl: url1},
1537
+ });
1432
1538
  });
1433
1539
  it('tests the sync meeting calls for existing meeting', async () => {
1434
1540
  await webex.meetings.syncMeetings();
@@ -1436,6 +1542,11 @@ describe('plugin-meetings', () => {
1436
1542
  assert.calledOnce(webex.meetings.meetingCollection.getByKey);
1437
1543
  assert.calledOnce(locusInfo.parse);
1438
1544
  assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
1545
+ assert.calledOnceWithExactly(
1546
+ locusInfo.sync,
1547
+ {locusInfo, locusUrl: url1},
1548
+ {canSyncClassicLocus: false, canSyncHashTree: true}
1549
+ );
1439
1550
  });
1440
1551
  });
1441
1552
  describe('when meeting is not returned', () => {
@@ -1474,7 +1585,7 @@ describe('plugin-meetings', () => {
1474
1585
  url: url1,
1475
1586
  },
1476
1587
  hashTreeMessage: undefined,
1477
- });
1588
+ }, sinon.match.func);
1478
1589
  });
1479
1590
  });
1480
1591
  describe('when destroying meeting is needed', () => {
@@ -1520,7 +1631,7 @@ describe('plugin-meetings', () => {
1520
1631
  it('destroy any meeting that has no active locus url if keepOnlyLocusMeetings is not defined', async () => {
1521
1632
  await webex.meetings.syncMeetings();
1522
1633
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1523
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1634
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1524
1635
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1525
1636
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting1);
1526
1637
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting2);
@@ -1532,7 +1643,7 @@ describe('plugin-meetings', () => {
1532
1643
  it('destroy any meeting that has no active locus url if keepOnlyLocusMeetings === true', async () => {
1533
1644
  await webex.meetings.syncMeetings({keepOnlyLocusMeetings: true});
1534
1645
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1535
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1646
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1536
1647
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1537
1648
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting1);
1538
1649
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting2);
@@ -1544,7 +1655,7 @@ describe('plugin-meetings', () => {
1544
1655
  it('destroy any LOCUS meetings that have no active locus url if keepOnlyLocusMeetings === false', async () => {
1545
1656
  await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1546
1657
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1547
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1658
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1548
1659
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1549
1660
  assert.callCount(destroySpy, 1);
1550
1661
 
@@ -1552,6 +1663,163 @@ describe('plugin-meetings', () => {
1552
1663
  });
1553
1664
  });
1554
1665
  });
1666
+
1667
+ describe('when globalMeetingId preserves breakout meetings', () => {
1668
+ let destroySpy;
1669
+ let cleanUpSpy;
1670
+
1671
+ beforeEach(() => {
1672
+ destroySpy = sinon.spy(webex.meetings, 'destroy');
1673
+ cleanUpSpy = sinon.stub(MeetingUtil, 'cleanUp').returns(Promise.resolve());
1674
+ });
1675
+
1676
+ afterEach(() => {
1677
+ cleanUpSpy.restore();
1678
+ });
1679
+
1680
+ it('should not destroy a meeting whose globalMeetingId matches an active locus', async () => {
1681
+ const meetingCollectionMeetings = {
1682
+ breakoutMeeting: {
1683
+ locusUrl: 'breakout-url',
1684
+ locusInfo: {
1685
+ info: {globalMeetingId: 'gmid-123'},
1686
+ sync: sinon.stub().resolves(),
1687
+ },
1688
+ sendCallAnalyzerMetrics: sinon.stub(),
1689
+ },
1690
+ };
1691
+
1692
+ webex.meetings.meetingCollection.getAll = sinon
1693
+ .stub()
1694
+ .returns(meetingCollectionMeetings);
1695
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1696
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1697
+ });
1698
+
1699
+ await webex.meetings.syncMeetings();
1700
+
1701
+ assert.notCalled(destroySpy);
1702
+ });
1703
+
1704
+ it('should destroy a meeting whose globalMeetingId does NOT match any active locus', async () => {
1705
+ const meetingCollectionMeetings = {
1706
+ breakoutMeeting: {
1707
+ locusUrl: 'breakout-url',
1708
+ locusInfo: {
1709
+ info: {globalMeetingId: 'gmid-other'},
1710
+ sync: sinon.stub().resolves(),
1711
+ },
1712
+ sendCallAnalyzerMetrics: sinon.stub(),
1713
+ },
1714
+ };
1715
+
1716
+ webex.meetings.meetingCollection.getAll = sinon
1717
+ .stub()
1718
+ .returns(meetingCollectionMeetings);
1719
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1720
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1721
+ });
1722
+
1723
+ await webex.meetings.syncMeetings();
1724
+
1725
+ assert.calledOnce(destroySpy);
1726
+ assert.calledWith(destroySpy, meetingCollectionMeetings.breakoutMeeting);
1727
+ });
1728
+ });
1729
+
1730
+ describe('skipHashTreeSync parameter', () => {
1731
+ it('should pass canSyncHashTree:false to locusInfo.sync when skipHashTreeSync is true', async () => {
1732
+ const mockLocusInfo = {
1733
+ sync: sinon.stub().resolves(),
1734
+ };
1735
+ const meeting1 = {locusInfo: mockLocusInfo};
1736
+
1737
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1738
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1739
+ meeting1,
1740
+ });
1741
+
1742
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: true});
1743
+
1744
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1745
+ assert.calledOnceWithExactly(mockLocusInfo.sync, meeting1, {
1746
+ canSyncClassicLocus: false,
1747
+ canSyncHashTree: false,
1748
+ });
1749
+ });
1750
+
1751
+ it('should pass canSyncHashTree:true to locusInfo.sync when skipHashTreeSync is false (default)', async () => {
1752
+ const mockLocusInfo = {
1753
+ sync: sinon.stub().resolves(),
1754
+ };
1755
+ const meeting1 = {locusInfo: mockLocusInfo};
1756
+
1757
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1758
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1759
+ meeting1,
1760
+ });
1761
+
1762
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: false});
1763
+
1764
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1765
+ assert.calledOnceWithExactly(mockLocusInfo.sync, meeting1, {
1766
+ canSyncClassicLocus: false,
1767
+ canSyncHashTree: true,
1768
+ });
1769
+ });
1770
+ });
1771
+
1772
+ describe('per-meeting sync in syncMeetings', () => {
1773
+ it('should call locusInfo.sync for multiple meetings, skipping those without locusInfo', async () => {
1774
+ const mockLocusInfo1 = {
1775
+ sync: sinon.stub().resolves(),
1776
+ };
1777
+ const mockLocusInfo2 = {
1778
+ sync: sinon.stub().resolves(),
1779
+ };
1780
+
1781
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1782
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1783
+ meeting1: {locusInfo: mockLocusInfo1},
1784
+ meeting2: {locusInfo: undefined},
1785
+ meeting3: {locusInfo: mockLocusInfo2},
1786
+ meeting4: {},
1787
+ });
1788
+
1789
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1790
+
1791
+ assert.calledOnceWithExactly(
1792
+ mockLocusInfo1.sync,
1793
+ {locusInfo: mockLocusInfo1},
1794
+ {canSyncClassicLocus: false, canSyncHashTree: true}
1795
+ );
1796
+ assert.calledOnceWithExactly(
1797
+ mockLocusInfo2.sync,
1798
+ {locusInfo: mockLocusInfo2},
1799
+ {canSyncClassicLocus: false, canSyncHashTree: true}
1800
+ );
1801
+ });
1802
+
1803
+ it('should not call locusInfo.sync when getActiveMeetings throws an error', async () => {
1804
+ const mockLocusInfo = {
1805
+ sync: sinon.stub().resolves(),
1806
+ };
1807
+
1808
+ webex.meetings.request.getActiveMeetings = sinon.stub().rejects(new Error('network error'));
1809
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1810
+ meeting1: {locusInfo: mockLocusInfo},
1811
+ });
1812
+
1813
+ try {
1814
+ await webex.meetings.syncMeetings();
1815
+ assert.fail('should have thrown');
1816
+ } catch (err) {
1817
+ assert.equal(err.message, 'network error');
1818
+ }
1819
+
1820
+ assert.notCalled(mockLocusInfo.sync);
1821
+ });
1822
+ });
1555
1823
  });
1556
1824
  describe('#fetchStaticMeetingLink', () => {
1557
1825
  const conversationUrl = 'conv.fakeconversationurl.com';
@@ -1635,6 +1903,141 @@ describe('plugin-meetings', () => {
1635
1903
  );
1636
1904
  });
1637
1905
 
1906
+ describe('wasm runtime performance telemetry', () => {
1907
+ const correlationId = 'wasm-corr-id';
1908
+ const benchmarkMeasurements = {
1909
+ divRatio: 1.888,
1910
+ sqrtRatio: 3.474,
1911
+ addNsPerOp: 2.006,
1912
+ addMedianMs: 32.1,
1913
+ divMedianMs: 60.6,
1914
+ sqrtMedianMs: 111.5,
1915
+ };
1916
+ const probeResult = {
1917
+ status: 'slow',
1918
+ capability: 'not capable',
1919
+ reason: null,
1920
+ measurements: benchmarkMeasurements,
1921
+ };
1922
+ const expectedMetricFields = {
1923
+ status: probeResult.status,
1924
+ capability: probeResult.capability,
1925
+ reason: probeResult.reason,
1926
+ ...benchmarkMeasurements,
1927
+ correlation_id: correlationId,
1928
+ };
1929
+ let metricsSpy;
1930
+ let probeCheckStub;
1931
+
1932
+ beforeEach(() => {
1933
+ webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves({});
1934
+ webex.meetings.createMeeting = sinon
1935
+ .stub()
1936
+ .returns(Promise.resolve({on: () => true, correlationId}));
1937
+ probeCheckStub = sinon.stub(WasmRuntimeProbe, 'check').resolves(probeResult);
1938
+ metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
1939
+ });
1940
+
1941
+ afterEach(() => {
1942
+ probeCheckStub.restore();
1943
+ metricsSpy.restore();
1944
+ });
1945
+
1946
+ it('emits js_sdk_wasm_runtime_performance once after a meeting is created', async () => {
1947
+ await webex.meetings.create(test1, test2);
1948
+ await testUtils.flushPromises();
1949
+
1950
+ assert.calledOnceWithExactly(probeCheckStub);
1951
+ assert.calledOnceWithExactly(
1952
+ metricsSpy,
1953
+ 'js_sdk_wasm_runtime_performance',
1954
+ expectedMetricFields
1955
+ );
1956
+ });
1957
+
1958
+ it('logs the WASM runtime status after a meeting is created', async () => {
1959
+ const loggerLogStub = sinon.stub(LoggerProxy.logger, 'log');
1960
+
1961
+ await webex.meetings.create(test1, test2);
1962
+ await testUtils.flushPromises();
1963
+
1964
+ assert.calledOnceWithExactly(probeCheckStub);
1965
+ assert.calledOnceWithExactly(
1966
+ loggerLogStub,
1967
+ sinon.match(
1968
+ /Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status/
1969
+ )
1970
+ );
1971
+ loggerLogStub.restore();
1972
+ });
1973
+
1974
+ it('emits only once even when create() is called multiple times', async () => {
1975
+ await webex.meetings.create(test1, test2);
1976
+ await webex.meetings.create(test1, test2);
1977
+ await testUtils.flushPromises();
1978
+
1979
+ assert.calledOnceWithExactly(probeCheckStub);
1980
+ assert.calledOnceWithExactly(
1981
+ metricsSpy,
1982
+ 'js_sdk_wasm_runtime_performance',
1983
+ expectedMetricFields
1984
+ );
1985
+ });
1986
+
1987
+ it('emits the reason with null measurement fields when no measurements are available', async () => {
1988
+ probeCheckStub.resolves({
1989
+ status: 'unknown',
1990
+ capability: 'unknown',
1991
+ reason: 'worker_timeout',
1992
+ measurements: null,
1993
+ });
1994
+
1995
+ await webex.meetings.create(test1, test2);
1996
+ await testUtils.flushPromises();
1997
+
1998
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
1999
+ status: 'unknown',
2000
+ capability: 'unknown',
2001
+ reason: 'worker_timeout',
2002
+ divRatio: null,
2003
+ sqrtRatio: null,
2004
+ addNsPerOp: null,
2005
+ addMedianMs: null,
2006
+ divMedianMs: null,
2007
+ sqrtMedianMs: null,
2008
+ correlation_id: correlationId,
2009
+ });
2010
+ });
2011
+
2012
+ it('still resolves the meeting when the probe fails', async () => {
2013
+ const loggerErrorStub = sinon.stub(LoggerProxy.logger, 'error');
2014
+ probeCheckStub.rejects(new Error('probe failed'));
2015
+
2016
+ const created = await webex.meetings.create(test1, test2);
2017
+ await testUtils.flushPromises();
2018
+
2019
+ assert.equal(created.correlationId, correlationId);
2020
+ assert.notCalled(metricsSpy);
2021
+ assert.calledOnceWithExactly(
2022
+ loggerErrorStub,
2023
+ sinon.match(/Meetings:index#emitWasmRuntimePerformance --> ERROR/)
2024
+ );
2025
+ loggerErrorStub.restore();
2026
+ });
2027
+
2028
+ it('does not re-run the probe when create() returns an already-created meeting', async () => {
2029
+ webex.meetings.meetingCollection.getByKey = sinon
2030
+ .stub()
2031
+ .returns({updateCallStateForMetrics: sinon.stub()});
2032
+
2033
+ await webex.meetings.create(test1, test2);
2034
+ await testUtils.flushPromises();
2035
+
2036
+ assert.notCalled(probeCheckStub);
2037
+ assert.notCalled(metricsSpy);
2038
+ });
2039
+ });
2040
+
1638
2041
  it('should call MeetingInfo#fetchInfoOptions() with proper params', () => {
1639
2042
  webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves(infoOptions);
1640
2043
 
@@ -1878,6 +2281,28 @@ describe('plugin-meetings', () => {
1878
2281
  assert.calledWith(webex.internal.mercury.on, OFFLINE);
1879
2282
  assert.callCount(webex.internal.mercury.on, 4);
1880
2283
  });
2284
+
2285
+ it('handles a rejected syncMeetings when the ONLINE event fires so it does not become an unhandled rejection', async () => {
2286
+ const syncError = new Error('sync failed');
2287
+ sinon.stub(webex.meetings, 'syncMeetings').rejects(syncError);
2288
+ const loggerWarnStub = sinon.stub(LoggerProxy.logger, 'warn');
2289
+
2290
+ webex.meetings.listenForEvents();
2291
+
2292
+ const onlineCallback = webex.internal.mercury.on
2293
+ .getCalls()
2294
+ .find((call) => call.args[0] === ONLINE).args[1];
2295
+
2296
+ // invoking the listener must not throw synchronously nor leave a rejection unhandled
2297
+ onlineCallback();
2298
+
2299
+ assert.calledOnceWithExactly(webex.meetings.syncMeetings, {keepOnlyLocusMeetings: false});
2300
+
2301
+ await testUtils.flushPromises();
2302
+
2303
+ assert.calledOnce(loggerWarnStub);
2304
+ assert.include(loggerWarnStub.firstCall.args[0], 'syncMeetings after ONLINE event failed');
2305
+ });
1881
2306
  });
1882
2307
  describe('#handleLocusMercury', () => {
1883
2308
  beforeEach(() => {
@@ -2015,7 +2440,7 @@ describe('plugin-meetings', () => {
2015
2440
  },
2016
2441
  },
2017
2442
  hashTreeMessage: undefined,
2018
- });
2443
+ }, sinon.match.func);
2019
2444
  });
2020
2445
  it('should setup the meeting from a hash tree event', async () => {
2021
2446
  const selfData = {};
@@ -2049,7 +2474,7 @@ describe('plugin-meetings', () => {
2049
2474
  info: infoData,
2050
2475
  },
2051
2476
  hashTreeMessage,
2052
- });
2477
+ }, sinon.match.func);
2053
2478
  });
2054
2479
 
2055
2480
  it('should ignore hash tree event when created locus has INACTIVE fullState', async () => {
@@ -2129,7 +2554,7 @@ describe('plugin-meetings', () => {
2129
2554
  },
2130
2555
  },
2131
2556
  hashTreeMessage: undefined,
2132
- });
2557
+ }, sinon.match.func);
2133
2558
  });
2134
2559
 
2135
2560
  it('sends client event correctly on finally', async () => {
@@ -2205,7 +2630,7 @@ describe('plugin-meetings', () => {
2205
2630
  },
2206
2631
  },
2207
2632
  hashTreeMessage: undefined,
2208
- });
2633
+ }, sinon.match.func);
2209
2634
  });
2210
2635
 
2211
2636
  const generateFakeLocusData = (isUnifiedSpaceMeeting) => ({
@@ -2337,7 +2762,11 @@ describe('plugin-meetings', () => {
2337
2762
  undefined,
2338
2763
  undefined,
2339
2764
  extraParams,
2340
- {meetingId: meeting.id, sendCAevents}
2765
+ {
2766
+ meetingId: meeting.id,
2767
+ sendCAevents,
2768
+ correlationId: meeting.correlationId,
2769
+ }
2341
2770
  );
2342
2771
  }
2343
2772
 
@@ -2880,6 +3309,30 @@ describe('plugin-meetings', () => {
2880
3309
 
2881
3310
  assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
2882
3311
  });
3312
+
3313
+ [
3314
+ {fullStateType: 'CALL'},
3315
+ {fullStateType: 'SIP_BRIDGE'},
3316
+ {fullStateType: 'SPACE_SHARE'},
3317
+ ].forEach(({fullStateType}) => {
3318
+ it(`skips meeting info fetch when LOCUS_ID destination is a 1:1 call (fullState.type ${fullStateType})`, async () => {
3319
+ const locusDestination = {
3320
+ fullState: {type: fullStateType},
3321
+ };
3322
+
3323
+ const meeting = await webex.meetings.createMeeting(
3324
+ locusDestination,
3325
+ DESTINATION_TYPE.LOCUS_ID
3326
+ );
3327
+
3328
+ assert.instanceOf(
3329
+ meeting,
3330
+ Meeting,
3331
+ 'createMeeting should eventually resolve to a Meeting Object'
3332
+ );
3333
+ assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
3334
+ });
3335
+ });
2883
3336
  });
2884
3337
 
2885
3338
  describe('rejected MeetingInfo.#fetchMeetingInfo - does not log for known Error types', () => {
@@ -3119,7 +3572,7 @@ describe('plugin-meetings', () => {
3119
3572
  loggerProxySpy,
3120
3573
  'Failed to fetch preferred site from user - no site will be set'
3121
3574
  );
3122
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3575
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3123
3576
  });
3124
3577
 
3125
3578
  it('should fall back to fetching the site from the user', async () => {
@@ -3137,7 +3590,6 @@ describe('plugin-meetings', () => {
3137
3590
 
3138
3591
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3139
3592
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3140
- '',
3141
3593
  'site.webex.com',
3142
3594
  ]);
3143
3595
  assert.notCalled(loggerProxySpy);
@@ -3161,7 +3613,7 @@ describe('plugin-meetings', () => {
3161
3613
  loggerProxySpy,
3162
3614
  'Failed to fetch preferred site from user - no site will be set'
3163
3615
  );
3164
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3616
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3165
3617
  });
3166
3618
  }
3167
3619
  );
@@ -3178,7 +3630,7 @@ describe('plugin-meetings', () => {
3178
3630
  loggerProxySpy,
3179
3631
  'Failed to fetch preferred site from user - no site will be set'
3180
3632
  );
3181
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3633
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3182
3634
  });
3183
3635
 
3184
3636
  it('should fall back to fetching the site from the user', async () => {
@@ -3197,7 +3649,6 @@ describe('plugin-meetings', () => {
3197
3649
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3198
3650
  assert.notCalled(loggerProxySpy);
3199
3651
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3200
- '',
3201
3652
  'site.webex.com',
3202
3653
  ]);
3203
3654
  });
@@ -3220,7 +3671,7 @@ describe('plugin-meetings', () => {
3220
3671
  loggerProxySpy,
3221
3672
  'Failed to fetch preferred site from user - no site will be set'
3222
3673
  );
3223
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3674
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3224
3675
  });
3225
3676
  }
3226
3677
  );
@@ -3237,7 +3688,7 @@ describe('plugin-meetings', () => {
3237
3688
  loggerProxySpy,
3238
3689
  'Failed to fetch preferred site from user - no site will be set'
3239
3690
  );
3240
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3691
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3241
3692
  });
3242
3693
  });
3243
3694
  });
@@ -3303,10 +3754,13 @@ describe('plugin-meetings', () => {
3303
3754
  };
3304
3755
 
3305
3756
  it('triggers correct event when SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE emitted', async () => {
3757
+ sinon.stub(meeting, 'updateMeetingActions');
3306
3758
  checkSelfTrigger(
3307
3759
  LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
3308
3760
  EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST
3309
3761
  );
3762
+ assert.calledOnce(meeting.updateMeetingActions);
3763
+ meeting.updateMeetingActions.restore();
3310
3764
  });
3311
3765
 
3312
3766
  it('triggers correct event when SELF_IS_SHARING_BLOCKED_CHANGE emitted', async () => {
@@ -3459,6 +3913,21 @@ describe('plugin-meetings', () => {
3459
3913
  'Meetings:index#isNeedHandleMainLocus --> self device left&moved in main locus with self joined status, not need to handle'
3460
3914
  );
3461
3915
  });
3916
+
3917
+ it('check breakout ended with self removed, return false', () => {
3918
+ webex.meetings.meetingCollection.getActiveBreakoutLocus = sinon.stub().returns(null);
3919
+ newLocus.self.state = 'LEFT';
3920
+ newLocus.self.reason = 'OTHER';
3921
+ newLocus.self.removed = true;
3922
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3923
+ LoggerProxy.logger.log = sinon.stub();
3924
+ const result = webex.meetings.isNeedHandleMainLocus(meeting, newLocus);
3925
+ assert.equal(result, false);
3926
+ assert.calledWith(
3927
+ LoggerProxy.logger.log,
3928
+ 'Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle'
3929
+ );
3930
+ });
3462
3931
  });
3463
3932
 
3464
3933
  describe('#isNeedHandleLocusDTO', () => {
@@ -3519,6 +3988,18 @@ describe('plugin-meetings', () => {
3519
3988
  const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3520
3989
  assert.equal(result, false);
3521
3990
  });
3991
+ it('breakout session with breakout ended, return false', () => {
3992
+ newLocus.controls.breakout = {
3993
+ sessionType: 'BREAKOUT',
3994
+ };
3995
+ newLocus.self.state = 'LEFT';
3996
+ newLocus.self.reason = 'OTHER';
3997
+ newLocus.self.devices = [];
3998
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3999
+ LoggerProxy.logger.log = sinon.stub();
4000
+ const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
4001
+ assert.equal(result, false);
4002
+ });
3522
4003
  it('moved to lobby, return true', () => {
3523
4004
  newLocus.controls.breakout = {
3524
4005
  sessionType: 'MAIN',
@@ -3996,6 +4477,9 @@ describe('plugin-meetings', () => {
3996
4477
 
3997
4478
  triggerProxyStub.restore();
3998
4479
 
4480
+ // Never resolve, so the create()-triggered WASM emit can't reach the metrics spy below.
4481
+ sinon.stub(WasmRuntimeProbe, 'check').returns(new Promise(() => {}));
4482
+
3999
4483
  metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
4000
4484
 
4001
4485
  meeting = await webex.meetings.create('test');