@webex/plugin-meetings 3.12.0-next.15 → 3.12.0-next.150

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 (296) hide show
  1. package/.sdd/manifest.json +1312 -0
  2. package/.sdd/templates/.source.json +30 -0
  3. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
  4. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
  5. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
  6. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
  7. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
  8. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
  9. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
  10. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
  11. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
  12. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
  13. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
  14. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
  15. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
  16. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
  17. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
  18. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
  19. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
  20. package/.sdd/templates/component-repo/template-map.json +112 -0
  21. package/AGENTS.md +135 -0
  22. package/ai-docs/ARCHITECTURE.md +207 -0
  23. package/ai-docs/CONTRACTS.md +267 -0
  24. package/ai-docs/DATA_MODEL.md +64 -0
  25. package/ai-docs/GETTING_STARTED.md +73 -0
  26. package/ai-docs/GLOSSARY.md +56 -0
  27. package/ai-docs/REVIEW_CHECKLIST.md +45 -0
  28. package/ai-docs/RULES.md +79 -0
  29. package/ai-docs/SECURITY.md +74 -0
  30. package/ai-docs/SERVICE_STATE.md +59 -0
  31. package/ai-docs/SPEC_INDEX.md +85 -0
  32. package/ai-docs/TEST_INDEX.md +45 -0
  33. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
  34. package/ai-docs/patterns/defensive-error-propagation.md +55 -0
  35. package/ai-docs/patterns/event-scope-emission.md +46 -0
  36. package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
  37. package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
  38. package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
  39. package/dist/aiEnableRequest/index.js +15 -2
  40. package/dist/aiEnableRequest/index.js.map +1 -1
  41. package/dist/annotation/index.js +2 -2
  42. package/dist/annotation/index.js.map +1 -1
  43. package/dist/breakouts/breakout.js +8 -3
  44. package/dist/breakouts/breakout.js.map +1 -1
  45. package/dist/breakouts/events.js +29 -14
  46. package/dist/breakouts/events.js.map +1 -1
  47. package/dist/breakouts/index.js +99 -4
  48. package/dist/breakouts/index.js.map +1 -1
  49. package/dist/common/errors/webex-errors.js +49 -5
  50. package/dist/common/errors/webex-errors.js.map +1 -1
  51. package/dist/config.js +2 -2
  52. package/dist/config.js.map +1 -1
  53. package/dist/constants.js +37 -10
  54. package/dist/constants.js.map +1 -1
  55. package/dist/controls-options-manager/index.js +46 -10
  56. package/dist/controls-options-manager/index.js.map +1 -1
  57. package/dist/hashTree/constants.js +4 -1
  58. package/dist/hashTree/constants.js.map +1 -1
  59. package/dist/hashTree/hashTreeParser.js +1096 -391
  60. package/dist/hashTree/hashTreeParser.js.map +1 -1
  61. package/dist/hashTree/utils.js +20 -0
  62. package/dist/hashTree/utils.js.map +1 -1
  63. package/dist/index.js +7 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  66. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  67. package/dist/interceptors/locusRetry.js +23 -8
  68. package/dist/interceptors/locusRetry.js.map +1 -1
  69. package/dist/interpretation/index.js +55 -12
  70. package/dist/interpretation/index.js.map +1 -1
  71. package/dist/interpretation/interpretation.types.js +7 -0
  72. package/dist/interpretation/interpretation.types.js.map +1 -0
  73. package/dist/interpretation/siLanguage.js +1 -1
  74. package/dist/locus-info/controlsUtils.js +4 -1
  75. package/dist/locus-info/controlsUtils.js.map +1 -1
  76. package/dist/locus-info/index.js +615 -176
  77. package/dist/locus-info/index.js.map +1 -1
  78. package/dist/locus-info/infoUtils.js +36 -5
  79. package/dist/locus-info/infoUtils.js.map +1 -1
  80. package/dist/locus-info/types.js +20 -0
  81. package/dist/locus-info/types.js.map +1 -1
  82. package/dist/media/MediaConnectionAwaiter.js +15 -2
  83. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  84. package/dist/media/index.js +8 -2
  85. package/dist/media/index.js.map +1 -1
  86. package/dist/media/properties.js +4 -5
  87. package/dist/media/properties.js.map +1 -1
  88. package/dist/meeting/in-meeting-actions.js +7 -1
  89. package/dist/meeting/in-meeting-actions.js.map +1 -1
  90. package/dist/meeting/index.js +1684 -835
  91. package/dist/meeting/index.js.map +1 -1
  92. package/dist/meeting/locusMediaRequest.js +229 -82
  93. package/dist/meeting/locusMediaRequest.js.map +1 -1
  94. package/dist/meeting/muteState.js +10 -1
  95. package/dist/meeting/muteState.js.map +1 -1
  96. package/dist/meeting/request.js +5 -2
  97. package/dist/meeting/request.js.map +1 -1
  98. package/dist/meeting/util.js +37 -3
  99. package/dist/meeting/util.js.map +1 -1
  100. package/dist/meeting/voicea-meeting.js +2 -1
  101. package/dist/meeting/voicea-meeting.js.map +1 -1
  102. package/dist/meeting-info/meeting-info-v2.js +9 -3
  103. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  104. package/dist/meetings/index.js +300 -128
  105. package/dist/meetings/index.js.map +1 -1
  106. package/dist/meetings/meetings.types.js +6 -1
  107. package/dist/meetings/meetings.types.js.map +1 -1
  108. package/dist/meetings/request.js +39 -0
  109. package/dist/meetings/request.js.map +1 -1
  110. package/dist/meetings/util.js +116 -18
  111. package/dist/meetings/util.js.map +1 -1
  112. package/dist/member/index.js +10 -0
  113. package/dist/member/index.js.map +1 -1
  114. package/dist/member/types.js.map +1 -1
  115. package/dist/member/util.js +30 -0
  116. package/dist/member/util.js.map +1 -1
  117. package/dist/members/index.js +101 -43
  118. package/dist/members/index.js.map +1 -1
  119. package/dist/members/util.js +8 -1
  120. package/dist/members/util.js.map +1 -1
  121. package/dist/metrics/constants.js +7 -1
  122. package/dist/metrics/constants.js.map +1 -1
  123. package/dist/multistream/codec/constants.js +63 -0
  124. package/dist/multistream/codec/constants.js.map +1 -0
  125. package/dist/multistream/mediaRequestManager.js +62 -15
  126. package/dist/multistream/mediaRequestManager.js.map +1 -1
  127. package/dist/multistream/receiveSlot.js +9 -0
  128. package/dist/multistream/receiveSlot.js.map +1 -1
  129. package/dist/reachability/clusterReachability.js.map +1 -1
  130. package/dist/reachability/index.js +121 -83
  131. package/dist/reachability/index.js.map +1 -1
  132. package/dist/reachability/reachability.types.js +2 -0
  133. package/dist/reachability/reachability.types.js.map +1 -1
  134. package/dist/reachability/util.js +45 -0
  135. package/dist/reachability/util.js.map +1 -1
  136. package/dist/reactions/reactions.type.js.map +1 -1
  137. package/dist/recording-controller/index.js +1 -3
  138. package/dist/recording-controller/index.js.map +1 -1
  139. package/dist/roap/turnDiscovery.js +8 -1
  140. package/dist/roap/turnDiscovery.js.map +1 -1
  141. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  142. package/dist/types/config.d.ts +2 -2
  143. package/dist/types/constants.d.ts +13 -1
  144. package/dist/types/controls-options-manager/index.d.ts +16 -0
  145. package/dist/types/hashTree/constants.d.ts +1 -0
  146. package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
  147. package/dist/types/hashTree/utils.d.ts +7 -0
  148. package/dist/types/index.d.ts +3 -0
  149. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  150. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  151. package/dist/types/locus-info/index.d.ts +106 -8
  152. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  153. package/dist/types/locus-info/types.d.ts +22 -1
  154. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  155. package/dist/types/media/properties.d.ts +6 -2
  156. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  157. package/dist/types/meeting/index.d.ts +176 -11
  158. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  159. package/dist/types/meeting/request.d.ts +1 -0
  160. package/dist/types/meeting/util.d.ts +9 -0
  161. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  162. package/dist/types/meetings/index.d.ts +40 -19
  163. package/dist/types/meetings/meetings.types.d.ts +15 -0
  164. package/dist/types/meetings/request.d.ts +14 -0
  165. package/dist/types/member/index.d.ts +1 -0
  166. package/dist/types/member/types.d.ts +1 -0
  167. package/dist/types/member/util.d.ts +9 -0
  168. package/dist/types/members/index.d.ts +15 -2
  169. package/dist/types/members/util.d.ts +1 -5
  170. package/dist/types/metrics/constants.d.ts +6 -0
  171. package/dist/types/multistream/codec/constants.d.ts +7 -0
  172. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  173. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  174. package/dist/types/reachability/index.d.ts +10 -3
  175. package/dist/types/reachability/reachability.types.d.ts +7 -0
  176. package/dist/types/reachability/util.d.ts +17 -0
  177. package/dist/types/reactions/reactions.type.d.ts +3 -0
  178. package/dist/webinar/index.js +307 -161
  179. package/dist/webinar/index.js.map +1 -1
  180. package/package.json +23 -23
  181. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  182. package/src/aiEnableRequest/index.ts +16 -0
  183. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  184. package/src/annotation/index.ts +6 -4
  185. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  186. package/src/breakouts/breakout.ts +3 -1
  187. package/src/breakouts/events.ts +33 -11
  188. package/src/breakouts/index.ts +122 -2
  189. package/src/common/errors/webex-errors.ts +50 -3
  190. package/src/config.ts +2 -2
  191. package/src/constants.ts +21 -3
  192. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  193. package/src/controls-options-manager/index.ts +62 -10
  194. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  195. package/src/hashTree/constants.ts +7 -0
  196. package/src/hashTree/hashTreeParser.ts +861 -193
  197. package/src/hashTree/utils.ts +19 -0
  198. package/src/index.ts +6 -0
  199. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  200. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  201. package/src/interceptors/locusRetry.ts +25 -4
  202. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  203. package/src/interpretation/index.ts +65 -10
  204. package/src/interpretation/interpretation.types.ts +11 -0
  205. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  206. package/src/locus-info/controlsUtils.ts +3 -1
  207. package/src/locus-info/index.ts +566 -164
  208. package/src/locus-info/infoUtils.ts +41 -6
  209. package/src/locus-info/types.ts +26 -1
  210. package/src/media/MediaConnectionAwaiter.ts +21 -4
  211. package/src/media/ai-docs/media-spec.md +267 -0
  212. package/src/media/index.ts +10 -1
  213. package/src/media/properties.ts +8 -3
  214. package/src/meeting/ai-docs/meeting-spec.md +401 -0
  215. package/src/meeting/in-meeting-actions.ts +12 -0
  216. package/src/meeting/index.ts +937 -119
  217. package/src/meeting/locusMediaRequest.ts +106 -6
  218. package/src/meeting/muteState.ts +10 -1
  219. package/src/meeting/request.ts +11 -0
  220. package/src/meeting/util.ts +51 -7
  221. package/src/meeting/voicea-meeting.ts +1 -1
  222. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  223. package/src/meeting-info/meeting-info-v2.ts +10 -4
  224. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  225. package/src/meetings/index.ts +200 -80
  226. package/src/meetings/meetings.types.ts +19 -0
  227. package/src/meetings/request.ts +43 -0
  228. package/src/meetings/util.ts +117 -4
  229. package/src/member/ai-docs/member-spec.md +196 -0
  230. package/src/member/index.ts +10 -0
  231. package/src/member/types.ts +1 -0
  232. package/src/member/util.ts +29 -0
  233. package/src/members/ai-docs/members-spec.md +256 -0
  234. package/src/members/index.ts +70 -7
  235. package/src/members/util.ts +12 -4
  236. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  237. package/src/metrics/constants.ts +6 -0
  238. package/src/multistream/ai-docs/multistream-spec.md +292 -0
  239. package/src/multistream/codec/constants.ts +58 -0
  240. package/src/multistream/mediaRequestManager.ts +119 -28
  241. package/src/multistream/receiveSlot.ts +18 -0
  242. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  243. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  244. package/src/reachability/clusterReachability.ts +3 -2
  245. package/src/reachability/index.ts +47 -16
  246. package/src/reachability/reachability.types.ts +11 -0
  247. package/src/reachability/util.ts +36 -0
  248. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  249. package/src/reactions/reactions.type.ts +3 -0
  250. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  251. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  252. package/src/recording-controller/index.ts +1 -2
  253. package/src/roap/ai-docs/roap-spec.md +241 -0
  254. package/src/roap/turnDiscovery.ts +9 -1
  255. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  256. package/src/webinar/index.ts +216 -38
  257. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  258. package/test/unit/spec/annotation/index.ts +3 -3
  259. package/test/unit/spec/breakouts/breakout.ts +9 -3
  260. package/test/unit/spec/breakouts/events.ts +120 -2
  261. package/test/unit/spec/breakouts/index.ts +223 -3
  262. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  263. package/test/unit/spec/controls-options-manager/index.js +139 -32
  264. package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
  265. package/test/unit/spec/hashTree/utils.ts +37 -0
  266. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  267. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  268. package/test/unit/spec/interpretation/index.ts +119 -4
  269. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  270. package/test/unit/spec/locus-info/index.js +1014 -58
  271. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  272. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  273. package/test/unit/spec/media/index.ts +92 -0
  274. package/test/unit/spec/media/properties.ts +23 -23
  275. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  276. package/test/unit/spec/meeting/index.js +2811 -117
  277. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  278. package/test/unit/spec/meeting/muteState.js +81 -0
  279. package/test/unit/spec/meeting/request.js +12 -0
  280. package/test/unit/spec/meeting/utils.js +179 -16
  281. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  282. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  283. package/test/unit/spec/meetings/index.js +544 -49
  284. package/test/unit/spec/meetings/request.js +141 -0
  285. package/test/unit/spec/meetings/utils.js +402 -51
  286. package/test/unit/spec/member/index.js +7 -0
  287. package/test/unit/spec/member/util.js +89 -0
  288. package/test/unit/spec/members/index.js +216 -0
  289. package/test/unit/spec/members/request.js +37 -1
  290. package/test/unit/spec/members/utils.js +63 -0
  291. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  292. package/test/unit/spec/reachability/index.ts +128 -46
  293. package/test/unit/spec/reachability/util.ts +31 -0
  294. package/test/unit/spec/recording-controller/index.js +9 -8
  295. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  296. 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,164 @@ 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
