@webex/plugin-meetings 3.12.0-next.11 → 3.12.0-next.110

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 (235) 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/constants.js +11 -1
  17. package/dist/controls-options-manager/constants.js.map +1 -1
  18. package/dist/controls-options-manager/index.js +67 -29
  19. package/dist/controls-options-manager/index.js.map +1 -1
  20. package/dist/controls-options-manager/util.js +91 -0
  21. package/dist/controls-options-manager/util.js.map +1 -1
  22. package/dist/hashTree/constants.js +4 -1
  23. package/dist/hashTree/constants.js.map +1 -1
  24. package/dist/hashTree/hashTreeParser.js +1003 -393
  25. package/dist/hashTree/hashTreeParser.js.map +1 -1
  26. package/dist/hashTree/utils.js +20 -0
  27. package/dist/hashTree/utils.js.map +1 -1
  28. package/dist/index.js +7 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  31. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  32. package/dist/interceptors/locusRetry.js +23 -8
  33. package/dist/interceptors/locusRetry.js.map +1 -1
  34. package/dist/interpretation/index.js +10 -1
  35. package/dist/interpretation/index.js.map +1 -1
  36. package/dist/interpretation/interpretation.types.js +7 -0
  37. package/dist/interpretation/interpretation.types.js.map +1 -0
  38. package/dist/interpretation/siLanguage.js +1 -1
  39. package/dist/locus-info/controlsUtils.js +4 -1
  40. package/dist/locus-info/controlsUtils.js.map +1 -1
  41. package/dist/locus-info/index.js +406 -121
  42. package/dist/locus-info/index.js.map +1 -1
  43. package/dist/locus-info/infoUtils.js +36 -5
  44. package/dist/locus-info/infoUtils.js.map +1 -1
  45. package/dist/locus-info/types.js +19 -0
  46. package/dist/locus-info/types.js.map +1 -1
  47. package/dist/media/MediaConnectionAwaiter.js +15 -2
  48. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  49. package/dist/media/index.js +8 -2
  50. package/dist/media/index.js.map +1 -1
  51. package/dist/media/properties.js +4 -5
  52. package/dist/media/properties.js.map +1 -1
  53. package/dist/meeting/in-meeting-actions.js +5 -1
  54. package/dist/meeting/in-meeting-actions.js.map +1 -1
  55. package/dist/meeting/index.js +1662 -829
  56. package/dist/meeting/index.js.map +1 -1
  57. package/dist/meeting/locusMediaRequest.js +229 -82
  58. package/dist/meeting/locusMediaRequest.js.map +1 -1
  59. package/dist/meeting/muteState.js +10 -1
  60. package/dist/meeting/muteState.js.map +1 -1
  61. package/dist/meeting/request.js +5 -2
  62. package/dist/meeting/request.js.map +1 -1
  63. package/dist/meeting/util.js +34 -2
  64. package/dist/meeting/util.js.map +1 -1
  65. package/dist/meeting-info/meeting-info-v2.js +2 -2
  66. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  67. package/dist/meetings/index.js +256 -118
  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/constants.d.ts +6 -1
  108. package/dist/types/controls-options-manager/index.d.ts +16 -0
  109. package/dist/types/hashTree/constants.d.ts +1 -0
  110. package/dist/types/hashTree/hashTreeParser.d.ts +178 -22
  111. package/dist/types/hashTree/utils.d.ts +7 -0
  112. package/dist/types/index.d.ts +3 -0
  113. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  114. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  115. package/dist/types/locus-info/index.d.ts +61 -7
  116. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  117. package/dist/types/locus-info/types.d.ts +21 -1
  118. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  119. package/dist/types/media/properties.d.ts +6 -2
  120. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  121. package/dist/types/meeting/index.d.ts +175 -11
  122. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  123. package/dist/types/meeting/request.d.ts +1 -0
  124. package/dist/types/meeting/util.d.ts +9 -0
  125. package/dist/types/meetings/index.d.ts +38 -18
  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/breakouts/breakout.ts +3 -1
  146. package/src/breakouts/events.ts +33 -11
  147. package/src/breakouts/index.ts +110 -1
  148. package/src/common/errors/webex-errors.ts +50 -3
  149. package/src/config.ts +2 -2
  150. package/src/constants.ts +21 -3
  151. package/src/controls-options-manager/constants.ts +14 -1
  152. package/src/controls-options-manager/index.ts +87 -28
  153. package/src/controls-options-manager/util.ts +81 -1
  154. package/src/hashTree/constants.ts +7 -0
  155. package/src/hashTree/hashTreeParser.ts +752 -192
  156. package/src/hashTree/utils.ts +19 -0
  157. package/src/index.ts +6 -0
  158. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  159. package/src/interceptors/locusRetry.ts +25 -4
  160. package/src/interpretation/index.ts +27 -9
  161. package/src/interpretation/interpretation.types.ts +11 -0
  162. package/src/locus-info/controlsUtils.ts +3 -1
  163. package/src/locus-info/index.ts +412 -130
  164. package/src/locus-info/infoUtils.ts +41 -6
  165. package/src/locus-info/types.ts +25 -1
  166. package/src/media/MediaConnectionAwaiter.ts +21 -4
  167. package/src/media/index.ts +10 -1
  168. package/src/media/properties.ts +8 -3
  169. package/src/meeting/in-meeting-actions.ts +8 -0
  170. package/src/meeting/index.ts +913 -111
  171. package/src/meeting/locusMediaRequest.ts +106 -6
  172. package/src/meeting/muteState.ts +10 -1
  173. package/src/meeting/request.ts +11 -0
  174. package/src/meeting/util.ts +46 -5
  175. package/src/meeting-info/meeting-info-v2.ts +4 -2
  176. package/src/meetings/index.ts +168 -79
  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/breakouts/breakout.ts +9 -3
  199. package/test/unit/spec/breakouts/events.ts +120 -2
  200. package/test/unit/spec/breakouts/index.ts +191 -2
  201. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  202. package/test/unit/spec/controls-options-manager/index.js +244 -29
  203. package/test/unit/spec/controls-options-manager/util.js +165 -0
  204. package/test/unit/spec/hashTree/hashTreeParser.ts +2110 -170
  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 +643 -63
  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 +2711 -183
  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-info/meetinginfov2.js +19 -10
  222. package/test/unit/spec/meetings/index.js +467 -36
  223. package/test/unit/spec/meetings/request.js +141 -0
  224. package/test/unit/spec/meetings/utils.js +402 -51
  225. package/test/unit/spec/member/index.js +7 -0
  226. package/test/unit/spec/member/util.js +89 -0
  227. package/test/unit/spec/members/index.js +216 -0
  228. package/test/unit/spec/members/request.js +37 -1
  229. package/test/unit/spec/members/utils.js +63 -0
  230. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  231. package/test/unit/spec/reachability/index.ts +128 -46
  232. package/test/unit/spec/reachability/util.ts +31 -0
  233. package/test/unit/spec/recording-controller/index.js +9 -8
  234. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  235. 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(
@@ -1355,6 +1360,87 @@ describe('plugin-meetings', () => {
1355
1360
  );
1356
1361
  });
