@webex/plugin-meetings 3.12.0-next.18 → 3.12.0-next.180

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 (307) 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/assets/README.md +26 -0
  40. package/assets/e2ee.js +2 -0
  41. package/assets/e2ee.wasm +0 -0
  42. package/dist/aiEnableRequest/index.js +15 -2
  43. package/dist/aiEnableRequest/index.js.map +1 -1
  44. package/dist/annotation/index.js +55 -19
  45. package/dist/annotation/index.js.map +1 -1
  46. package/dist/assets/e2ee.js +2 -0
  47. package/dist/assets/e2ee.wasm +0 -0
  48. package/dist/breakouts/breakout.js +8 -3
  49. package/dist/breakouts/breakout.js.map +1 -1
  50. package/dist/breakouts/events.js +29 -14
  51. package/dist/breakouts/events.js.map +1 -1
  52. package/dist/breakouts/index.js +128 -7
  53. package/dist/breakouts/index.js.map +1 -1
  54. package/dist/common/errors/webex-errors.js +54 -5
  55. package/dist/common/errors/webex-errors.js.map +1 -1
  56. package/dist/config.js +3 -2
  57. package/dist/config.js.map +1 -1
  58. package/dist/constants.js +39 -11
  59. package/dist/constants.js.map +1 -1
  60. package/dist/controls-options-manager/index.js +46 -10
  61. package/dist/controls-options-manager/index.js.map +1 -1
  62. package/dist/hashTree/constants.js +4 -1
  63. package/dist/hashTree/constants.js.map +1 -1
  64. package/dist/hashTree/hashTreeParser.js +1096 -391
  65. package/dist/hashTree/hashTreeParser.js.map +1 -1
  66. package/dist/hashTree/utils.js +20 -0
  67. package/dist/hashTree/utils.js.map +1 -1
  68. package/dist/index.js +8 -0
  69. package/dist/index.js.map +1 -1
  70. package/dist/interceptors/dataChannelAuthToken.js +58 -16
  71. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  72. package/dist/interceptors/locusRetry.js +24 -9
  73. package/dist/interceptors/locusRetry.js.map +1 -1
  74. package/dist/interpretation/index.js +55 -12
  75. package/dist/interpretation/index.js.map +1 -1
  76. package/dist/interpretation/interpretation.types.js +7 -0
  77. package/dist/interpretation/interpretation.types.js.map +1 -0
  78. package/dist/interpretation/siLanguage.js +1 -1
  79. package/dist/locus-info/controlsUtils.js +4 -1
  80. package/dist/locus-info/controlsUtils.js.map +1 -1
  81. package/dist/locus-info/index.js +615 -176
  82. package/dist/locus-info/index.js.map +1 -1
  83. package/dist/locus-info/infoUtils.js +36 -5
  84. package/dist/locus-info/infoUtils.js.map +1 -1
  85. package/dist/locus-info/types.js +20 -0
  86. package/dist/locus-info/types.js.map +1 -1
  87. package/dist/media/MediaConnectionAwaiter.js +229 -166
  88. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  89. package/dist/media/index.js +8 -2
  90. package/dist/media/index.js.map +1 -1
  91. package/dist/media/properties.js +4 -5
  92. package/dist/media/properties.js.map +1 -1
  93. package/dist/meeting/in-meeting-actions.js +5 -1
  94. package/dist/meeting/in-meeting-actions.js.map +1 -1
  95. package/dist/meeting/index.js +1844 -959
  96. package/dist/meeting/index.js.map +1 -1
  97. package/dist/meeting/locusMediaRequest.js +229 -82
  98. package/dist/meeting/locusMediaRequest.js.map +1 -1
  99. package/dist/meeting/muteState.js +10 -1
  100. package/dist/meeting/muteState.js.map +1 -1
  101. package/dist/meeting/request.js +5 -2
  102. package/dist/meeting/request.js.map +1 -1
  103. package/dist/meeting/util.js +42 -4
  104. package/dist/meeting/util.js.map +1 -1
  105. package/dist/meeting/voicea-meeting.js +2 -1
  106. package/dist/meeting/voicea-meeting.js.map +1 -1
  107. package/dist/meeting-info/meeting-info-v2.js +12 -5
  108. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  109. package/dist/meetings/index.js +304 -129
  110. package/dist/meetings/index.js.map +1 -1
  111. package/dist/meetings/meetings.types.js +6 -1
  112. package/dist/meetings/meetings.types.js.map +1 -1
  113. package/dist/meetings/request.js +39 -0
  114. package/dist/meetings/request.js.map +1 -1
  115. package/dist/meetings/util.js +116 -18
  116. package/dist/meetings/util.js.map +1 -1
  117. package/dist/member/index.js +10 -0
  118. package/dist/member/index.js.map +1 -1
  119. package/dist/member/types.js.map +1 -1
  120. package/dist/member/util.js +30 -0
  121. package/dist/member/util.js.map +1 -1
  122. package/dist/members/index.js +101 -43
  123. package/dist/members/index.js.map +1 -1
  124. package/dist/members/util.js +8 -1
  125. package/dist/members/util.js.map +1 -1
  126. package/dist/metrics/constants.js +7 -1
  127. package/dist/metrics/constants.js.map +1 -1
  128. package/dist/multistream/codec/constants.js +63 -0
  129. package/dist/multistream/codec/constants.js.map +1 -0
  130. package/dist/multistream/mediaRequestManager.js +62 -15
  131. package/dist/multistream/mediaRequestManager.js.map +1 -1
  132. package/dist/multistream/receiveSlot.js +9 -0
  133. package/dist/multistream/receiveSlot.js.map +1 -1
  134. package/dist/multistream/remoteMediaManager.js +32 -4
  135. package/dist/multistream/remoteMediaManager.js.map +1 -1
  136. package/dist/reachability/clusterReachability.js.map +1 -1
  137. package/dist/reachability/index.js +121 -83
  138. package/dist/reachability/index.js.map +1 -1
  139. package/dist/reachability/reachability.types.js +2 -0
  140. package/dist/reachability/reachability.types.js.map +1 -1
  141. package/dist/reachability/util.js +45 -0
  142. package/dist/reachability/util.js.map +1 -1
  143. package/dist/reactions/reactions.type.js.map +1 -1
  144. package/dist/recording-controller/index.js +1 -3
  145. package/dist/recording-controller/index.js.map +1 -1
  146. package/dist/roap/turnDiscovery.js +8 -1
  147. package/dist/roap/turnDiscovery.js.map +1 -1
  148. package/dist/types/annotation/index.d.ts +19 -0
  149. package/dist/types/common/errors/webex-errors.d.ts +36 -2
  150. package/dist/types/config.d.ts +3 -2
  151. package/dist/types/constants.d.ts +15 -2
  152. package/dist/types/controls-options-manager/index.d.ts +16 -0
  153. package/dist/types/hashTree/constants.d.ts +1 -0
  154. package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
  155. package/dist/types/hashTree/utils.d.ts +7 -0
  156. package/dist/types/index.d.ts +4 -0
  157. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  158. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  159. package/dist/types/locus-info/index.d.ts +106 -8
  160. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  161. package/dist/types/locus-info/types.d.ts +22 -1
  162. package/dist/types/media/MediaConnectionAwaiter.d.ts +66 -49
  163. package/dist/types/media/properties.d.ts +6 -2
  164. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  165. package/dist/types/meeting/index.d.ts +217 -16
  166. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  167. package/dist/types/meeting/request.d.ts +1 -0
  168. package/dist/types/meeting/util.d.ts +12 -1
  169. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  170. package/dist/types/meetings/index.d.ts +40 -19
  171. package/dist/types/meetings/meetings.types.d.ts +15 -0
  172. package/dist/types/meetings/request.d.ts +14 -0
  173. package/dist/types/member/index.d.ts +1 -0
  174. package/dist/types/member/types.d.ts +1 -0
  175. package/dist/types/member/util.d.ts +9 -0
  176. package/dist/types/members/index.d.ts +15 -2
  177. package/dist/types/members/util.d.ts +1 -5
  178. package/dist/types/metrics/constants.d.ts +6 -0
  179. package/dist/types/multistream/codec/constants.d.ts +7 -0
  180. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  181. package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
  182. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  183. package/dist/types/reachability/index.d.ts +10 -3
  184. package/dist/types/reachability/reachability.types.d.ts +7 -0
  185. package/dist/types/reachability/util.d.ts +17 -0
  186. package/dist/types/reactions/reactions.type.d.ts +3 -0
  187. package/dist/webinar/index.js +441 -252
  188. package/dist/webinar/index.js.map +1 -1
  189. package/package.json +26 -24
  190. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  191. package/src/aiEnableRequest/index.ts +16 -0
  192. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  193. package/src/annotation/index.ts +61 -29
  194. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  195. package/src/breakouts/breakout.ts +3 -1
  196. package/src/breakouts/events.ts +33 -11
  197. package/src/breakouts/index.ts +145 -3
  198. package/src/common/errors/webex-errors.ts +56 -3
  199. package/src/config.ts +3 -2
  200. package/src/constants.ts +23 -4
  201. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  202. package/src/controls-options-manager/index.ts +62 -10
  203. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  204. package/src/hashTree/constants.ts +7 -0
  205. package/src/hashTree/hashTreeParser.ts +861 -193
  206. package/src/hashTree/utils.ts +19 -0
  207. package/src/index.ts +7 -0
  208. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  209. package/src/interceptors/dataChannelAuthToken.ts +59 -12
  210. package/src/interceptors/locusRetry.ts +26 -5
  211. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  212. package/src/interpretation/index.ts +65 -10
  213. package/src/interpretation/interpretation.types.ts +11 -0
  214. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  215. package/src/locus-info/controlsUtils.ts +3 -1
  216. package/src/locus-info/index.ts +566 -164
  217. package/src/locus-info/infoUtils.ts +41 -6
  218. package/src/locus-info/types.ts +26 -1
  219. package/src/media/MediaConnectionAwaiter.ts +229 -196
  220. package/src/media/ai-docs/media-spec.md +267 -0
  221. package/src/media/index.ts +10 -1
  222. package/src/media/properties.ts +8 -3
  223. package/src/meeting/ai-docs/meeting-spec.md +401 -0
  224. package/src/meeting/in-meeting-actions.ts +8 -0
  225. package/src/meeting/index.ts +1085 -252
  226. package/src/meeting/locusMediaRequest.ts +106 -6
  227. package/src/meeting/muteState.ts +10 -1
  228. package/src/meeting/request.ts +11 -0
  229. package/src/meeting/util.ts +53 -9
  230. package/src/meeting/voicea-meeting.ts +1 -1
  231. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  232. package/src/meeting-info/meeting-info-v2.ts +11 -4
  233. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  234. package/src/meetings/index.ts +202 -81
  235. package/src/meetings/meetings.types.ts +19 -0
  236. package/src/meetings/request.ts +43 -0
  237. package/src/meetings/util.ts +117 -4
  238. package/src/member/ai-docs/member-spec.md +196 -0
  239. package/src/member/index.ts +10 -0
  240. package/src/member/types.ts +1 -0
  241. package/src/member/util.ts +29 -0
  242. package/src/members/ai-docs/members-spec.md +256 -0
  243. package/src/members/index.ts +70 -7
  244. package/src/members/util.ts +12 -4
  245. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  246. package/src/metrics/constants.ts +6 -0
  247. package/src/multistream/ai-docs/multistream-spec.md +292 -0
  248. package/src/multistream/codec/constants.ts +58 -0
  249. package/src/multistream/mediaRequestManager.ts +119 -28
  250. package/src/multistream/receiveSlot.ts +18 -0
  251. package/src/multistream/remoteMediaManager.ts +23 -1
  252. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  253. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  254. package/src/reachability/clusterReachability.ts +3 -2
  255. package/src/reachability/index.ts +47 -16
  256. package/src/reachability/reachability.types.ts +11 -0
  257. package/src/reachability/util.ts +36 -0
  258. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  259. package/src/reactions/reactions.type.ts +3 -0
  260. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  261. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  262. package/src/recording-controller/index.ts +1 -2
  263. package/src/roap/ai-docs/roap-spec.md +241 -0
  264. package/src/roap/turnDiscovery.ts +9 -1
  265. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  266. package/src/webinar/index.ts +247 -89
  267. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  268. package/test/unit/spec/annotation/index.ts +214 -182
  269. package/test/unit/spec/breakouts/breakout.ts +9 -3
  270. package/test/unit/spec/breakouts/events.ts +120 -2
  271. package/test/unit/spec/breakouts/index.ts +336 -15
  272. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  273. package/test/unit/spec/controls-options-manager/index.js +139 -32
  274. package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
  275. package/test/unit/spec/hashTree/utils.ts +37 -0
  276. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +179 -1
  277. package/test/unit/spec/interceptors/locusRetry.ts +234 -5
  278. package/test/unit/spec/interpretation/index.ts +119 -4
  279. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  280. package/test/unit/spec/locus-info/index.js +1014 -58
  281. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  282. package/test/unit/spec/media/MediaConnectionAwaiter.ts +479 -17
  283. package/test/unit/spec/media/index.ts +92 -0
  284. package/test/unit/spec/media/properties.ts +26 -26
  285. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  286. package/test/unit/spec/meeting/index.js +3462 -493
  287. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  288. package/test/unit/spec/meeting/muteState.js +81 -0
  289. package/test/unit/spec/meeting/request.js +12 -0
  290. package/test/unit/spec/meeting/utils.js +205 -19
  291. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  292. package/test/unit/spec/meeting-info/meetinginfov2.js +88 -11
  293. package/test/unit/spec/meetings/index.js +549 -49
  294. package/test/unit/spec/meetings/request.js +141 -0
  295. package/test/unit/spec/meetings/utils.js +402 -51
  296. package/test/unit/spec/member/index.js +7 -0
  297. package/test/unit/spec/member/util.js +89 -0
  298. package/test/unit/spec/members/index.js +216 -0
  299. package/test/unit/spec/members/request.js +37 -1
  300. package/test/unit/spec/members/utils.js +63 -0
  301. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  302. package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
  303. package/test/unit/spec/reachability/index.ts +128 -46
  304. package/test/unit/spec/reachability/util.ts +31 -0
  305. package/test/unit/spec/recording-controller/index.js +9 -8
  306. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  307. package/test/unit/spec/webinar/index.ts +935 -466