+ cleanUp: sinon.stub(),
1712
+ },
1713
+ sendCallAnalyzerMetrics: sinon.stub(),
1714
+ },
1715
+ };
1716
+
1717
+ webex.meetings.meetingCollection.getAll = sinon
1718
+ .stub()
1719
+ .returns(meetingCollectionMeetings);
1720
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1721
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1722
+ });
1723
+
1724
+ await webex.meetings.syncMeetings();
1725
+
1726
+ assert.calledOnce(destroySpy);
1727
+ assert.calledWith(destroySpy, meetingCollectionMeetings.breakoutMeeting);
1728
+ });
1729
+ });
1730
+
1731
+ describe('skipHashTreeSync parameter', () => {
1732
+ it('should pass canSyncHashTree:false to locusInfo.sync when skipHashTreeSync is true', async () => {
1733
+ const mockLocusInfo = {
1734
+ sync: sinon.stub().resolves(),
1735
+ };
1736
+ const meeting1 = {locusInfo: mockLocusInfo};
1737
+
1738
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1739
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1740
+ meeting1,
1741
+ });
1742
+
1743
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: true});
1744
+
1745
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1746
+ assert.calledOnceWithExactly(mockLocusInfo.sync, meeting1, {
1747
+ canSyncClassicLocus: false,
1748
+ canSyncHashTree: false,
1749
+ });
1750
+ });
1751
+
1752
+ it('should pass canSyncHashTree:true to locusInfo.sync when skipHashTreeSync is false (default)', async () => {
1753
+ const mockLocusInfo = {
1754
+ sync: sinon.stub().resolves(),
1755
+ };
1756
+ const meeting1 = {locusInfo: mockLocusInfo};
1757
+
1758
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1759
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1760
+ meeting1,
1761
+ });
1762
+
1763
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: false});
1764
+
1765
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1766
+ assert.calledOnceWithExactly(mockLocusInfo.sync, meeting1, {
1767
+ canSyncClassicLocus: false,
1768
+ canSyncHashTree: true,
1769
+ });
1770
+ });
1771
+ });
1772
+
1773
+ describe('per-meeting sync in syncMeetings', () => {
1774
+ it('should call locusInfo.sync for multiple meetings, skipping those without locusInfo', async () => {
1775
+ const mockLocusInfo1 = {
1776
+ sync: sinon.stub().resolves(),
1777
+ };
1778
+ const mockLocusInfo2 = {
1779
+ sync: sinon.stub().resolves(),
1780
+ };
1781
+
1782
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1783
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1784
+ meeting1: {locusInfo: mockLocusInfo1},
1785
+ meeting2: {locusInfo: undefined},
1786
+ meeting3: {locusInfo: mockLocusInfo2},
1787
+ meeting4: {},
1788
+ });
1789
+
1790
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1791
+
1792
+ assert.calledOnceWithExactly(
1793
+ mockLocusInfo1.sync,
1794
+ {locusInfo: mockLocusInfo1},
1795
+ {canSyncClassicLocus: false, canSyncHashTree: true}
1796
+ );
1797
+ assert.calledOnceWithExactly(
1798
+ mockLocusInfo2.sync,
1799
+ {locusInfo: mockLocusInfo2},
1800
+ {canSyncClassicLocus: false, canSyncHashTree: true}
1801
+ );
1802
+ });
1803
+
1804
+ it('should not call locusInfo.sync when getActiveMeetings throws an error', async () => {
1805
+ const mockLocusInfo = {
1806
+ sync: sinon.stub().resolves(),
1807
+ };
1808
+
1809
+ webex.meetings.request.getActiveMeetings = sinon.stub().rejects(new Error('network error'));
1810
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1811
+ meeting1: {locusInfo: mockLocusInfo},
1812
+ });
1813
+
1814
+ try {
1815
+ await webex.meetings.syncMeetings();
1816
+ assert.fail('should have thrown');
1817
+ } catch (err) {
1818
+ assert.equal(err.message, 'network error');
1819
+ }
1820
+
1821
+ assert.notCalled(mockLocusInfo.sync);
1822
+ });
1823
+ });
1555
1824
  });