1357
1362
  });
1363
+ describe('#fetchSitePreferencesMeViaSite', () => {
1364
+ const sitePreferencesResponse = {
1365
+ scheduling: {
1366
+ supportScheduleWebinar: true,
1367
+ webinarWebLink: 'https://go.webex.com/webappng/sites/go/webinar/scheduler',
1368
+ },
1369
+ };
1370
+
1371
+ beforeEach(() => {
1372
+ webex.meetings.request.fetchSitePreferencesMeViaSite = sinon
1373
+ .stub()
1374
+ .resolves(sitePreferencesResponse);
1375
+ });
1376
+
1377
+ it('should have #fetchSitePreferencesMeViaSite', () => {
1378
+ assert.exists(webex.meetings.fetchSitePreferencesMeViaSite);
1379
+ });
1380
+
1381
+ it('fetches scheduling preferences for the preferred Webex site by default', async () => {
1382
+ webex.meetings.preferredWebexSite = 'go.webex.com';
1383
+
1384
+ const result = await webex.meetings.fetchSitePreferencesMeViaSite();
1385
+
1386
+ assert.deepEqual(result, sitePreferencesResponse);
1387
+ assert.calledOnceWithExactly(
1388
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1389
+ {
1390
+ siteUrl: 'go.webex.com',
1391
+ }
1392
+ );
1393
+ });
1394
+
1395
+ it('uses the provided Webex site instead of the preferred Webex site', async () => {
1396
+ webex.meetings.preferredWebexSite = 'preferred.webex.com';
1397
+
1398
+ await webex.meetings.fetchSitePreferencesMeViaSite({siteUrl: 'go.webex.com'});
1399
+
1400
+ assert.calledOnceWithExactly(
1401
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1402
+ {
1403
+ siteUrl: 'go.webex.com',
1404
+ }
1405
+ );
1406
+ });
1407
+
1408
+ it('forwards custom site name and preference sections to the request helper', async () => {
1409
+ webex.meetings.preferredWebexSite = 'go.webex.com';
1410
+
1411
+ await webex.meetings.fetchSitePreferencesMeViaSite({
1412
+ siteName: 'custom-site',
1413
+ selectOptions: [SitePreferenceSelectOption.SCHEDULING],
1414
+ });
1415
+
1416
+ assert.calledOnceWithExactly(
1417
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1418
+ {
1419
+ siteUrl: 'go.webex.com',
1420
+ siteName: 'custom-site',
1421
+ selectOptions: [SitePreferenceSelectOption.SCHEDULING],
1422
+ }
1423
+ );
1424
+ });
1425
+
1426
+ it('throws when no Webex site is available', () => {
1427
+ webex.meetings.preferredWebexSite = '';
1428
+ webex.meetings.request.fetchSitePreferencesMeViaSite.throws(
1429
+ new ParameterError(
1430
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
1431
+ )
1432
+ );
1433
+
1434
+ assert.throws(
1435
+ () => webex.meetings.fetchSitePreferencesMeViaSite(),
1436
+ ParameterError,
1437
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
1438
+ );
1439
+ assert.calledOnceWithExactly(webex.meetings.request.fetchSitePreferencesMeViaSite, {
1440
+ siteUrl: '',
1441
+ });
1442
+ });
1443
+ });
1358
1444
  describe('Static shortcut proxy methods', () => {
1359
1445
  describe('MeetingCollection getByKey proxies', () => {
1360
1446
  beforeEach(() => {
@@ -1391,7 +1477,7 @@ describe('plugin-meetings', () => {
1391
1477
  it('should have #syncMeetings', () => {
1392
1478
  assert.exists(webex.meetings.syncMeetings);
1393
1479
  });
1394
- it('should do nothing and return a resolved promise if unverified guest', async () => {
1480
+ it('should skip getActiveMeetings but still call syncAllHashTreeDatasets if unverified guest', async () => {
1395
1481
  webex.meetings.request.getActiveMeetings = sinon.stub().returns(
1396
1482
  Promise.resolve({
1397
1483
  loci: [
@@ -1404,13 +1490,23 @@ describe('plugin-meetings', () => {
1404
1490
  webex.credentials.isUnverifiedGuest = true;
1405
1491
  LoggerProxy.logger.info = sinon.stub();
1406
1492
 
1493
+ const mockLocusInfo = {
1494
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1495
+ };
1496
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1497
+ meeting1: {locusInfo: mockLocusInfo},
1498
+ meeting2: {locusInfo: undefined},
1499
+ meeting3: {},
1500
+ });
1501
+
1407
1502
  await webex.meetings.syncMeetings();
1408
1503
 
1409
1504
  assert.notCalled(webex.meetings.request.getActiveMeetings);
1410
1505
  assert.calledWith(
1411
1506
  LoggerProxy.logger.info,
1412
- 'Meetings:index#syncMeetings --> skipping meeting sync as unverified guest'
1507
+ 'Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync'
1413
1508
  );
1509
+ assert.calledOnce(mockLocusInfo.syncAllHashTreeDatasets);
1414
1510
  });
1415
1511
  describe('succesful requests', () => {
1416
1512
  beforeEach(() => {
@@ -1429,6 +1525,9 @@ describe('plugin-meetings', () => {
1429
1525
  webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
1430
1526
  locusInfo,
1431
1527
  });
1528
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1529
+ meeting1: {locusInfo, locusUrl: url1},
1530
+ });
1432
1531
  });
1433
1532
  it('tests the sync meeting calls for existing meeting', async () => {
1434
1533
  await webex.meetings.syncMeetings();
@@ -1436,6 +1535,7 @@ describe('plugin-meetings', () => {
1436
1535
  assert.calledOnce(webex.meetings.meetingCollection.getByKey);
1437
1536
  assert.calledOnce(locusInfo.parse);
1438
1537
  assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
1538
+ assert.calledOnce(locusInfo.syncAllHashTreeDatasets);
1439
1539
  });
1440
1540
  });
1441
1541
  describe('when meeting is not returned', () => {
@@ -1474,7 +1574,7 @@ describe('plugin-meetings', () => {
1474
1574
  url: url1,
1475
1575
  },
1476
1576
  hashTreeMessage: undefined,
1477
- });
1577
+ }, sinon.match.func);
1478
1578
  });
1479
1579
  });
1480
1580
  describe('when destroying meeting is needed', () => {
@@ -1520,7 +1620,7 @@ describe('plugin-meetings', () => {
1520
1620
  it('destroy any meeting that has no active locus url if keepOnlyLocusMeetings is not defined', async () => {
1521
1621
  await webex.meetings.syncMeetings();
1522
1622
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1523
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1623
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1524
1624
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1525
1625
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting1);
1526
1626
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting2);
@@ -1532,7 +1632,7 @@ describe('plugin-meetings', () => {
1532
1632
  it('destroy any meeting that has no active locus url if keepOnlyLocusMeetings === true', async () => {
1533
1633
  await webex.meetings.syncMeetings({keepOnlyLocusMeetings: true});
1534
1634
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1535
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1635
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1536
1636
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1537
1637
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting1);
1538
1638
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting2);
@@ -1544,7 +1644,7 @@ describe('plugin-meetings', () => {
1544
1644
  it('destroy any LOCUS meetings that have no active locus url if keepOnlyLocusMeetings === false', async () => {
1545
1645
  await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1546
1646
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1547
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1647
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1548
1648
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1549
1649
  assert.callCount(destroySpy, 1);
1550
1650
 
@@ -1552,6 +1652,147 @@ describe('plugin-meetings', () => {
1552
1652
  });
1553
1653
  });
1554
1654
  });
1655
+
1656
+ describe('when globalMeetingId preserves breakout meetings', () => {
1657
+ let destroySpy;
1658
+ let cleanUpSpy;
1659
+
1660
+ beforeEach(() => {
1661
+ destroySpy = sinon.spy(webex.meetings, 'destroy');
1662
+ cleanUpSpy = sinon.stub(MeetingUtil, 'cleanUp').returns(Promise.resolve());
1663
+ });
1664
+
1665
+ afterEach(() => {
1666
+ cleanUpSpy.restore();
1667
+ });
1668
+
1669
+ it('should not destroy a meeting whose globalMeetingId matches an active locus', async () => {
1670
+ const meetingCollectionMeetings = {
1671
+ breakoutMeeting: {
1672
+ locusUrl: 'breakout-url',
1673
+ locusInfo: {
1674
+ info: {globalMeetingId: 'gmid-123'},
1675
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1676
+ },
1677
+ sendCallAnalyzerMetrics: sinon.stub(),
1678
+ },
1679
+ };
1680
+
1681
+ webex.meetings.meetingCollection.getAll = sinon
1682
+ .stub()
1683
+ .returns(meetingCollectionMeetings);
1684
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1685
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1686
+ });
1687
+
1688
+ await webex.meetings.syncMeetings();
1689
+
1690
+ assert.notCalled(destroySpy);
1691
+ });
1692
+
1693
+ it('should destroy a meeting whose globalMeetingId does NOT match any active locus', async () => {
1694
+ const meetingCollectionMeetings = {
1695
+ breakoutMeeting: {
1696
+ locusUrl: 'breakout-url',
1697
+ locusInfo: {
1698
+ info: {globalMeetingId: 'gmid-other'},
1699
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1700
+ },
1701
+ sendCallAnalyzerMetrics: sinon.stub(),
1702
+ },
1703
+ };
1704
+
1705
+ webex.meetings.meetingCollection.getAll = sinon
1706
+ .stub()
1707
+ .returns(meetingCollectionMeetings);
1708
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1709
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1710
+ });
1711
+
1712
+ await webex.meetings.syncMeetings();
1713
+
1714
+ assert.calledOnce(destroySpy);
1715
+ assert.calledWith(destroySpy, meetingCollectionMeetings.breakoutMeeting);
1716
+ });
1717
+ });
1718
+
1719
+ describe('skipHashTreeSync parameter', () => {
1720
+ it('should skip syncAllHashTreeDatasets when skipHashTreeSync is true', async () => {
1721
+ const mockLocusInfo = {
1722
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1723
+ };
1724
+
1725
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1726
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1727
+ meeting1: {locusInfo: mockLocusInfo},
1728
+ });
1729
+
1730
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: true});
1731
+
1732
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1733
+ assert.notCalled(mockLocusInfo.syncAllHashTreeDatasets);
1734
+ });
1735
+
1736
+ it('should call syncAllHashTreeDatasets when skipHashTreeSync is false (default)', async () => {
1737
+ const mockLocusInfo = {
1738
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1739
+ };
1740
+
1741
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1742
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1743
+ meeting1: {locusInfo: mockLocusInfo},
1744
+ });
1745
+
1746
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: false});
1747
+
1748
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1749
+ assert.calledOnce(mockLocusInfo.syncAllHashTreeDatasets);
1750
+ });
1751
+ });
1752
+
1753
+ describe('syncAllHashTreeDatasets in syncMeetings', () => {
1754
+ it('should call syncAllHashTreeDatasets for multiple meetings, skipping those without locusInfo', async () => {
1755
+ const mockLocusInfo1 = {
1756
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1757
+ };
1758
+ const mockLocusInfo2 = {
1759
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1760
+ };
1761
+
1762
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1763
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1764
+ meeting1: {locusInfo: mockLocusInfo1},
1765
+ meeting2: {locusInfo: undefined},
1766
+ meeting3: {locusInfo: mockLocusInfo2},
1767
+ meeting4: {},
1768
+ });
1769
+
1770
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1771
+
1772
+ assert.calledOnce(mockLocusInfo1.syncAllHashTreeDatasets);
1773
+ assert.calledOnce(mockLocusInfo2.syncAllHashTreeDatasets);
1774
+ });
1775
+
1776
+ it('should not call syncAllHashTreeDatasets when getActiveMeetings throws an error', async () => {
1777
+ const mockLocusInfo = {
1778
+ syncAllHashTreeDatasets: sinon.stub().resolves(),
1779
+ };
1780
+
1781
+ webex.meetings.request.getActiveMeetings = sinon.stub().rejects(new Error('network error'));
1782
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1783
+ meeting1: {locusInfo: mockLocusInfo},
1784
+ });
1785
+
1786
+ try {
1787
+ await webex.meetings.syncMeetings();
1788
+ assert.fail('should have thrown');
1789
+ } catch (err) {
1790
+ assert.equal(err.message, 'network error');
1791
+ }
1792
+
1793
+ assert.notCalled(mockLocusInfo.syncAllHashTreeDatasets);
1794
+ });
1795
+ });
1555
1796
  });