@@ -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: {
@@ -138,6 +143,7 @@ describe('plugin-meetings', () => {
138
143
 
139
144
  Object.assign(webex.internal, {
140
145
  llm: {on: sinon.stub()},
146
+ voicea: {createChannel: sinon.stub().returns({})},
141
147
  device: {
142
148
  deviceType: 'FAKE_DEVICE',
143
149
  register: sinon.stub().returns(Promise.resolve()),
@@ -235,6 +241,10 @@ describe('plugin-meetings', () => {
235
241
 
236
242
  webex.meetings.destroy(meeting, test1);
237
243
 
244
+ assert.calledOnceWithExactly(MeetingUtil.cleanUp, meeting, {
245
+ preserveVoiceaChannel: false,
246
+ });
247
+
238
248
  // and it should still return the information after the meeting is destroyed
239
249
  assert.equal(
240
250
  webex.meetings.getBasicMeetingInformation(meetingIds.meetingId).id,
@@ -355,32 +365,6 @@ describe('plugin-meetings', () => {
355
365
  });
356
366
  });
357
367
 
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
368
  describe('#_toggleIpv6BackendNativeSupport', () => {
385
369
  it('should have _toggleIpv6BackendNativeSupport', () => {
386
370
  assert.equal(typeof webex.meetings._toggleIpv6BackendNativeSupport, 'function');
@@ -423,6 +407,33 @@ describe('plugin-meetings', () => {
423
407
  });
424
408
  });
425
409
 
410
+ describe('#_toggleEnableAv1SlidesSupport', () => {
411
+ it('should have _toggleEnableAv1SlidesSupport', () => {
412
+ assert.equal(typeof webex.meetings._toggleEnableAv1SlidesSupport, 'function');
413
+ });
414
+
415
+ describe('success', () => {
416
+ it('should update meetings config to enable AV1 slides support', () => {
417
+ webex.meetings._toggleEnableAv1SlidesSupport(true);
418
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
419
+
420
+ webex.meetings._toggleEnableAv1SlidesSupport(false);
421
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, false);
422
+ });
423
+
424
+ it('should not update config when called with a non-boolean value', () => {
425
+ webex.meetings._toggleEnableAv1SlidesSupport(true);
426
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
427
+
428
+ webex.meetings._toggleEnableAv1SlidesSupport('invalid');
429
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
430
+
431
+ webex.meetings._toggleEnableAv1SlidesSupport(undefined);
432
+ assert.equal(webex.meetings.config.enableAv1SlidesSupport, true);
433
+ });
434
+ });
435
+ });
436
+
426
437
  describe('#_toggleStopIceGatheringAfterFirstRelayCandidate', () => {
427
438
  it('should have _toggleStopIceGatheringAfterFirstRelayCandidate', () => {
428
439
  assert.equal(
@@ -1267,14 +1278,16 @@ describe('plugin-meetings', () => {
1267
1278
  });
1268
1279
 
1269
1280
  it('creates noise reduction effect with BNR model', async () => {
1270
- const result = await webex.meetings.createNoiseReductionEffect({audioContext: {}});
1281
+ const result = await webex.meetings.createNoiseReductionEffect({
1282
+ audioContext: {addEventListener: sinon.stub()},
1283
+ });
1271
1284
 
1272
1285
  assert.exists(result);
1273
1286
  assert.instanceOf(result, NoiseReductionEffect);
1274
1287
  assert.containsAllKeys(result, ['audioContext', 'isEnabled', 'isReady', 'options']);
1275
1288
  assert.equal(result.options.authToken, 'fake_token');
1276
1289
  assert.deepEqual(result.options, {
1277
- audioContext: {},
1290
+ audioContext: {addEventListener: result.options.audioContext.addEventListener},
1278
1291
  authToken: 'fake_token',
1279
1292
  mode: 'WORKLET',
1280
1293
  avoidSimd: false,
@@ -1287,7 +1300,7 @@ describe('plugin-meetings', () => {
1287
1300
 
1288
1301
  it('creates noise reduction effect with OFMV model', async () => {
1289
1302
  const result = await webex.meetings.createNoiseReductionEffect({
1290
- audioContext: {},
1303
+ audioContext: {addEventListener: sinon.stub()},
1291
1304
  model: 'ofmv',
1292
1305
  });
1293
1306
 
@@ -1296,7 +1309,7 @@ describe('plugin-meetings', () => {
1296
1309
  assert.containsAllKeys(result, ['audioContext', 'isEnabled', 'isReady', 'options']);
1297
1310
  assert.equal(result.options.authToken, 'fake_token');
1298
1311
  assert.deepEqual(result.options, {
1299
- audioContext: {},
1312
+ audioContext: {addEventListener: result.options.audioContext.addEventListener},
1300
1313
  authToken: 'fake_token',
1301
1314
  mode: 'WORKLET',
1302
1315
  avoidSimd: false,
@@ -1309,7 +1322,7 @@ describe('plugin-meetings', () => {
1309
1322
 
1310
1323
  it('passes custom options to noise reduction effect', async () => {
1311
1324
  const result = await webex.meetings.createNoiseReductionEffect({
1312
- audioContext: {},
1325
+ audioContext: {addEventListener: sinon.stub()},
1313
1326
  mode: 'LEGACY',
1314
1327
  env: 'int',
1315
1328
  avoidSimd: true,
@@ -1355,6 +1368,87 @@ describe('plugin-meetings', () => {
1355
1368
  );
1356
1369
  });
1357
1370
  });
1371
+ describe('#fetchSitePreferencesMeViaSite', () => {
1372
+ const sitePreferencesResponse = {
1373
+ scheduling: {
1374
+ supportScheduleWebinar: true,
1375
+ webinarWebLink: 'https://go.webex.com/webappng/sites/go/webinar/scheduler',
1376
+ },
1377
+ };
1378
+
1379
+ beforeEach(() => {
1380
+ webex.meetings.request.fetchSitePreferencesMeViaSite = sinon
1381
+ .stub()
1382
+ .resolves(sitePreferencesResponse);
1383
+ });
1384
+
1385
+ it('should have #fetchSitePreferencesMeViaSite', () => {
1386
+ assert.exists(webex.meetings.fetchSitePreferencesMeViaSite);
1387
+ });
1388
+
1389
+ it('fetches scheduling preferences for the preferred Webex site by default', async () => {
1390
+ webex.meetings.preferredWebexSite = 'go.webex.com';
1391
+
1392
+ const result = await webex.meetings.fetchSitePreferencesMeViaSite();
1393
+
1394
+ assert.deepEqual(result, sitePreferencesResponse);
1395
+ assert.calledOnceWithExactly(
1396
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1397
+ {
1398
+ siteUrl: 'go.webex.com',
1399
+ }
1400
+ );
1401
+ });
1402
+
1403
+ it('uses the provided Webex site instead of the preferred Webex site', async () => {
1404
+ webex.meetings.preferredWebexSite = 'preferred.webex.com';
1405
+
1406
+ await webex.meetings.fetchSitePreferencesMeViaSite({siteUrl: 'go.webex.com'});
1407
+
1408
+ assert.calledOnceWithExactly(
1409
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1410
+ {
1411
+ siteUrl: 'go.webex.com',
1412
+ }
1413
+ );
1414
+ });
1415
+
1416
+ it('forwards custom site name and preference sections to the request helper', async () => {
1417
+ webex.meetings.preferredWebexSite = 'go.webex.com';
1418
+
1419
+ await webex.meetings.fetchSitePreferencesMeViaSite({
1420
+ siteName: 'custom-site',
1421
+ selectOptions: [SitePreferenceSelectOption.SCHEDULING],
1422
+ });
1423
+
1424
+ assert.calledOnceWithExactly(
1425
+ webex.meetings.request.fetchSitePreferencesMeViaSite,
1426
+ {
1427
+ siteUrl: 'go.webex.com',
1428
+ siteName: 'custom-site',
1429
+ selectOptions: [SitePreferenceSelectOption.SCHEDULING],
1430
+ }
1431
+ );
1432
+ });
1433
+
1434
+ it('throws when no Webex site is available', () => {
1435
+ webex.meetings.preferredWebexSite = '';
1436
+ webex.meetings.request.fetchSitePreferencesMeViaSite.throws(
1437
+ new ParameterError(
1438
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
1439
+ )
1440
+ );
1441
+
1442
+ assert.throws(
1443
+ () => webex.meetings.fetchSitePreferencesMeViaSite(),
1444
+ ParameterError,
1445
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
1446
+ );
1447
+ assert.calledOnceWithExactly(webex.meetings.request.fetchSitePreferencesMeViaSite, {
1448
+ siteUrl: '',
1449
+ });
1450
+ });
1451
+ });
1358
1452
  describe('Static shortcut proxy methods', () => {
1359
1453
  describe('MeetingCollection getByKey proxies', () => {
1360
1454
  beforeEach(() => {
@@ -1391,7 +1485,7 @@ describe('plugin-meetings', () => {
1391
1485
  it('should have #syncMeetings', () => {
1392
1486
  assert.exists(webex.meetings.syncMeetings);
1393
1487
  });
1394
- it('should do nothing and return a resolved promise if unverified guest', async () => {
1488
+ it('should skip getActiveMeetings but still sync each meeting with canSyncClassicLocus enabled if unverified guest', async () => {
1395
1489
  webex.meetings.request.getActiveMeetings = sinon.stub().returns(
1396
1490
  Promise.resolve({
1397
1491
  loci: [
@@ -1404,13 +1498,27 @@ describe('plugin-meetings', () => {
1404
1498
  webex.credentials.isUnverifiedGuest = true;
1405
1499
  LoggerProxy.logger.info = sinon.stub();
1406
1500
 
1501
+ const mockLocusInfo = {
1502
+ sync: sinon.stub().resolves(),
1503
+ };
1504
+ const meeting1 = {locusInfo: mockLocusInfo};
1505
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1506
+ meeting1,
1507
+ meeting2: {locusInfo: undefined},
1508
+ meeting3: {},
1509
+ });
1510
+
1407
1511
  await webex.meetings.syncMeetings();
1408
1512
 
1409
1513
  assert.notCalled(webex.meetings.request.getActiveMeetings);
1410
1514
  assert.calledWith(
1411
1515
  LoggerProxy.logger.info,
1412
- 'Meetings:index#syncMeetings --> skipping meeting sync as unverified guest'
1516
+ 'Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync'
1413
1517
  );
1518
+ assert.calledOnceWithExactly(mockLocusInfo.sync, meeting1, {
1519
+ canSyncClassicLocus: true,
1520
+ canSyncHashTree: true,
1521
+ });
1414
1522
  });
1415
1523
  describe('succesful requests', () => {
1416
1524
  beforeEach(() => {
@@ -1429,6 +1537,9 @@ describe('plugin-meetings', () => {
1429
1537
  webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
1430
1538
  locusInfo,
1431
1539
  });
1540
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1541
+ meeting1: {locusInfo, locusUrl: url1},
1542
+ });
1432
1543
  });
1433
1544
  it('tests the sync meeting calls for existing meeting', async () => {
1434
1545
  await webex.meetings.syncMeetings();
@@ -1436,6 +1547,11 @@ describe('plugin-meetings', () => {
1436
1547
  assert.calledOnce(webex.meetings.meetingCollection.getByKey);
1437
1548
  assert.calledOnce(locusInfo.parse);
1438
1549
  assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
1550
+ assert.calledOnceWithExactly(
1551
+ locusInfo.sync,
1552
+ {locusInfo, locusUrl: url1},
1553
+ {canSyncClassicLocus: false, canSyncHashTree: true}
1554
+ );
1439
1555
  });
1440
1556
  });
1441
1557
  describe('when meeting is not returned', () => {
@@ -1474,7 +1590,7 @@ describe('plugin-meetings', () => {
1474
1590
  url: url1,
1475
1591
  },
1476
1592
  hashTreeMessage: undefined,
1477
- });
1593
+ }, sinon.match.func);
1478
1594
  });
1479
1595
  });
1480
1596
  describe('when destroying meeting is needed', () => {
@@ -1520,7 +1636,7 @@ describe('plugin-meetings', () => {
1520
1636
  it('destroy any meeting that has no active locus url if keepOnlyLocusMeetings is not defined', async () => {
1521
1637
  await webex.meetings.syncMeetings();
1522
1638
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1523
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1639
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1524
1640
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1525
1641
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting1);
1526
1642
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting2);
@@ -1532,7 +1648,7 @@ describe('plugin-meetings', () => {
1532
1648
  it('destroy any meeting that has no active locus url if keepOnlyLocusMeetings === true', async () => {
1533
1649
  await webex.meetings.syncMeetings({keepOnlyLocusMeetings: true});
1534
1650
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1535
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1651
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1536
1652
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1537
1653
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting1);
1538
1654
  assert.calledWith(destroySpy, meetingCollectionMeetings.otherNonLocusMeeting2);
@@ -1544,7 +1660,7 @@ describe('plugin-meetings', () => {
1544
1660
  it('destroy any LOCUS meetings that have no active locus url if keepOnlyLocusMeetings === false', async () => {
1545
1661
  await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1546
1662
  assert.calledOnce(webex.meetings.request.getActiveMeetings);
1547
- assert.calledOnce(webex.meetings.meetingCollection.getAll);
1663
+ assert.calledTwice(webex.meetings.meetingCollection.getAll);
1548
1664
  assert.calledWith(destroySpy, meetingCollectionMeetings.noLongerValidLocusMeeting);
1549
1665
  assert.callCount(destroySpy, 1);
1550
1666
 
@@ -1552,6 +1668,164 @@ describe('plugin-meetings', () => {
1552
1668
  });
1553
1669
  });
1554
1670
  });
1671
+
1672
+ describe('when globalMeetingId preserves breakout meetings', () => {
1673
+ let destroySpy;
1674
+ let cleanUpSpy;
1675
+
1676
+ beforeEach(() => {
1677
+ destroySpy = sinon.spy(webex.meetings, 'destroy');
1678
+ cleanUpSpy = sinon.stub(MeetingUtil, 'cleanUp').returns(Promise.resolve());
1679
+ });
1680
+
1681
+ afterEach(() => {
1682
+ cleanUpSpy.restore();
1683
+ });
1684
+
1685
+ it('should not destroy a meeting whose globalMeetingId matches an active locus', async () => {
1686
+ const meetingCollectionMeetings = {
1687
+ breakoutMeeting: {
1688
+ locusUrl: 'breakout-url',
1689
+ locusInfo: {
1690
+ info: {globalMeetingId: 'gmid-123'},
1691
+ sync: sinon.stub().resolves(),
1692
+ },
1693
+ sendCallAnalyzerMetrics: sinon.stub(),
1694
+ },
1695
+ };
1696
+
1697
+ webex.meetings.meetingCollection.getAll = sinon
1698
+ .stub()
1699
+ .returns(meetingCollectionMeetings);
1700
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1701
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1702
+ });
1703
+
1704
+ await webex.meetings.syncMeetings();
1705
+
1706
+ assert.notCalled(destroySpy);
1707
+ });
1708
+
1709
+ it('should destroy a meeting whose globalMeetingId does NOT match any active locus', async () => {
1710
+ const meetingCollectionMeetings = {
1711
+ breakoutMeeting: {
1712
+ locusUrl: 'breakout-url',
1713
+ locusInfo: {
1714
+ info: {globalMeetingId: 'gmid-other'},
1715
+ sync: sinon.stub().resolves(),
1716
+ cleanUp: sinon.stub(),
1717
+ },
1718
+ sendCallAnalyzerMetrics: sinon.stub(),
1719
+ },
1720
+ };
1721
+
1722
+ webex.meetings.meetingCollection.getAll = sinon
1723
+ .stub()
1724
+ .returns(meetingCollectionMeetings);
1725
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({
1726
+ loci: [{url: 'main-url', info: {globalMeetingId: 'gmid-123'}}],
1727
+ });
1728
+
1729
+ await webex.meetings.syncMeetings();
1730
+
1731
+ assert.calledOnce(destroySpy);
1732
+ assert.calledWith(destroySpy, meetingCollectionMeetings.breakoutMeeting);
1733
+ });
1734
+ });
1735
+
1736
+ describe('skipHashTreeSync parameter', () => {
1737
+ it('should pass canSyncHashTree:false to locusInfo.sync when skipHashTreeSync is true', async () => {
1738
+ const mockLocusInfo = {
1739
+ sync: sinon.stub().resolves(),
1740
+ };
1741
+ const meeting1 = {locusInfo: mockLocusInfo};
1742
+
1743
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1744
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1745
+ meeting1,
1746
+ });
1747
+
1748
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: true});
1749
+
1750
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1751
+ assert.calledOnceWithExactly(mockLocusInfo.sync, meeting1, {
1752
+ canSyncClassicLocus: false,
1753
+ canSyncHashTree: false,
1754
+ });
1755
+ });
1756
+
1757
+ it('should pass canSyncHashTree:true to locusInfo.sync when skipHashTreeSync is false (default)', async () => {
1758
+ const mockLocusInfo = {
1759
+ sync: sinon.stub().resolves(),
1760
+ };
1761
+ const meeting1 = {locusInfo: mockLocusInfo};
1762
+
1763
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1764
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1765
+ meeting1,
1766
+ });
1767
+
1768
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: false});
1769
+
1770
+ assert.calledOnce(webex.meetings.request.getActiveMeetings);
1771
+ assert.calledOnceWithExactly(mockLocusInfo.sync, meeting1, {
1772
+ canSyncClassicLocus: false,
1773
+ canSyncHashTree: true,
1774
+ });
1775
+ });
1776
+ });
1777
+
1778
+ describe('per-meeting sync in syncMeetings', () => {
1779
+ it('should call locusInfo.sync for multiple meetings, skipping those without locusInfo', async () => {
1780
+ const mockLocusInfo1 = {
1781
+ sync: sinon.stub().resolves(),
1782
+ };
1783
+ const mockLocusInfo2 = {
1784
+ sync: sinon.stub().resolves(),
1785
+ };
1786
+
1787
+ webex.meetings.request.getActiveMeetings = sinon.stub().resolves({loci: []});
1788
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1789
+ meeting1: {locusInfo: mockLocusInfo1},
1790
+ meeting2: {locusInfo: undefined},
1791
+ meeting3: {locusInfo: mockLocusInfo2},
1792
+ meeting4: {},
1793
+ });
1794
+
1795
+ await webex.meetings.syncMeetings({keepOnlyLocusMeetings: false});
1796
+
1797
+ assert.calledOnceWithExactly(
1798
+ mockLocusInfo1.sync,
1799
+ {locusInfo: mockLocusInfo1},
1800
+ {canSyncClassicLocus: false, canSyncHashTree: true}
1801
+ );
1802
+ assert.calledOnceWithExactly(
1803
+ mockLocusInfo2.sync,
1804
+ {locusInfo: mockLocusInfo2},
1805
+ {canSyncClassicLocus: false, canSyncHashTree: true}
1806
+ );
1807
+ });
1808
+
1809
+ it('should not call locusInfo.sync when getActiveMeetings throws an error', async () => {
1810
+ const mockLocusInfo = {
1811
+ sync: sinon.stub().resolves(),
1812
+ };
1813
+
1814
+ webex.meetings.request.getActiveMeetings = sinon.stub().rejects(new Error('network error'));
1815
+ webex.meetings.meetingCollection.getAll = sinon.stub().returns({
1816
+ meeting1: {locusInfo: mockLocusInfo},
1817
+ });
1818
+
1819
+ try {
1820
+ await webex.meetings.syncMeetings();
1821
+ assert.fail('should have thrown');
1822
+ } catch (err) {
1823
+ assert.equal(err.message, 'network error');
1824
+ }
1825
+
1826
+ assert.notCalled(mockLocusInfo.sync);
1827
+ });
1828
+ });
1555
1829
  });
1556
1830
  describe('#fetchStaticMeetingLink', () => {
1557
1831
  const conversationUrl = 'conv.fakeconversationurl.com';
@@ -1635,6 +1909,141 @@ describe('plugin-meetings', () => {
1635
1909
  );
1636
1910
  });
1637
1911
 
1912
+ describe('wasm runtime performance telemetry', () => {
1913
+ const correlationId = 'wasm-corr-id';
1914
+ const benchmarkMeasurements = {
1915
+ divRatio: 1.888,
1916
+ sqrtRatio: 3.474,
1917
+ addNsPerOp: 2.006,
1918
+ addMedianMs: 32.1,
1919
+ divMedianMs: 60.6,
1920
+ sqrtMedianMs: 111.5,
1921
+ };
1922
+ const probeResult = {
1923
+ status: 'slow',
1924
+ capability: 'not capable',
1925
+ reason: null,
1926
+ measurements: benchmarkMeasurements,
1927
+ };
1928
+ const expectedMetricFields = {
1929
+ status: probeResult.status,
1930
+ capability: probeResult.capability,
1931
+ reason: probeResult.reason,
1932
+ ...benchmarkMeasurements,
1933
+ correlation_id: correlationId,
1934
+ };
1935
+ let metricsSpy;
1936
+ let probeCheckStub;
1937
+
1938
+ beforeEach(() => {
1939
+ webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves({});
1940
+ webex.meetings.createMeeting = sinon
1941
+ .stub()
1942
+ .returns(Promise.resolve({on: () => true, correlationId}));
1943
+ probeCheckStub = sinon.stub(WasmRuntimeProbe, 'check').resolves(probeResult);
1944
+ metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
1945
+ });
1946
+
1947
+ afterEach(() => {
1948
+ probeCheckStub.restore();
1949
+ metricsSpy.restore();
1950
+ });
1951
+
1952
+ it('emits js_sdk_wasm_runtime_performance once after a meeting is created', async () => {
1953
+ await webex.meetings.create(test1, test2);
1954
+ await testUtils.flushPromises();
1955
+
1956
+ assert.calledOnceWithExactly(probeCheckStub);
1957
+ assert.calledOnceWithExactly(
1958
+ metricsSpy,
1959
+ 'js_sdk_wasm_runtime_performance',
1960
+ expectedMetricFields
1961
+ );
1962
+ });
1963
+
1964
+ it('logs the WASM runtime status after a meeting is created', async () => {
1965
+ const loggerLogStub = sinon.stub(LoggerProxy.logger, 'log');
1966
+
1967
+ await webex.meetings.create(test1, test2);
1968
+ await testUtils.flushPromises();
1969
+
1970
+ assert.calledOnceWithExactly(probeCheckStub);
1971
+ assert.calledOnceWithExactly(
1972
+ loggerLogStub,
1973
+ sinon.match(
1974
+ /Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status/
1975
+ )
1976
+ );
1977
+ loggerLogStub.restore();
1978
+ });
1979
+
1980
+ it('emits only once even when create() is called multiple times', async () => {
1981
+ await webex.meetings.create(test1, test2);
1982
+ await webex.meetings.create(test1, test2);
1983
+ await testUtils.flushPromises();
1984
+
1985
+ assert.calledOnceWithExactly(probeCheckStub);
1986
+ assert.calledOnceWithExactly(
1987
+ metricsSpy,
1988
+ 'js_sdk_wasm_runtime_performance',
1989
+ expectedMetricFields
1990
+ );
1991
+ });
1992
+
1993
+ it('emits the reason with null measurement fields when no measurements are available', async () => {
1994
+ probeCheckStub.resolves({
1995
+ status: 'unknown',
1996
+ capability: 'unknown',
1997
+ reason: 'worker_timeout',
1998
+ measurements: null,
1999
+ });
2000
+
2001
+ await webex.meetings.create(test1, test2);
2002
+ await testUtils.flushPromises();
2003
+
2004
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
2005
+ status: 'unknown',
2006
+ capability: 'unknown',
2007
+ reason: 'worker_timeout',
2008
+ divRatio: null,
2009
+ sqrtRatio: null,
2010
+ addNsPerOp: null,
2011
+ addMedianMs: null,
2012
+ divMedianMs: null,
2013
+ sqrtMedianMs: null,
2014
+ correlation_id: correlationId,
2015
+ });
2016
+ });
2017
+
2018
+ it('still resolves the meeting when the probe fails', async () => {
2019
+ const loggerErrorStub = sinon.stub(LoggerProxy.logger, 'error');
2020
+ probeCheckStub.rejects(new Error('probe failed'));
2021
+
2022
+ const created = await webex.meetings.create(test1, test2);
2023
+ await testUtils.flushPromises();
2024
+
2025
+ assert.equal(created.correlationId, correlationId);
2026
+ assert.notCalled(metricsSpy);
2027
+ assert.calledOnceWithExactly(
2028
+ loggerErrorStub,
2029
+ sinon.match(/Meetings:index#emitWasmRuntimePerformance --> ERROR/)
2030
+ );
2031
+ loggerErrorStub.restore();
2032
+ });
2033
+
2034
+ it('does not re-run the probe when create() returns an already-created meeting', async () => {
2035
+ webex.meetings.meetingCollection.getByKey = sinon
2036
+ .stub()
2037
+ .returns({updateCallStateForMetrics: sinon.stub()});
2038
+
2039
+ await webex.meetings.create(test1, test2);
2040
+ await testUtils.flushPromises();
2041
+
2042
+ assert.notCalled(probeCheckStub);
2043
+ assert.notCalled(metricsSpy);
2044
+ });
2045
+ });
2046
+
1638
2047
  it('should call MeetingInfo#fetchInfoOptions() with proper params', () => {
1639
2048
  webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves(infoOptions);
1640
2049
 
@@ -1878,6 +2287,28 @@ describe('plugin-meetings', () => {
1878
2287
  assert.calledWith(webex.internal.mercury.on, OFFLINE);
1879
2288
  assert.callCount(webex.internal.mercury.on, 4);
1880
2289
  });
2290
+
2291
+ it('handles a rejected syncMeetings when the ONLINE event fires so it does not become an unhandled rejection', async () => {
2292
+ const syncError = new Error('sync failed');
2293
+ sinon.stub(webex.meetings, 'syncMeetings').rejects(syncError);
2294
+ const loggerWarnStub = sinon.stub(LoggerProxy.logger, 'warn');
2295
+
2296
+ webex.meetings.listenForEvents();
2297
+
2298
+ const onlineCallback = webex.internal.mercury.on
2299
+ .getCalls()
2300
+ .find((call) => call.args[0] === ONLINE).args[1];
2301
+
2302
+ // invoking the listener must not throw synchronously nor leave a rejection unhandled
2303
+ onlineCallback();
2304
+
2305
+ assert.calledOnceWithExactly(webex.meetings.syncMeetings, {keepOnlyLocusMeetings: false});
2306
+
2307
+ await testUtils.flushPromises();
2308
+
2309
+ assert.calledOnce(loggerWarnStub);
2310
+ assert.include(loggerWarnStub.firstCall.args[0], 'syncMeetings after ONLINE event failed');
2311
+ });
1881
2312
  });
1882
2313
  describe('#handleLocusMercury', () => {
1883
2314
  beforeEach(() => {
@@ -2015,7 +2446,7 @@ describe('plugin-meetings', () => {
2015
2446
  },
2016
2447
  },
2017
2448
  hashTreeMessage: undefined,
2018
- });
2449
+ }, sinon.match.func);
2019
2450
  });
2020
2451
  it('should setup the meeting from a hash tree event', async () => {
2021
2452
  const selfData = {};
@@ -2049,7 +2480,7 @@ describe('plugin-meetings', () => {
2049
2480
  info: infoData,
2050
2481
  },
2051
2482
  hashTreeMessage,
2052
- });
2483
+ }, sinon.match.func);
2053
2484
  });
2054
2485
 
2055
2486
  it('should ignore hash tree event when created locus has INACTIVE fullState', async () => {
@@ -2129,7 +2560,7 @@ describe('plugin-meetings', () => {
2129
2560
  },
2130
2561
  },
2131
2562
  hashTreeMessage: undefined,
2132
- });
2563
+ }, sinon.match.func);
2133
2564
  });
2134
2565
 
2135
2566
  it('sends client event correctly on finally', async () => {
@@ -2205,7 +2636,7 @@ describe('plugin-meetings', () => {
2205
2636
  },
2206
2637
  },
2207
2638
  hashTreeMessage: undefined,
2208
- });
2639
+ }, sinon.match.func);
2209
2640
  });
2210
2641
 
2211
2642
  const generateFakeLocusData = (isUnifiedSpaceMeeting) => ({
@@ -2337,7 +2768,11 @@ describe('plugin-meetings', () => {
2337
2768
  undefined,
2338
2769
  undefined,
2339
2770
  extraParams,
2340
- {meetingId: meeting.id, sendCAevents}
2771
+ {
2772
+ meetingId: meeting.id,
2773
+ sendCAevents,
2774
+ correlationId: meeting.correlationId,
2775
+ }
2341
2776
  );
2342
2777
  }
2343
2778
 
@@ -2880,6 +3315,30 @@ describe('plugin-meetings', () => {
2880
3315
 
2881
3316
  assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
2882
3317
  });
3318
+
3319
+ [
3320
+ {fullStateType: 'CALL'},
3321
+ {fullStateType: 'SIP_BRIDGE'},
3322
+ {fullStateType: 'SPACE_SHARE'},
3323
+ ].forEach(({fullStateType}) => {
3324
+ it(`skips meeting info fetch when LOCUS_ID destination is a 1:1 call (fullState.type ${fullStateType})`, async () => {
3325
+ const locusDestination = {
3326
+ fullState: {type: fullStateType},
3327
+ };
3328
+
3329
+ const meeting = await webex.meetings.createMeeting(
3330
+ locusDestination,
3331
+ DESTINATION_TYPE.LOCUS_ID
3332
+ );
3333
+
3334
+ assert.instanceOf(
3335
+ meeting,
3336
+ Meeting,
3337
+ 'createMeeting should eventually resolve to a Meeting Object'
3338
+ );
3339
+ assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
3340
+ });
3341
+ });
2883
3342
  });
2884
3343
 
2885
3344
  describe('rejected MeetingInfo.#fetchMeetingInfo - does not log for known Error types', () => {
@@ -3010,6 +3469,16 @@ describe('plugin-meetings', () => {
3010
3469
  assert.equal(deletedMeetingInfo.roles, meetingIds.roles);
3011
3470
  assert.equal(deletedMeetingInfo.callStateForMetrics, meetingIds.callStateForMetrics);
3012
3471
  });
3472
+
3473
+ it('cleans up locusInfo (tearing down hash tree parsers) when destroying the meeting', async () => {
3474
+ const meeting = await webex.meetings.createMeeting('test', 'test');
3475
+ const locusInfoCleanUpSpy = sinon.spy(meeting.locusInfo, 'cleanUp');
3476
+
3477
+ webex.meetings.destroy(meeting, test1);
3478
+
3479
+ // hash tree parser teardown is deferred from MeetingUtil.cleanUp to Meetings#destroy
3480
+ assert.calledOnce(locusInfoCleanUpSpy);
3481
+ });
3013
3482
  });
3014
3483
 
3015
3484
  describe('with auto upload logs enabled', () => {
@@ -3119,7 +3588,7 @@ describe('plugin-meetings', () => {
3119
3588
  loggerProxySpy,
3120
3589
  'Failed to fetch preferred site from user - no site will be set'
3121
3590
  );
3122
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3591
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3123
3592
  });
3124
3593
 
3125
3594
  it('should fall back to fetching the site from the user', async () => {
@@ -3137,7 +3606,6 @@ describe('plugin-meetings', () => {
3137
3606
 
3138
3607
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3139
3608
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3140
- '',
3141
3609
  'site.webex.com',
3142
3610
  ]);
3143
3611
  assert.notCalled(loggerProxySpy);
@@ -3161,7 +3629,7 @@ describe('plugin-meetings', () => {
3161
3629
  loggerProxySpy,
3162
3630
  'Failed to fetch preferred site from user - no site will be set'
3163
3631
  );
3164
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3632
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3165
3633
  });
3166
3634
  }
3167
3635
  );
@@ -3178,7 +3646,7 @@ describe('plugin-meetings', () => {
3178
3646
  loggerProxySpy,
3179
3647
  'Failed to fetch preferred site from user - no site will be set'
3180
3648
  );
3181
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3649
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3182
3650
  });
3183
3651
 
3184
3652
  it('should fall back to fetching the site from the user', async () => {
@@ -3197,7 +3665,6 @@ describe('plugin-meetings', () => {
3197
3665
  assert.equal(webex.meetings.preferredWebexSite, 'site.webex.com');
3198
3666
  assert.notCalled(loggerProxySpy);
3199
3667
  assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), [
3200
- '',
3201
3668
  'site.webex.com',
3202
3669
  ]);
3203
3670
  });
@@ -3220,7 +3687,7 @@ describe('plugin-meetings', () => {
3220
3687
  loggerProxySpy,
3221
3688
  'Failed to fetch preferred site from user - no site will be set'
3222
3689
  );
3223
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3690
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3224
3691
  });
3225
3692
  }
3226
3693
  );
@@ -3237,7 +3704,7 @@ describe('plugin-meetings', () => {
3237
3704
  loggerProxySpy,
3238
3705
  'Failed to fetch preferred site from user - no site will be set'
3239
3706
  );
3240
- assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), ['']);
3707
+ assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
3241
3708
  });
3242
3709
  });
3243
3710
  });
@@ -3303,10 +3770,13 @@ describe('plugin-meetings', () => {
3303
3770
  };
3304
3771
 
3305
3772
  it('triggers correct event when SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE emitted', async () => {
3773
+ sinon.stub(meeting, 'updateMeetingActions');
3306
3774
  checkSelfTrigger(
3307
3775
  LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
3308
3776
  EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST
3309
3777
  );
3778
+ assert.calledOnce(meeting.updateMeetingActions);
3779
+ meeting.updateMeetingActions.restore();
3310
3780
  });
3311
3781
 
3312
3782
  it('triggers correct event when SELF_IS_SHARING_BLOCKED_CHANGE emitted', async () => {
@@ -3459,6 +3929,21 @@ describe('plugin-meetings', () => {
3459
3929
  'Meetings:index#isNeedHandleMainLocus --> self device left&moved in main locus with self joined status, not need to handle'
3460
3930
  );
3461
3931
  });
3932
+
3933
+ it('check breakout ended with self removed, return false', () => {
3934
+ webex.meetings.meetingCollection.getActiveBreakoutLocus = sinon.stub().returns(null);
3935
+ newLocus.self.state = 'LEFT';
3936
+ newLocus.self.reason = 'OTHER';
3937
+ newLocus.self.removed = true;
3938
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3939
+ LoggerProxy.logger.log = sinon.stub();
3940
+ const result = webex.meetings.isNeedHandleMainLocus(meeting, newLocus);
3941
+ assert.equal(result, false);
3942
+ assert.calledWith(
3943
+ LoggerProxy.logger.log,
3944
+ 'Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle'
3945
+ );
3946
+ });
3462
3947
  });
3463
3948
 
3464
3949
  describe('#isNeedHandleLocusDTO', () => {
@@ -3519,6 +4004,18 @@ describe('plugin-meetings', () => {
3519
4004
  const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3520
4005
  assert.equal(result, false);
3521
4006
  });
4007
+ it('breakout session with breakout ended, return false', () => {
4008
+ newLocus.controls.breakout = {
4009
+ sessionType: 'BREAKOUT',
4010
+ };
4011
+ newLocus.self.state = 'LEFT';
4012
+ newLocus.self.reason = 'OTHER';
4013
+ newLocus.self.devices = [];
4014
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
4015
+ LoggerProxy.logger.log = sinon.stub();
4016
+ const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
4017
+ assert.equal(result, false);
4018
+ });
3522
4019
  it('moved to lobby, return true', () => {
3523
4020
  newLocus.controls.breakout = {
3524
4021
  sessionType: 'MAIN',
@@ -3996,6 +4493,9 @@ describe('plugin-meetings', () => {
3996
4493
 
3997
4494
  triggerProxyStub.restore();
3998
4495
 
4496
+ // Never resolve, so the create()-triggered WASM emit can't reach the metrics spy below.
4497
+ sinon.stub(WasmRuntimeProbe, 'check').returns(new Promise(() => {}));
4498
+
3999
4499
  metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
4000
4500
 
4001
4501
  meeting = await webex.meetings.create('test');