1556
1825
  describe('#fetchStaticMeetingLink', () => {
1557
1826
  const conversationUrl = 'conv.fakeconversationurl.com';
@@ -1635,6 +1904,141 @@ describe('plugin-meetings', () => {
1635
1904
  );
1636
1905
  });
1637
1906
 
1907
+ describe('wasm runtime performance telemetry', () => {
1908
+ const correlationId = 'wasm-corr-id';
1909
+ const benchmarkMeasurements = {
1910
+ divRatio: 1.888,
1911
+ sqrtRatio: 3.474,
1912
+ addNsPerOp: 2.006,
1913
+ addMedianMs: 32.1,
1914
+ divMedianMs: 60.6,
1915
+ sqrtMedianMs: 111.5,
1916
+ };
1917
+ const probeResult = {
1918
+ status: 'slow',
1919
+ capability: 'not capable',
1920
+ reason: null,
1921
+ measurements: benchmarkMeasurements,
1922
+ };
1923
+ const expectedMetricFields = {
1924
+ status: probeResult.status,
1925
+ capability: probeResult.capability,
1926
+ reason: probeResult.reason,
1927
+ ...benchmarkMeasurements,
1928
+ correlation_id: correlationId,
1929
+ };
1930
+ let metricsSpy;
1931
+ let probeCheckStub;
1932
+
1933
+ beforeEach(() => {
1934
+ webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves({});
1935
+ webex.meetings.createMeeting = sinon
1936
+ .stub()
1937
+ .returns(Promise.resolve({on: () => true, correlationId}));
1938
+ probeCheckStub = sinon.stub(WasmRuntimeProbe, 'check').resolves(probeResult);
1939
+ metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
1940
+ });
1941
+
1942
+ afterEach(() => {
1943
+ probeCheckStub.restore();
1944
+ metricsSpy.restore();
1945
+ });
1946
+
1947
+ it('emits js_sdk_wasm_runtime_performance once after a meeting is created', async () => {
1948
+ await webex.meetings.create(test1, test2);
1949
+ await testUtils.flushPromises();
1950
+
1951
+ assert.calledOnceWithExactly(probeCheckStub);
1952
+ assert.calledOnceWithExactly(
1953
+ metricsSpy,
1954
+ 'js_sdk_wasm_runtime_performance',
1955
+ expectedMetricFields
1956
+ );
1957
+ });
1958
+
1959
+ it('logs the WASM runtime status after a meeting is created', async () => {
1960
+ const loggerLogStub = sinon.stub(LoggerProxy.logger, 'log');
1961
+
1962
+ await webex.meetings.create(test1, test2);
1963
+ await testUtils.flushPromises();
1964
+
1965
+ assert.calledOnceWithExactly(probeCheckStub);
1966
+ assert.calledOnceWithExactly(
1967
+ loggerLogStub,
1968
+ sinon.match(
1969
+ /Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status/
1970
+ )
1971
+ );
1972
+ loggerLogStub.restore();
1973
+ });
1974
+
1975
+ it('emits only once even when create() is called multiple times', async () => {
1976
+ await webex.meetings.create(test1, test2);
1977
+ await webex.meetings.create(test1, test2);
1978
+ await testUtils.flushPromises();
1979
+
1980
+ assert.calledOnceWithExactly(probeCheckStub);
1981
+ assert.calledOnceWithExactly(
1982
+ metricsSpy,
1983
+ 'js_sdk_wasm_runtime_performance',
1984
+ expectedMetricFields
1985
+ );
1986
+ });
1987
+
1988
+ it('emits the reason with null measurement fields when no measurements are available', async () => {
1989
+ probeCheckStub.resolves({
1990
+ status: 'unknown',
1991
+ capability: 'unknown',
1992
+ reason: 'worker_timeout',
1993
+ measurements: null,
1994
+ });
1995
+
1996
+ await webex.meetings.create(test1, test2);
1997
+ await testUtils.flushPromises();
1998
+
1999
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
2000
+ status: 'unknown',
2001
+ capability: 'unknown',
2002
+ reason: 'worker_timeout',
2003
+ divRatio: null,
2004
+ sqrtRatio: null,
2005
+ addNsPerOp: null,
2006
+ addMedianMs: null,
2007
+ divMedianMs: null,
2008
+ sqrtMedianMs: null,
2009
+ correlation_id: correlationId,
2010
+ });
2011
+ });
2012
+
2013
+ it('still resolves the meeting when the probe fails', async () => {
2014
+ const loggerErrorStub = sinon.stub(LoggerProxy.logger, 'error');
2015
+ probeCheckStub.rejects(new Error('probe failed'));
2016
+
2017
+ const created = await webex.meetings.create(test1, test2);
2018
+ await testUtils.flushPromises();
2019
+
2020
+ assert.equal(created.correlationId, correlationId);
2021
+ assert.notCalled(metricsSpy);
2022
+ assert.calledOnceWithExactly(
2023
+ loggerErrorStub,
2024
+ sinon.match(/Meetings:index#emitWasmRuntimePerformance --> ERROR/)
2025
+ );
2026
+ loggerErrorStub.restore();
2027
+ });
2028
+
2029
+ it('does not re-run the probe when create() returns an already-created meeting', async () => {
2030
+ webex.meetings.meetingCollection.getByKey = sinon
2031
+ .stub()
2032
+ .returns({updateCallStateForMetrics: sinon.stub()});
2033
+
2034
+ await webex.meetings.create(test1, test2);
2035
+ await testUtils.flushPromises();
2036
+
2037
+ assert.notCalled(probeCheckStub);
2038
+ assert.notCalled(metricsSpy);
2039
+ });
2040
+ });
2041
+
1638
2042
  it('should call MeetingInfo#fetchInfoOptions() with proper params', () => {
1639
2043
  webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves(infoOptions);
1640
2044
 
@@ -1878,6 +2282,28 @@ describe('plugin-meetings', () => {
1878
2282
  assert.calledWith(webex.internal.mercury.on, OFFLINE);
1879
2283
  assert.callCount(webex.internal.mercury.on, 4);
1880
2284
  });
2285
+
2286
+ it('handles a rejected syncMeetings when the ONLINE event fires so it does not become an unhandled rejection', async () => {
2287
+ const syncError = new Error('sync failed');
2288
+ sinon.stub(webex.meetings, 'syncMeetings').rejects(syncError);
2289
+ const loggerWarnStub = sinon.stub(LoggerProxy.logger, 'warn');
2290
+
2291
+ webex.meetings.listenForEvents();
2292
+
2293
+ const onlineCallback = webex.internal.mercury.on
2294
+ .getCalls()
2295
+ .find((call) => call.args[0] === ONLINE).args[1];
2296
+
2297
+ // invoking the listener must not throw synchronously nor leave a rejection unhandled
2298
+ onlineCallback();
2299
+
2300
+ assert.calledOnceWithExactly(webex.meetings.syncMeetings, {keepOnlyLocusMeetings: false});
2301
+
2302
+ await testUtils.flushPromises();
2303
+
2304
+ assert.calledOnce(loggerWarnStub);
2305
+ assert.include(loggerWarnStub.firstCall.args[0], 'syncMeetings after ONLINE event failed');
2306
+ });
1881
2307
  });