1556
1797
  describe('#fetchStaticMeetingLink', () => {
1557
1798
  const conversationUrl = 'conv.fakeconversationurl.com';
@@ -1635,6 +1876,106 @@ describe('plugin-meetings', () => {
1635
1876
  );
1636
1877
  });
1637
1878
 
1879
+ describe('wasm runtime performance telemetry', () => {
1880
+ const probeResult = {
1881
+ status: 'slow',
1882
+ capability: 'not capable',
1883
+ ratio: 0.25,
1884
+ wasmMs: 25,
1885
+ jsMs: 100,
1886
+ };
1887
+ let metricsSpy;
1888
+ let probeCheckStub;
1889
+
1890
+ beforeEach(() => {
1891
+ webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves({});
1892
+ webex.meetings.createMeeting = sinon
1893
+ .stub()
1894
+ .returns(Promise.resolve({on: () => true, correlationId: 'wasm-corr-id'}));
1895
+ probeCheckStub = sinon.stub(WasmRuntimeProbe, 'check').resolves(probeResult);
1896
+ metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
1897
+ });
1898
+
1899
+ afterEach(() => {
1900
+ probeCheckStub.restore();
1901
+ metricsSpy.restore();
1902
+ });
1903
+
1904
+ it('emits js_sdk_wasm_runtime_performance once after a meeting is created', async () => {
1905
+ await webex.meetings.create(test1, test2);
1906
+ await testUtils.flushPromises();
1907
+
1908
+ assert.calledOnceWithExactly(probeCheckStub);
1909
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
1910
+ status: 'slow',
1911
+ ratio: 0.25,
1912
+ wasmMs: 25,
1913
+ jsMs: 100,
1914
+ correlation_id: 'wasm-corr-id',
1915
+ });
1916
+ });
1917
+
1918
+ it('logs the WASM runtime status after a meeting is created', async () => {
1919
+ const loggerLogStub = sinon.stub(LoggerProxy.logger, 'log');
1920
+
1921
+ await webex.meetings.create(test1, test2);
1922
+ await testUtils.flushPromises();
1923
+
1924
+ assert.calledOnceWithExactly(probeCheckStub);
1925
+ assert.calledOnceWithExactly(
1926
+ loggerLogStub,
1927
+ sinon.match(
1928
+ /Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status/
1929
+ )
1930
+ );
1931
+ loggerLogStub.restore();
1932
+ });
1933
+
1934
+ it('emits only once even when create() is called multiple times', async () => {
1935
+ await webex.meetings.create(test1, test2);
1936
+ await webex.meetings.create(test1, test2);
1937
+ await testUtils.flushPromises();
1938
+
1939
+ assert.calledOnceWithExactly(probeCheckStub);
1940
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
1941
+ status: 'slow',
1942
+ ratio: 0.25,
1943
+ wasmMs: 25,
1944
+ jsMs: 100,
1945
+ correlation_id: 'wasm-corr-id',
1946
+ });
1947
+ });
1948
+
1949
+ it('still resolves the meeting when the probe fails', async () => {
1950
+ const loggerErrorStub = sinon.stub(LoggerProxy.logger, 'error');
1951
+ probeCheckStub.rejects(new Error('probe failed'));
1952
+
1953
+ const created = await webex.meetings.create(test1, test2);
1954
+ await testUtils.flushPromises();
1955
+
1956
+ // create() resolved normally with the meeting, i.e. the failed probe did not break it.
1957
+ assert.equal(created.correlationId, 'wasm-corr-id');
1958
+ assert.notCalled(metricsSpy);
1959
+ assert.calledOnceWithExactly(
1960
+ loggerErrorStub,
1961
+ sinon.match(/Meetings:index#emitWasmRuntimePerformance --> ERROR/)
1962
+ );
1963
+ loggerErrorStub.restore();
1964
+ });
1965
+
1966
+ it('does not re-run the probe when create() returns an already-created meeting', async () => {
1967
+ webex.meetings.meetingCollection.getByKey = sinon
1968
+ .stub()
1969
+ .returns({updateCallStateForMetrics: sinon.stub()});
1970
+
1971
+ await webex.meetings.create(test1, test2);
1972
+ await testUtils.flushPromises();
1973
+
1974
+ assert.notCalled(probeCheckStub);
1975
+ assert.notCalled(metricsSpy);
1976
+ });
1977
+ });
1978
+
1638
1979
  it('should call MeetingInfo#fetchInfoOptions() with proper params', () => {
1639
1980
  webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves(infoOptions);
1640
1981
 
@@ -2015,7 +2356,7 @@ describe('plugin-meetings', () => {
2015
2356
  },
2016
2357
  },
2017
2358
  hashTreeMessage: undefined,
2018
- });
2359
+ }, sinon.match.func);
2019
2360
  });