1882
2308
  describe('#handleLocusMercury', () => {
1883
2309
  beforeEach(() => {
@@ -2015,7 +2441,7 @@ describe('plugin-meetings', () => {
2015
2441
  },
2016
2442
  },
2017
2443
  hashTreeMessage: undefined,
2018
- });
2444
+ }, sinon.match.func);
2019
2445
  });
2020
2446
  it('should setup the meeting from a hash tree event', async () => {
2021
2447
  const selfData = {};
@@ -2049,7 +2475,7 @@ describe('plugin-meetings', () => {
2049
2475
  info: infoData,
2050
2476
  },
2051
2477
  hashTreeMessage,
2052
- });
2478
+ }, sinon.match.func);
2053
2479
  });
2054
2480
 
2055
2481
  it('should ignore hash tree event when created locus has INACTIVE fullState', async () => {
@@ -2129,7 +2555,7 @@ describe('plugin-meetings', () => {
2129
2555
  },
2130
2556
  },
2131
2557
  hashTreeMessage: undefined,
2132
- });
2558
+ }, sinon.match.func);
2133
2559
  });
2134
2560
 
2135
2561
  it('sends client event correctly on finally', async () => {
@@ -2205,7 +2631,7 @@ describe('plugin-meetings', () => {
2205
2631
  },
2206
2632
  },
2207
2633
  hashTreeMessage: undefined,
2208
- });
2634
+ }, sinon.match.func);
2209
2635
  });