2020
2361
  it('should setup the meeting from a hash tree event', async () => {
2021
2362
  const selfData = {};
@@ -2049,7 +2390,7 @@ describe('plugin-meetings', () => {
2049
2390
  info: infoData,
2050
2391
  },
2051
2392
  hashTreeMessage,
2052
- });
2393
+ }, sinon.match.func);
2053
2394
  });
2054
2395
 
2055
2396
  it('should ignore hash tree event when created locus has INACTIVE fullState', async () => {
@@ -2129,7 +2470,7 @@ describe('plugin-meetings', () => {
2129
2470
  },
2130
2471
  },
2131
2472
  hashTreeMessage: undefined,
2132
- });
2473
+ }, sinon.match.func);
2133
2474
  });
2134
2475
 
2135
2476
  it('sends client event correctly on finally', async () => {
@@ -2205,7 +2546,7 @@ describe('plugin-meetings', () => {
2205
2546
  },
2206
2547
  },
2207
2548
  hashTreeMessage: undefined,
2208
- });
2549
+ }, sinon.match.func);
2209
2550
  });
2210
2551
 
2211
2552
  const generateFakeLocusData = (isUnifiedSpaceMeeting) => ({
@@ -2833,6 +3174,39 @@ describe('plugin-meetings', () => {
2833
3174
  checkCreateMeetingWithNoMeetingInfo(true, true);
2834
3175
  });
2835
3176
 
3177
+ it('does not emit meeting:added when meeting is destroyed due to missing meeting info', async () => {
3178
+ // Make destroy actually remove the meeting from the collection
3179
+ // so that getMeetingByType returns null in the finally block
3180
+ webex.meetings.destroy = sinon.stub().callsFake((meeting) => {
3181
+ webex.meetings.meetingCollection.delete(meeting.id);
3182
+ });
3183
+
3184
+ try {
3185
+ await webex.meetings.createMeeting(
3186
+ 'test destination',
3187
+ 'test type',
3188
+ undefined,
3189
+ undefined,
3190
+ undefined,
3191
+ true
3192
+ );
3193
+ assert.fail('should have thrown NoMeetingInfoError');
3194
+ } catch (err) {
3195
+ assert.instanceOf(err, NoMeetingInfoError);
3196
+ }
3197
+
3198
+ assert.calledOnce(webex.meetings.destroy);
3199
+
3200
+ // meeting:added should NOT have been triggered since the meeting was destroyed
3201
+ assert.neverCalledWith(
3202
+ TriggerProxy.trigger,
3203
+ sinon.match.any,
3204
+ sinon.match({function: 'createMeeting'}),
3205
+ 'meeting:added',
3206
+ sinon.match.any
3207
+ );
3208
+ });
3209
+
2836
3210
  it('creates the meeting avoiding meeting info fetch by passing type as DESTINATION_TYPE.ONE_ON_ONE_CALL', async () => {
2837
3211
  const meeting = await webex.meetings.createMeeting(
2838
3212
  'test destination',
@@ -2847,6 +3221,30 @@ describe('plugin-meetings', () => {
2847
3221
 
2848
3222
  assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
2849
3223
  });
3224
+
3225
+ [
3226
+ {fullStateType: 'CALL'},
3227
+ {fullStateType: 'SIP_BRIDGE'},
3228
+ {fullStateType: 'SPACE_SHARE'},
3229
+ ].forEach(({fullStateType}) => {
3230
+ it(`skips meeting info fetch when LOCUS_ID destination is a 1:1 call (fullState.type ${fullStateType})`, async () => {
3231
+ const locusDestination = {
3232
+ fullState: {type: fullStateType},
3233
+ };
3234
+
3235
+ const meeting = await webex.meetings.createMeeting(
3236
+ locusDestination,
3237
+ DESTINATION_TYPE.LOCUS_ID
3238
+ );
3239
+
3240
+ assert.instanceOf(
3241
+ meeting,
3242
+ Meeting,
3243
+ 'createMeeting should eventually resolve to a Meeting Object'
3244
+ );
3245
+ assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
3246
+ });
3247
+ });
2850
3248
  });
2851
3249
 
2852
3250
  describe('rejected MeetingInfo.#fetchMeetingInfo - does not log for known Error types', () => {
@@ -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');