2210
2636
 
2211
2637
  const generateFakeLocusData = (isUnifiedSpaceMeeting) => ({
@@ -2337,7 +2763,11 @@ describe('plugin-meetings', () => {
2337
2763
  undefined,
2338
2764
  undefined,
2339
2765
  extraParams,
2340
- {meetingId: meeting.id, sendCAevents}
2766
+ {
2767
+ meetingId: meeting.id,
2768
+ sendCAevents,
2769
+ correlationId: meeting.correlationId,
2770
+ }
2341
2771
  );
2342
2772
  }
2343
2773
 
@@ -2880,6 +3310,30 @@ describe('plugin-meetings', () => {
2880
3310
 
2881
3311
  assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
2882
3312
  });
3313
+
3314
+ [
3315
+ {fullStateType: 'CALL'},
3316
+ {fullStateType: 'SIP_BRIDGE'},
3317
+ {fullStateType: 'SPACE_SHARE'},
3318
+ ].forEach(({fullStateType}) => {
3319
+ it(`skips meeting info fetch when LOCUS_ID destination is a 1:1 call (fullState.type ${fullStateType})`, async () => {
3320
+ const locusDestination = {
3321
+ fullState: {type: fullStateType},
3322
+ };
3323
+
3324
+ const meeting = await webex.meetings.createMeeting(
3325
+ locusDestination,
3326
+ DESTINATION_TYPE.LOCUS_ID
3327
+ );
3328
+
3329
+ assert.instanceOf(
3330
+ meeting,
3331
+ Meeting,
3332
+ 'createMeeting should eventually resolve to a Meeting Object'
3333
+ );
3334
+ assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
3335
+ });
3336
+ });
2883
3337
  });
2884
3338
 
2885
3339
  describe('rejected MeetingInfo.#fetchMeetingInfo - does not log for known Error types', () => {
@@ -3010,6 +3464,16 @@ describe('plugin-meetings', () => {
3010
3464
  assert.equal(deletedMeetingInfo.roles, meetingIds.roles);
3011
3465
  assert.equal(deletedMeetingInfo.callStateForMetrics, meetingIds.callStateForMetrics);
3012
3466
  });
3467
+
3468
+ it('cleans up locusInfo (tearing down hash tree parsers) when destroying the meeting', async () => {
3469
+ const meeting = await webex.meetings.createMeeting('test', 'test');
3470
+ const locusInfoCleanUpSpy = sinon.spy(meeting.locusInfo, 'cleanUp');
3471
+
3472
+ webex.meetings.destroy(meeting, test1);
3473
+
3474
+ // hash tree parser teardown is deferred from MeetingUtil.cleanUp to Meetings#destroy
3475
+ assert.calledOnce(locusInfoCleanUpSpy);
3476
+ });
3013
3477
  });
3014
3478
 
3015
3479
  describe('with auto upload logs enabled', () => {
@@ -3119,7 +3583,7 @@ describe('plugin-meetings', () => {
3119
3583
  loggerProxySpy,
3120
3584
  'Failed to fetch preferred site from user - no site will be set'
3121
3585
  );
3122
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3586
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3123
3587
  });
3124
3588
 
3125
3589
  it('should fall back to fetching the site from the user', async () => {
@@ -3137,7 +3601,6 @@ describe('plugin-meetings', () => {
3137
3601
 
3138
3602
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3139
3603
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3140
- '',
3141
3604
  'site.webex.com',
3142
3605
  ]);
3143
3606
  assert.notCalled(loggerProxySpy);
@@ -3161,7 +3624,7 @@ describe('plugin-meetings', () => {
3161
3624
  loggerProxySpy,
3162
3625
  'Failed to fetch preferred site from user - no site will be set'
3163
3626
  );
3164
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3627
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3165
3628
  });
3166
3629
  }
3167
3630
  );
@@ -3178,7 +3641,7 @@ describe('plugin-meetings', () => {
3178
3641
  loggerProxySpy,
3179
3642
  'Failed to fetch preferred site from user - no site will be set'
3180
3643
  );
3181
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3644
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3182
3645
  });
3183
3646
 
3184
3647
  it('should fall back to fetching the site from the user', async () => {
@@ -3197,7 +3660,6 @@ describe('plugin-meetings', () => {
3197
3660
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3198
3661
  assert.notCalled(loggerProxySpy);
3199
3662
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3200
- '',
3201
3663
  'site.webex.com',
3202
3664
  ]);
3203
3665
  });
@@ -3220,7 +3682,7 @@ describe('plugin-meetings', () => {
3220
3682
  loggerProxySpy,
3221
3683
  'Failed to fetch preferred site from user - no site will be set'
3222
3684
  );
3223
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3685
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3224
3686
  });
3225
3687
  }
3226
3688
  );
@@ -3237,7 +3699,7 @@ describe('plugin-meetings', () => {
3237
3699
  loggerProxySpy,
3238
3700
  'Failed to fetch preferred site from user - no site will be set'
3239
3701
  );
3240
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3702
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3241
3703
  });
3242
3704
  });
3243
3705
  });
@@ -3303,10 +3765,13 @@ describe('plugin-meetings', () => {
3303
3765
  };
3304
3766
 
3305
3767
  it('triggers correct event when SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE emitted', async () => {
3768
+ sinon.stub(meeting, 'updateMeetingActions');
3306
3769
  checkSelfTrigger(
3307
3770
  LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
3308
3771
  EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST
3309
3772
  );
3773
+ assert.calledOnce(meeting.updateMeetingActions);
3774
+ meeting.updateMeetingActions.restore();
3310
3775
  });
3311
3776
 
3312
3777
  it('triggers correct event when SELF_IS_SHARING_BLOCKED_CHANGE emitted', async () => {
@@ -3459,6 +3924,21 @@ describe('plugin-meetings', () => {
3459
3924
  'Meetings:index#isNeedHandleMainLocus --> self device left&moved in main locus with self joined status, not need to handle'
3460
3925
  );
3461
3926
  });
3927
+
3928
+ it('check breakout ended with self removed, return false', () => {
3929
+ webex.meetings.meetingCollection.getActiveBreakoutLocus = sinon.stub().returns(null);
3930
+ newLocus.self.state = 'LEFT';
3931
+ newLocus.self.reason = 'OTHER';
3932
+ newLocus.self.removed = true;
3933
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3934
+ LoggerProxy.logger.log = sinon.stub();
3935
+ const result = webex.meetings.isNeedHandleMainLocus(meeting, newLocus);
3936
+ assert.equal(result, false);
3937
+ assert.calledWith(
3938
+ LoggerProxy.logger.log,
3939
+ 'Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle'
3940
+ );
3941
+ });
3462
3942
  });
3463
3943
 
3464
3944
  describe('#isNeedHandleLocusDTO', () => {
@@ -3519,6 +3999,18 @@ describe('plugin-meetings', () => {
3519
3999
  const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3520
4000
  assert.equal(result, false);
3521
4001
  });
4002
+ it('breakout session with breakout ended, return false', () => {
4003
+ newLocus.controls.breakout = {
4004
+ sessionType: 'BREAKOUT',
4005
+ };
4006
+ newLocus.self.state = 'LEFT';
4007
+ newLocus.self.reason = 'OTHER';
4008
+ newLocus.self.devices = [];
4009
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
4010
+ LoggerProxy.logger.log = sinon.stub();
4011
+ const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
4012
+ assert.equal(result, false);
4013
+ });
3522
4014
  it('moved to lobby, return true', () => {
3523
4015
  newLocus.controls.breakout = {
3524
4016
  sessionType: 'MAIN',
@@ -3996,6 +4488,9 @@ describe('plugin-meetings', () => {
3996
4488
 
3997
4489
  triggerProxyStub.restore();
3998
4490
 
4491
+ // Never resolve, so the create()-triggered WASM emit can't reach the metrics spy below.
4492
+ sinon.stub(WasmRuntimeProbe, 'check').returns(new Promise(() => {}));
4493
+
3999
4494
  metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
4000
4495
 
4001
4496
  meeting = await webex.meetings.create('test');