@webex/plugin-meetings 3.12.0-next.10 → 3.12.0-next.101

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 (230) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +8 -3
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/index.js +26 -2
  7. package/dist/breakouts/index.js.map +1 -1
  8. package/dist/common/errors/webex-errors.js +49 -5
  9. package/dist/common/errors/webex-errors.js.map +1 -1
  10. package/dist/config.js +2 -2
  11. package/dist/config.js.map +1 -1
  12. package/dist/constants.js +35 -9
  13. package/dist/constants.js.map +1 -1
  14. package/dist/controls-options-manager/constants.js +11 -1
  15. package/dist/controls-options-manager/constants.js.map +1 -1
  16. package/dist/controls-options-manager/index.js +67 -29
  17. package/dist/controls-options-manager/index.js.map +1 -1
  18. package/dist/controls-options-manager/util.js +91 -0
  19. package/dist/controls-options-manager/util.js.map +1 -1
  20. package/dist/hashTree/constants.js +4 -1
  21. package/dist/hashTree/constants.js.map +1 -1
  22. package/dist/hashTree/hashTreeParser.js +880 -382
  23. package/dist/hashTree/hashTreeParser.js.map +1 -1
  24. package/dist/hashTree/utils.js +20 -0
  25. package/dist/hashTree/utils.js.map +1 -1
  26. package/dist/index.js +7 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  29. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  30. package/dist/interceptors/locusRetry.js +23 -8
  31. package/dist/interceptors/locusRetry.js.map +1 -1
  32. package/dist/interpretation/index.js +10 -1
  33. package/dist/interpretation/index.js.map +1 -1
  34. package/dist/interpretation/interpretation.types.js +7 -0
  35. package/dist/interpretation/interpretation.types.js.map +1 -0
  36. package/dist/interpretation/siLanguage.js +1 -1
  37. package/dist/locus-info/controlsUtils.js +4 -1
  38. package/dist/locus-info/controlsUtils.js.map +1 -1
  39. package/dist/locus-info/index.js +401 -115
  40. package/dist/locus-info/index.js.map +1 -1
  41. package/dist/locus-info/infoUtils.js +36 -5
  42. package/dist/locus-info/infoUtils.js.map +1 -1
  43. package/dist/locus-info/types.js +19 -0
  44. package/dist/locus-info/types.js.map +1 -1
  45. package/dist/media/MediaConnectionAwaiter.js +15 -2
  46. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  47. package/dist/media/index.js +8 -2
  48. package/dist/media/index.js.map +1 -1
  49. package/dist/media/properties.js +1 -0
  50. package/dist/media/properties.js.map +1 -1
  51. package/dist/meeting/in-meeting-actions.js +5 -1
  52. package/dist/meeting/in-meeting-actions.js.map +1 -1
  53. package/dist/meeting/index.js +1389 -821
  54. package/dist/meeting/index.js.map +1 -1
  55. package/dist/meeting/locusMediaRequest.js +229 -82
  56. package/dist/meeting/locusMediaRequest.js.map +1 -1
  57. package/dist/meeting/muteState.js +10 -1
  58. package/dist/meeting/muteState.js.map +1 -1
  59. package/dist/meeting/request.js +5 -2
  60. package/dist/meeting/request.js.map +1 -1
  61. package/dist/meeting/util.js +35 -2
  62. package/dist/meeting/util.js.map +1 -1
  63. package/dist/meeting-info/meeting-info-v2.js +2 -2
  64. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  65. package/dist/meetings/index.js +231 -118
  66. package/dist/meetings/index.js.map +1 -1
  67. package/dist/meetings/meetings.types.js +6 -1
  68. package/dist/meetings/meetings.types.js.map +1 -1
  69. package/dist/meetings/request.js +39 -0
  70. package/dist/meetings/request.js.map +1 -1
  71. package/dist/meetings/util.js +116 -18
  72. package/dist/meetings/util.js.map +1 -1
  73. package/dist/member/index.js +10 -0
  74. package/dist/member/index.js.map +1 -1
  75. package/dist/member/types.js.map +1 -1
  76. package/dist/member/util.js +30 -0
  77. package/dist/member/util.js.map +1 -1
  78. package/dist/members/index.js +101 -43
  79. package/dist/members/index.js.map +1 -1
  80. package/dist/members/util.js +8 -1
  81. package/dist/members/util.js.map +1 -1
  82. package/dist/metrics/constants.js +6 -1
  83. package/dist/metrics/constants.js.map +1 -1
  84. package/dist/multistream/codec/constants.js +63 -0
  85. package/dist/multistream/codec/constants.js.map +1 -0
  86. package/dist/multistream/mediaRequestManager.js +62 -15
  87. package/dist/multistream/mediaRequestManager.js.map +1 -1
  88. package/dist/multistream/receiveSlot.js +9 -0
  89. package/dist/multistream/receiveSlot.js.map +1 -1
  90. package/dist/reachability/clusterReachability.js.map +1 -1
  91. package/dist/reachability/index.js +121 -83
  92. package/dist/reachability/index.js.map +1 -1
  93. package/dist/reachability/reachability.types.js +2 -0
  94. package/dist/reachability/reachability.types.js.map +1 -1
  95. package/dist/reachability/util.js +45 -0
  96. package/dist/reachability/util.js.map +1 -1
  97. package/dist/reactions/reactions.type.js.map +1 -1
  98. package/dist/recording-controller/index.js +1 -3
  99. package/dist/recording-controller/index.js.map +1 -1
  100. package/dist/roap/turnDiscovery.js +8 -1
  101. package/dist/roap/turnDiscovery.js.map +1 -1
  102. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  103. package/dist/types/config.d.ts +2 -2
  104. package/dist/types/constants.d.ts +12 -1
  105. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  106. package/dist/types/controls-options-manager/index.d.ts +16 -0
  107. package/dist/types/hashTree/constants.d.ts +1 -0
  108. package/dist/types/hashTree/hashTreeParser.d.ts +146 -17
  109. package/dist/types/hashTree/utils.d.ts +7 -0
  110. package/dist/types/index.d.ts +3 -0
  111. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  112. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  113. package/dist/types/locus-info/index.d.ts +59 -6
  114. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  115. package/dist/types/locus-info/types.d.ts +21 -1
  116. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  117. package/dist/types/media/properties.d.ts +1 -0
  118. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  119. package/dist/types/meeting/index.d.ts +121 -10
  120. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  121. package/dist/types/meeting/request.d.ts +1 -0
  122. package/dist/types/meeting/util.d.ts +9 -0
  123. package/dist/types/meetings/index.d.ts +30 -18
  124. package/dist/types/meetings/meetings.types.d.ts +15 -0
  125. package/dist/types/meetings/request.d.ts +14 -0
  126. package/dist/types/member/index.d.ts +1 -0
  127. package/dist/types/member/types.d.ts +1 -0
  128. package/dist/types/member/util.d.ts +9 -0
  129. package/dist/types/members/index.d.ts +15 -2
  130. package/dist/types/members/util.d.ts +1 -5
  131. package/dist/types/metrics/constants.d.ts +5 -0
  132. package/dist/types/multistream/codec/constants.d.ts +7 -0
  133. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  134. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  135. package/dist/types/reachability/index.d.ts +10 -3
  136. package/dist/types/reachability/reachability.types.d.ts +7 -0
  137. package/dist/types/reachability/util.d.ts +17 -0
  138. package/dist/types/reactions/reactions.type.d.ts +3 -0
  139. package/dist/webinar/index.js +305 -159
  140. package/dist/webinar/index.js.map +1 -1
  141. package/package.json +22 -22
  142. package/src/aiEnableRequest/index.ts +16 -0
  143. package/src/breakouts/breakout.ts +3 -1
  144. package/src/breakouts/index.ts +31 -0
  145. package/src/common/errors/webex-errors.ts +50 -3
  146. package/src/config.ts +2 -2
  147. package/src/constants.ts +20 -3
  148. package/src/controls-options-manager/constants.ts +14 -1
  149. package/src/controls-options-manager/index.ts +87 -28
  150. package/src/controls-options-manager/util.ts +81 -1
  151. package/src/hashTree/constants.ts +7 -0
  152. package/src/hashTree/hashTreeParser.ts +578 -193
  153. package/src/hashTree/utils.ts +19 -0
  154. package/src/index.ts +6 -0
  155. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  156. package/src/interceptors/locusRetry.ts +25 -4
  157. package/src/interpretation/index.ts +27 -9
  158. package/src/interpretation/interpretation.types.ts +11 -0
  159. package/src/locus-info/controlsUtils.ts +3 -1
  160. package/src/locus-info/index.ts +415 -136
  161. package/src/locus-info/infoUtils.ts +41 -6
  162. package/src/locus-info/types.ts +25 -1
  163. package/src/media/MediaConnectionAwaiter.ts +21 -4
  164. package/src/media/index.ts +10 -1
  165. package/src/media/properties.ts +1 -0
  166. package/src/meeting/in-meeting-actions.ts +8 -0
  167. package/src/meeting/index.ts +644 -98
  168. package/src/meeting/locusMediaRequest.ts +106 -6
  169. package/src/meeting/muteState.ts +10 -1
  170. package/src/meeting/request.ts +11 -0
  171. package/src/meeting/util.ts +47 -5
  172. package/src/meeting-info/meeting-info-v2.ts +4 -2
  173. package/src/meetings/index.ts +133 -78
  174. package/src/meetings/meetings.types.ts +19 -0
  175. package/src/meetings/request.ts +43 -0
  176. package/src/meetings/util.ts +117 -4
  177. package/src/member/index.ts +10 -0
  178. package/src/member/types.ts +1 -0
  179. package/src/member/util.ts +29 -0
  180. package/src/members/index.ts +70 -7
  181. package/src/members/util.ts +12 -4
  182. package/src/metrics/constants.ts +5 -0
  183. package/src/multistream/codec/constants.ts +58 -0
  184. package/src/multistream/mediaRequestManager.ts +119 -28
  185. package/src/multistream/receiveSlot.ts +18 -0
  186. package/src/reachability/clusterReachability.ts +3 -2
  187. package/src/reachability/index.ts +47 -16
  188. package/src/reachability/reachability.types.ts +11 -0
  189. package/src/reachability/util.ts +36 -0
  190. package/src/reactions/reactions.type.ts +3 -0
  191. package/src/recording-controller/index.ts +1 -2
  192. package/src/roap/turnDiscovery.ts +9 -1
  193. package/src/webinar/index.ts +214 -36
  194. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  195. package/test/unit/spec/breakouts/breakout.ts +9 -3
  196. package/test/unit/spec/breakouts/index.ts +49 -0
  197. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  198. package/test/unit/spec/controls-options-manager/index.js +244 -29
  199. package/test/unit/spec/controls-options-manager/util.js +165 -0
  200. package/test/unit/spec/hashTree/hashTreeParser.ts +1848 -318
  201. package/test/unit/spec/hashTree/utils.ts +37 -0
  202. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  203. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  204. package/test/unit/spec/interpretation/index.ts +26 -4
  205. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  206. package/test/unit/spec/locus-info/index.js +645 -80
  207. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  208. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  209. package/test/unit/spec/media/index.ts +92 -0
  210. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  211. package/test/unit/spec/meeting/index.js +2119 -98
  212. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  213. package/test/unit/spec/meeting/muteState.js +81 -0
  214. package/test/unit/spec/meeting/request.js +12 -0
  215. package/test/unit/spec/meeting/utils.js +157 -1
  216. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  217. package/test/unit/spec/meetings/index.js +363 -36
  218. package/test/unit/spec/meetings/request.js +141 -0
  219. package/test/unit/spec/meetings/utils.js +402 -51
  220. package/test/unit/spec/member/index.js +7 -0
  221. package/test/unit/spec/member/util.js +89 -0
  222. package/test/unit/spec/members/index.js +216 -0
  223. package/test/unit/spec/members/request.js +37 -1
  224. package/test/unit/spec/members/utils.js +63 -0
  225. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  226. package/test/unit/spec/reachability/index.ts +128 -46
  227. package/test/unit/spec/reachability/util.ts +31 -0
  228. package/test/unit/spec/recording-controller/index.js +9 -8
  229. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  230. package/test/unit/spec/webinar/index.ts +329 -28
@@ -13,6 +13,7 @@ import MediaSharesUtils from '@webex/plugin-meetings/src/locus-info//mediaShares
13
13
  import LocusDeltaParser from '@webex/plugin-meetings/src/locus-info/parser';
14
14
  import Metrics from '@webex/plugin-meetings/src/metrics';
15
15
  import * as HashTreeParserModule from '@webex/plugin-meetings/src/hashTree/hashTreeParser';
16
+ import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
16
17
 
17
18
  import {
18
19
  LOCUSINFO,
@@ -30,6 +31,7 @@ import {
30
31
 
31
32
  import {self, selfWithInactivity} from './selfConstant';
32
33
  import {MEETING_REMOVED_REASON} from '@webex/plugin-meetings/src/constants';
34
+ import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
33
35
  import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
34
36
 
35
37
  describe('plugin-meetings', () => {
@@ -220,6 +222,47 @@ describe('plugin-meetings', () => {
220
222
  assert.isTrue(locusInfo.emitChange);
221
223
  });
222
224
 
225
+ it('calls onLocusSynced callback passed as second argument with full locus from join response', async () => {
226
+ const syncedLocus = {url: 'http://locus-url.com', participants: []};
227
+ const onLocusSynced = sinon.stub();
228
+
229
+ await locusInfo.initialSetup(
230
+ {
231
+ trigger: 'join-response',
232
+ locus: syncedLocus,
233
+ },
234
+ onLocusSynced
235
+ );
236
+
237
+ assert.calledOnceWithExactly(onLocusSynced, syncedLocus);
238
+ });
239
+
240
+ it('swallows onLocusSynced callback errors and logs warn', async () => {
241
+ const syncedLocus = {url: 'http://locus-url.com', participants: []};
242
+ const callbackError = new Error('onLocusSynced failed');
243
+ const onLocusSynced = sinon.stub().throws(callbackError);
244
+ const loggerWarnStub = LoggerProxy.logger.warn?.isSinonProxy
245
+ ? LoggerProxy.logger.warn
246
+ : sinon.stub(LoggerProxy.logger, 'warn');
247
+
248
+ loggerWarnStub.resetHistory();
249
+
250
+ await locusInfo.initialSetup(
251
+ {
252
+ trigger: 'join-response',
253
+ locus: syncedLocus,
254
+ },
255
+ onLocusSynced
256
+ );
257
+
258
+ assert.calledOnceWithExactly(onLocusSynced, syncedLocus);
259
+ assert.calledOnce(loggerWarnStub);
260
+ assert.match(
261
+ loggerWarnStub.firstCall.args[0],
262
+ /Locus-info:index#initialSetup --> onLocusSynced callback failed/
263
+ );
264
+ });
265
+
223
266
  it('should initialize the hash tree parser correctly when triggered from a get loci response containing visible datasets', async () => {
224
267
  const visibleDataSets = ['dataset1', 'dataset2'];
225
268
  const locus = createLocusWithVisibleDataSets(visibleDataSets);
@@ -290,6 +333,7 @@ describe('plugin-meetings', () => {
290
333
  describe('should setup correct locusInfoUpdateCallback when creating HashTreeParser', () => {
291
334
  const OBJECTS_UPDATED = HashTreeParserModule.LocusInfoUpdateType.OBJECTS_UPDATED;
292
335
  const MEETING_ENDED = HashTreeParserModule.LocusInfoUpdateType.MEETING_ENDED;
336
+ const LOCUS_NOT_FOUND = HashTreeParserModule.LocusInfoUpdateType.LOCUS_NOT_FOUND;
293
337
 
294
338
  let locusInfoUpdateCallback;
295
339
  let onDeltaLocusStub;
@@ -413,7 +457,7 @@ describe('plugin-meetings', () => {
413
457
  };
414
458
 
415
459
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
416
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
460
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
417
461
  updatedObjects: [{htMeta: {elementId: {type: 'self'}}, data: newSelf}],
418
462
  });
419
463
 
@@ -440,7 +484,7 @@ describe('plugin-meetings', () => {
440
484
  locusInfo.info.isWebinar = true;
441
485
 
442
486
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
443
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
487
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
444
488
  updatedObjects: [{htMeta: {elementId: {type: 'self'}}, data: newSelf}],
445
489
  });
446
490
 
@@ -473,7 +517,7 @@ describe('plugin-meetings', () => {
473
517
  locusInfo.info.isWebinar = true;
474
518
 
475
519
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
476
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
520
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
477
521
  updatedObjects: [{htMeta: {elementId: {type: 'self'}}, data: newSelf}],
478
522
  });
479
523
 
@@ -501,7 +545,7 @@ describe('plugin-meetings', () => {
501
545
  };
502
546
 
503
547
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
504
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
548
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
505
549
  updatedObjects: [{htMeta: {elementId: {type: 'fullState'}}, data: newFullState}],
506
550
  });
507
551
 
@@ -519,7 +563,7 @@ describe('plugin-meetings', () => {
519
563
  };
520
564
 
521
565
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
522
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
566
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
523
567
  updatedObjects: [{htMeta: {elementId: {type: 'info'}}, data: newInfo}],
524
568
  });
525
569
 
@@ -537,7 +581,7 @@ describe('plugin-meetings', () => {
537
581
  };
538
582
 
539
583
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
540
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
584
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
541
585
  updatedObjects: [{htMeta: {elementId: {type: 'links'}}, data: newLinks}],
542
586
  });
543
587
 
@@ -557,7 +601,7 @@ describe('plugin-meetings', () => {
557
601
  };
558
602
 
559
603
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
560
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
604
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
561
605
  updatedObjects: [{htMeta: newLocusHtMeta, data: newLocus}],
562
606
  });
563
607
 
@@ -590,7 +634,7 @@ describe('plugin-meetings', () => {
590
634
  };
591
635
 
592
636
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
593
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
637
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
594
638
  updatedObjects: [
595
639
  {
596
640
  htMeta: newLocusHtMeta,
@@ -637,7 +681,7 @@ describe('plugin-meetings', () => {
637
681
  };
638
682
 
639
683
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
640
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
684
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
641
685
  updatedObjects: [
642
686
  // first, a removal of LOCUS object
643
687
  {htMeta: {elementId: {type: 'locus'}}, data: null},
@@ -671,7 +715,7 @@ describe('plugin-meetings', () => {
671
715
  const newLocusHtMeta = {elementId: {type: 'locus', version: 99}};
672
716
 
673
717
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
674
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
718
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
675
719
  updatedObjects: [
676
720
  // first, an update
677
721
  {htMeta: newLocusHtMeta, data: newLocus},
@@ -700,7 +744,7 @@ describe('plugin-meetings', () => {
700
744
  };
701
745
 
702
746
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
703
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
747
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
704
748
  updatedObjects: [
705
749
  // first, an update
706
750
  {htMeta: {elementId: {type: 'locus'}}, data: newLocus1},
@@ -730,7 +774,7 @@ describe('plugin-meetings', () => {
730
774
  };
731
775
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
732
776
  // with 1 participant added, 1 updated, and 1 removed
733
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
777
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
734
778
  updatedObjects: [
735
779
  {htMeta: {elementId: {type: 'participant', id: 'fake-ht-participant-1'}}, data: null},
736
780
  {
@@ -774,7 +818,7 @@ describe('plugin-meetings', () => {
774
818
  };
775
819
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
776
820
  // with 1 participant added, 1 updated, and 1 removed
777
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
821
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
778
822
  updatedObjects: [
779
823
  {htMeta: {elementId: {type: 'mediashare', id: 'fake-ht-mediaShare-1'}}, data: null},
780
824
  {
@@ -807,7 +851,7 @@ describe('plugin-meetings', () => {
807
851
  };
808
852
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
809
853
  // with 1 embedded app added, 1 updated, and 1 removed
810
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
854
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
811
855
  updatedObjects: [
812
856
  {htMeta: {elementId: {type: 'embeddedapp', id: 'fake-ht-embeddedApp-1'}}, data: null},
813
857
  {
@@ -844,7 +888,7 @@ describe('plugin-meetings', () => {
844
888
  };
845
889
 
846
890
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
847
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
891
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
848
892
  updatedObjects: [
849
893
  {
850
894
  htMeta: {elementId: {type: 'mediashare', id: 'fake-ht-mediaShare-2'}},
@@ -883,7 +927,7 @@ describe('plugin-meetings', () => {
883
927
  };
884
928
 
885
929
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
886
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
930
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
887
931
  updatedObjects: [
888
932
  {
889
933
  htMeta: {elementId: {type: 'controlentry', id: 'control-1'}},
@@ -911,7 +955,7 @@ describe('plugin-meetings', () => {
911
955
 
912
956
  it('should process locus update correctly when CONTROL object is received with no data', () => {
913
957
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
914
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
958
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
915
959
  updatedObjects: [
916
960
  {
917
961
  htMeta: {elementId: {type: 'controlentry', id: 'some-control-id'}},
@@ -935,7 +979,7 @@ describe('plugin-meetings', () => {
935
979
  const destroyStub = sinon.stub(locusInfo.webex.meetings, 'destroy');
936
980
 
937
981
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
938
- locusInfoUpdateCallback(MEETING_ENDED);
982
+ locusInfoUpdateCallback({updateType: MEETING_ENDED});
939
983
 
940
984
  assert.calledOnceWithExactly(collectionGetStub, locusInfo.meetingId);
941
985
  assert.calledOnceWithExactly(
@@ -953,17 +997,48 @@ describe('plugin-meetings', () => {
953
997
  const destroyStub = sinon.stub(locusInfo.webex.meetings, 'destroy');
954
998
 
955
999
  // simulate an update from the HashTreeParser (normally this would be triggered by incoming locus messages)
956
- locusInfoUpdateCallback(MEETING_ENDED);
1000
+ locusInfoUpdateCallback({updateType: MEETING_ENDED});
957
1001
 
958
1002
  assert.calledOnceWithExactly(collectionGetStub, locusInfo.meetingId);
959
1003
  assert.notCalled(destroyStub);
960
1004
  });
961
1005
 
1006
+ it('should handle LOCUS_NOT_FOUND by calling syncMeetings with skipHashTreeSync', () => {
1007
+ const syncMeetingsStub = sinon.stub(locusInfo.webex.meetings, 'syncMeetings').resolves();
1008
+
1009
+ locusInfoUpdateCallback({updateType: LOCUS_NOT_FOUND});
1010
+
1011
+ assert.calledOnceWithExactly(syncMeetingsStub, {keepOnlyLocusMeetings: false, skipHashTreeSync: true});
1012
+ });
1013
+
1014
+ it('should handle LOCUS_NOT_FOUND and log error if syncMeetings fails', async () => {
1015
+ const syncError = new Error('sync failed');
1016
+ const syncMeetingsStub = sinon.stub(locusInfo.webex.meetings, 'syncMeetings').rejects(syncError);
1017
+ const logErrorStub = LoggerProxy.logger.error?.isSinonProxy
1018
+ ? LoggerProxy.logger.error
1019
+ : sinon.stub(LoggerProxy.logger, 'error');
1020
+
1021
+ logErrorStub.resetHistory();
1022
+
1023
+ locusInfoUpdateCallback({updateType: LOCUS_NOT_FOUND});
1024
+
1025
+ assert.calledOnceWithExactly(syncMeetingsStub, {keepOnlyLocusMeetings: false, skipHashTreeSync: true});
1026
+
1027
+ // wait for the promise rejection to be handled
1028
+ await testUtils.flushPromises();
1029
+
1030
+ assert.calledOnce(logErrorStub);
1031
+ assert.match(
1032
+ logErrorStub.firstCall.args[0],
1033
+ /syncMeetings failed after LOCUS_NOT_FOUND/
1034
+ );
1035
+ });
1036
+
962
1037
  it('should set forceReplaceMembers to true on the first update for a locusUrl (initializedFromHashTree is false)', () => {
963
1038
  const createdHashTreeParser = locusInfo.hashTreeParsers.get('fake-locus-url');
964
1039
  createdHashTreeParser.initializedFromHashTree = false;
965
1040
 
966
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
1041
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
967
1042
  updatedObjects: [
968
1043
  {
969
1044
  htMeta: {elementId: {type: 'self'}},
@@ -978,7 +1053,7 @@ describe('plugin-meetings', () => {
978
1053
  });
979
1054
 
980
1055
  it('should set forceReplaceMembers to false on subsequent updates (initializedFromHashTree is true)', () => {
981
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
1056
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
982
1057
  updatedObjects: [
983
1058
  {
984
1059
  htMeta: {elementId: {type: 'self'}},
@@ -994,7 +1069,7 @@ describe('plugin-meetings', () => {
994
1069
  it('should copy participant data to self when participant matches self identity and state is LEFT with reason MOVED', () => {
995
1070
  locusInfo.self = {id: 'fake-self', identity: 'user-123'};
996
1071
 
997
- locusInfoUpdateCallback(OBJECTS_UPDATED, {
1072
+ locusInfoUpdateCallback({updateType: OBJECTS_UPDATED,
998
1073
  updatedObjects: [
999
1074
  {
1000
1075
  htMeta: {elementId: {type: 'participant', id: 99}},
@@ -1289,6 +1364,8 @@ describe('plugin-meetings', () => {
1289
1364
  state: RECORDING_STATE.IDLE,
1290
1365
  modifiedBy: 'George Kittle',
1291
1366
  lastModified: 'TODAY',
1367
+ modifiedByServiceAppName: undefined,
1368
+ modifiedByServiceAppId: undefined,
1292
1369
  }
1293
1370
  );
1294
1371
  });
@@ -1323,6 +1400,8 @@ describe('plugin-meetings', () => {
1323
1400
  state: RECORDING_STATE.RECORDING,
1324
1401
  modifiedBy: 'George Kittle',
1325
1402
  lastModified: 'TODAY',
1403
+ modifiedByServiceAppName: undefined,
1404
+ modifiedByServiceAppId: undefined,
1326
1405
  }
1327
1406
  );
1328
1407
  });
@@ -1358,6 +1437,8 @@ describe('plugin-meetings', () => {
1358
1437
  state: RECORDING_STATE.PAUSED,
1359
1438
  modifiedBy: 'George Kittle',
1360
1439
  lastModified: 'TODAY',
1440
+ modifiedByServiceAppName: undefined,
1441
+ modifiedByServiceAppId: undefined,
1361
1442
  }
1362
1443
  );
1363
1444
  });
@@ -1394,6 +1475,8 @@ describe('plugin-meetings', () => {
1394
1475
  state: RECORDING_STATE.RESUMED,
1395
1476
  modifiedBy: 'George Kittle',
1396
1477
  lastModified: 'TODAY',
1478
+ modifiedByServiceAppName: undefined,
1479
+ modifiedByServiceAppId: undefined,
1397
1480
  }
1398
1481
  );
1399
1482
  });
@@ -1429,6 +1512,44 @@ describe('plugin-meetings', () => {
1429
1512
  state: RECORDING_STATE.IDLE,
1430
1513
  modifiedBy: 'George Kittle',
1431
1514
  lastModified: 'TODAY',
1515
+ modifiedByServiceAppName: undefined,
1516
+ modifiedByServiceAppId: undefined,
1517
+ }
1518
+ );
1519
+ });
1520
+
1521
+ it('should include service app fields in the recording event when present', () => {
1522
+ locusInfo.controls = {
1523
+ record: {
1524
+ recording: false,
1525
+ paused: false,
1526
+ meta: {
1527
+ lastModified: 'TODAY',
1528
+ modifiedBy: 'George Kittle',
1529
+ },
1530
+ },
1531
+ shareControl: {},
1532
+ transcribe: {},
1533
+ };
1534
+ newControls.record.recording = true;
1535
+ newControls.record.meta.modifiedByServiceAppName = 'My Bot';
1536
+ newControls.record.meta.modifiedByServiceAppId = 'app-id-123';
1537
+ locusInfo.emitScoped = sinon.stub();
1538
+ locusInfo.updateControls(newControls);
1539
+
1540
+ assert.calledWith(
1541
+ locusInfo.emitScoped,
1542
+ {
1543
+ file: 'locus-info',
1544
+ function: 'updateControls',
1545
+ },
1546
+ LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED,
1547
+ {
1548
+ state: RECORDING_STATE.RECORDING,
1549
+ modifiedBy: 'George Kittle',
1550
+ lastModified: 'TODAY',
1551
+ modifiedByServiceAppName: 'My Bot',
1552
+ modifiedByServiceAppId: 'app-id-123',
1432
1553
  }
1433
1554
  );
1434
1555
  });
@@ -2024,7 +2145,7 @@ describe('plugin-meetings', () => {
2024
2145
  function: 'updateSelf',
2025
2146
  },
2026
2147
  LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED,
2027
- {muted: true, unmuteAllowed: true}
2148
+ {muted: true, unmuteAllowed: true, modifiedBy: null}
2028
2149
  );
2029
2150
 
2030
2151
  // but sometimes "previous self" is defined, but without controls.audio.muted, so we test this here:
@@ -2039,7 +2160,7 @@ describe('plugin-meetings', () => {
2039
2160
  function: 'updateSelf',
2040
2161
  },
2041
2162
  LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED,
2042
- {muted: true, unmuteAllowed: true}
2163
+ {muted: true, unmuteAllowed: true, modifiedBy: null}
2043
2164
  );
2044
2165
  });
2045
2166
 
@@ -2098,7 +2219,7 @@ describe('plugin-meetings', () => {
2098
2219
  function: 'updateSelf',
2099
2220
  },
2100
2221
  LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED,
2101
- {muted: true, unmuteAllowed: true}
2222
+ {muted: true, unmuteAllowed: true, modifiedBy: null}
2102
2223
  );
2103
2224
  });
2104
2225
 
@@ -2237,7 +2358,7 @@ describe('plugin-meetings', () => {
2237
2358
  function: 'updateSelf',
2238
2359
  },
2239
2360
  LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED,
2240
- {muted: true, unmuteAllowed: false}
2361
+ {muted: true, unmuteAllowed: false, modifiedBy: null}
2241
2362
  );
2242
2363
 
2243
2364
  // now change only disallowUnmute
@@ -2255,7 +2376,28 @@ describe('plugin-meetings', () => {
2255
2376
  function: 'updateSelf',
2256
2377
  },
2257
2378
  LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED,
2258
- {muted: true, unmuteAllowed: true}
2379
+ {muted: true, unmuteAllowed: true, modifiedBy: null}
2380
+ );
2381
+ });
2382
+
2383
+ it('should include modifiedBy in payload when muted by host', () => {
2384
+ locusInfo.webex.internal.device.url = self.deviceUrl;
2385
+ locusInfo.updateSelf(self);
2386
+ const newSelf = cloneDeep(self);
2387
+ newSelf.controls.audio.muted = true;
2388
+ newSelf.controls.audio.meta = {modifiedBy: 'host-uuid-123'};
2389
+
2390
+ locusInfo.emitScoped = sinon.stub();
2391
+ locusInfo.updateSelf(newSelf);
2392
+
2393
+ assert.calledWith(
2394
+ locusInfo.emitScoped,
2395
+ {
2396
+ file: 'locus-info',
2397
+ function: 'updateSelf',
2398
+ },
2399
+ LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED,
2400
+ {muted: true, unmuteAllowed: true, modifiedBy: 'host-uuid-123'}
2259
2401
  );
2260
2402
  });
2261
2403
 
@@ -2705,6 +2847,10 @@ describe('plugin-meetings', () => {
2705
2847
 
2706
2848
  let expectedMeeting;
2707
2849
 
2850
+ // simulate that updateSelf has been called previously (as happens in production)
2851
+ // so that parsedLocus.self reflects the joined state
2852
+ locusInfo.parsedLocus.self = {state: 'JOINED'};
2853
+
2708
2854
  /*
2709
2855
  When the event is triggered, it is required that the meeting has already
2710
2856
  been updated. This is why the meeting is being checked within the stubbed event emitter
@@ -2715,6 +2861,7 @@ describe('plugin-meetings', () => {
2715
2861
 
2716
2862
  // set the info initially as locusInfo.info starts as undefined
2717
2863
  expectedMeeting = {
2864
+ attendee: {},
2718
2865
  coHost: {
2719
2866
  LOWER_SOMEONE_ELSES_HAND: true,
2720
2867
  },
@@ -2723,10 +2870,12 @@ describe('plugin-meetings', () => {
2723
2870
  moderator: {
2724
2871
  LOWER_SOMEONE_ELSES_HAND: true,
2725
2872
  },
2873
+ panelist: {},
2726
2874
  policy: {
2727
2875
  LOCK_STATUS_UNLOCKED: true,
2728
2876
  ROSTER_IN_MEETING: true,
2729
2877
  },
2878
+ presenter: {},
2730
2879
  userDisplayHints: ['ROSTER_IN_MEETING', 'LOCK_STATUS_UNLOCKED'],
2731
2880
  };
2732
2881
  locusInfo.updateMeetingInfo(initialInfo, self);
@@ -2741,6 +2890,7 @@ describe('plugin-meetings', () => {
2741
2890
 
2742
2891
  // Updating with different info should trigger the event
2743
2892
  expectedMeeting = {
2893
+ attendee: {},
2744
2894
  coHost: {
2745
2895
  LOWER_SOMEONE_ELSES_HAND: true,
2746
2896
  LOCK_CONTROL_LOCK: true,
@@ -2750,10 +2900,12 @@ describe('plugin-meetings', () => {
2750
2900
  moderator: {
2751
2901
  LOWER_SOMEONE_ELSES_HAND: true,
2752
2902
  },
2903
+ panelist: {},
2753
2904
  policy: {
2754
2905
  LOCK_STATUS_UNLOCKED: true,
2755
2906
  ROSTER_IN_MEETING: true,
2756
2907
  },
2908
+ presenter: {},
2757
2909
  userDisplayHints: ['ROSTER_IN_MEETING', 'LOCK_STATUS_UNLOCKED'],
2758
2910
  };
2759
2911
  locusInfo.updateMeetingInfo(newInfo, self);
@@ -2762,6 +2914,7 @@ describe('plugin-meetings', () => {
2762
2914
 
2763
2915
  // update it with the same info
2764
2916
  expectedMeeting = {
2917
+ attendee: {},
2765
2918
  coHost: {
2766
2919
  LOWER_SOMEONE_ELSES_HAND: true,
2767
2920
  LOCK_CONTROL_LOCK: true,
@@ -2771,10 +2924,12 @@ describe('plugin-meetings', () => {
2771
2924
  moderator: {
2772
2925
  LOWER_SOMEONE_ELSES_HAND: true,
2773
2926
  },
2927
+ panelist: {},
2774
2928
  policy: {
2775
2929
  LOCK_STATUS_UNLOCKED: true,
2776
2930
  ROSTER_IN_MEETING: true,
2777
2931
  },
2932
+ presenter: {},
2778
2933
  userDisplayHints: ['ROSTER_IN_MEETING', 'LOCK_STATUS_UNLOCKED'],
2779
2934
  };
2780
2935
  locusInfo.updateMeetingInfo(newInfo, self);
@@ -2789,6 +2944,7 @@ describe('plugin-meetings', () => {
2789
2944
  hasRole: true,
2790
2945
  });
2791
2946
  expectedMeeting = {
2947
+ attendee: {},
2792
2948
  coHost: {
2793
2949
  LOWER_SOMEONE_ELSES_HAND: true,
2794
2950
  LOCK_CONTROL_LOCK: true,
@@ -2798,10 +2954,12 @@ describe('plugin-meetings', () => {
2798
2954
  moderator: {
2799
2955
  LOWER_SOMEONE_ELSES_HAND: true,
2800
2956
  },
2957
+ panelist: {},
2801
2958
  policy: {
2802
2959
  LOCK_STATUS_UNLOCKED: true,
2803
2960
  ROSTER_IN_MEETING: true,
2804
2961
  },
2962
+ presenter: {},
2805
2963
  userDisplayHints: [
2806
2964
  'ROSTER_IN_MEETING',
2807
2965
  'LOCK_STATUS_UNLOCKED',
@@ -2844,6 +3002,46 @@ describe('plugin-meetings', () => {
2844
3002
  // since self is not passed to updateMeetingInfo, MEETING_INFO_UPDATED should be triggered with isIntializing: true
2845
3003
  checkMeetingInfoUpdatedCalledForRoles(true, {isInitializing: true});
2846
3004
  });
3005
+
3006
+ // joined-section hints (like ROSTER_IN_MEETING) are filtered out while not joined, so they
3007
+ // are a good proxy for verifying that userDisplayHints get recomputed on a join transition
3008
+ [
3009
+ {
3010
+ name: 'the JOINED delta carries the info section',
3011
+ getSecondInfo: (info) => info,
3012
+ },
3013
+ {
3014
+ name: 'the JOINED delta omits the info section (falls back to stored info)',
3015
+ getSecondInfo: () => undefined,
3016
+ },
3017
+ ].forEach(({name, getSecondInfo}) => {
3018
+ it(`recomputes userDisplayHints when self transitions to JOINED with unchanged roles and ${name}`, () => {
3019
+ const info = cloneDeep(meetingInfo); // joined: ['ROSTER_IN_MEETING', 'LOCK_STATUS_UNLOCKED']
3020
+
3021
+ const notJoinedSelf = cloneDeep(self);
3022
+ notJoinedSelf.state = 'IDLE';
3023
+ notJoinedSelf.controls.role.roles = [];
3024
+
3025
+ const joinedSelf = cloneDeep(self);
3026
+ joinedSelf.state = 'JOINED';
3027
+ joinedSelf.controls.role.roles = [];
3028
+
3029
+ sinon.stub(locusInfo, 'emitScoped');
3030
+
3031
+ // first update while not joined: joined-section hints are filtered out
3032
+ locusInfo.updateMeetingInfo(info, notJoinedSelf);
3033
+ assert.notInclude(locusInfo.parsedLocus.info.userDisplayHints, 'ROSTER_IN_MEETING');
3034
+ assert.notInclude(locusInfo.parsedLocus.info.userDisplayHints, 'LOCK_STATUS_UNLOCKED');
3035
+
3036
+ // self transitions to JOINED - info and roles are unchanged
3037
+ locusInfo.updateMeetingInfo(getSecondInfo(info), joinedSelf);
3038
+
3039
+ // the hints must be recomputed with the new joined state
3040
+ assert.include(locusInfo.parsedLocus.info.userDisplayHints, 'ROSTER_IN_MEETING');
3041
+ assert.include(locusInfo.parsedLocus.info.userDisplayHints, 'LOCK_STATUS_UNLOCKED');
3042
+ checkMeetingInfoUpdatedCalled(true, {isInitializing: false});
3043
+ });
3044
+ });
2847
3045
  });
2848
3046
 
2849
3047
  describe('#updateMediaShares', () => {
@@ -3154,13 +3352,14 @@ describe('plugin-meetings', () => {
3154
3352
  const createMockParser = (state = 'active') => ({
3155
3353
  state,
3156
3354
  stop: sinon.stub(),
3157
- resume: sinon.stub(),
3355
+ resumeFromMessage: sinon.stub(),
3158
3356
  handleMessage: sinon.stub(),
3159
3357
  });
3160
3358
 
3161
3359
  const createSelfElementWithReplaces = (replacedLocusUrl, replacedAt) => ({
3162
3360
  htMeta: {elementId: {type: 'Self'}},
3163
3361
  data: {
3362
+ deviceUrl,
3164
3363
  devices: [{url: deviceUrl, replaces: [{locusUrl: replacedLocusUrl, replacedAt}]}],
3165
3364
  },
3166
3365
  });
@@ -3236,7 +3435,7 @@ describe('plugin-meetings', () => {
3236
3435
  stateElementsMessage: message,
3237
3436
  });
3238
3437
 
3239
- assert.calledOnce(parserA.resume);
3438
+ assert.calledOnce(parserA.resumeFromMessage);
3240
3439
  assert.calledOnce(parserB.stop);
3241
3440
  });
3242
3441
 
@@ -3259,7 +3458,7 @@ describe('plugin-meetings', () => {
3259
3458
  stateElementsMessage: message,
3260
3459
  });
3261
3460
 
3262
- assert.notCalled(parserA.resume);
3461
+ assert.notCalled(parserA.resumeFromMessage);
3263
3462
  assert.notCalled(parserB.stop);
3264
3463
  });
3265
3464
 
@@ -3278,7 +3477,7 @@ describe('plugin-meetings', () => {
3278
3477
  stateElementsMessage: message,
3279
3478
  });
3280
3479
 
3281
- assert.notCalled(parserA.resume);
3480
+ assert.notCalled(parserA.resumeFromMessage);
3282
3481
  assert.notCalled(parserA.handleMessage);
3283
3482
  });
3284
3483
 
@@ -3362,6 +3561,51 @@ describe('plugin-meetings', () => {
3362
3561
 
3363
3562
  assert.calledOnceWithExactly(parserA.handleMessage, message);
3364
3563
  });
3564
+
3565
+ it('should send mismatch metric when eventType is not HASH_TREE_DATA_UPDATED', () => {
3566
+ const locusUrlA = 'http://locus-url-A.com';
3567
+ const parserA = {state: 'active', handleMessage: sinon.stub()};
3568
+ locusInfo.hashTreeParsers.set(locusUrlA, {parser: parserA, initializedFromHashTree: true});
3569
+
3570
+ locusInfo.parse(mockMeeting, {
3571
+ eventType: LOCUSEVENT.SELF_CHANGED,
3572
+ stateElementsMessage: {locusUrl: locusUrlA, locusStateElements: [], dataSets: []},
3573
+ });
3574
+
3575
+ assert.calledOnceWithExactly(
3576
+ sendBehavioralMetricStub,
3577
+ 'js_sdk_locus_classic_vs_hash_tree_mismatch',
3578
+ {
3579
+ correlationId: mockMeeting.correlationId,
3580
+ message: `got ${LOCUSEVENT.SELF_CHANGED}, expected ${LOCUSEVENT.HASH_TREE_DATA_UPDATED}`,
3581
+ }
3582
+ );
3583
+ assert.notCalled(parserA.handleMessage);
3584
+ });
3585
+ });
3586
+
3587
+ describe('#sendClassicVsHashTreeMismatchMetric', () => {
3588
+ it('should send the metric when called for the first time', () => {
3589
+ locusInfo.sendClassicVsHashTreeMismatchMetric(mockMeeting, 'some mismatch');
3590
+
3591
+ assert.calledOnceWithExactly(
3592
+ sendBehavioralMetricStub,
3593
+ 'js_sdk_locus_classic_vs_hash_tree_mismatch',
3594
+ {
3595
+ correlationId: mockMeeting.correlationId,
3596
+ message: 'some mismatch',
3597
+ }
3598
+ );
3599
+ });
3600
+
3601
+ it('should send the metric up to 5 times and stop after that', () => {
3602
+ for (let i = 0; i < 7; i += 1) {
3603
+ locusInfo.sendClassicVsHashTreeMismatchMetric(mockMeeting, `mismatch ${i}`);
3604
+ }
3605
+
3606
+ assert.callCount(sendBehavioralMetricStub, 5);
3607
+ assert.equal(locusInfo.classicVsHashTreeMismatchMetricCounter, 5);
3608
+ });
3365
3609
  });
3366
3610
 
3367
3611
  describe('#handleLocusAPIResponse', () => {
@@ -3417,19 +3661,186 @@ describe('plugin-meetings', () => {
3417
3661
  assert.calledOnceWithExactly(locusInfo.handleLocusDelta, fakeLocus, mockMeeting);
3418
3662
  });
3419
3663
 
3420
- it('should send mismatch metric when hash tree parser exists but dataSets are missing in wrapped response', () => {
3664
+ it('should send mismatch metric in classic mode when wrapped response has dataSets', () => {
3421
3665
  const fakeLocus = {url: 'http://locus-url.com'};
3422
- const mockHashTreeParser = {handleLocusUpdate: sinon.stub()};
3423
- locusInfo.hashTreeParsers.set(fakeLocus.url, {
3424
- parser: mockHashTreeParser,
3425
- initializedFromHashTree: true,
3666
+ sinon.stub(locusInfo, 'handleLocusDelta');
3667
+
3668
+ locusInfo.handleLocusAPIResponse(mockMeeting, {
3669
+ locus: fakeLocus,
3670
+ dataSets: [{name: 'dataset1', url: 'test-url'}],
3426
3671
  });
3427
- sinon.stub(locusInfo, 'sendClassicVsHashTreeMismatchMetric');
3428
3672
 
3429
- locusInfo.handleLocusAPIResponse(mockMeeting, {locus: fakeLocus});
3673
+ assert.calledOnceWithExactly(
3674
+ sendBehavioralMetricStub,
3675
+ 'js_sdk_locus_classic_vs_hash_tree_mismatch',
3676
+ {
3677
+ correlationId: mockMeeting.correlationId,
3678
+ message: 'unexpected hash tree dataSets in API response',
3679
+ }
3680
+ );
3681
+ assert.calledOnce(locusInfo.handleLocusDelta);
3682
+ });
3430
3683
 
3431
- assert.calledOnce(locusInfo.sendClassicVsHashTreeMismatchMetric);
3432
- assert.calledOnce(mockHashTreeParser.handleLocusUpdate);
3684
+ describe('parser switch via API response', () => {
3685
+ const deviceUrl = 'http://device-url.com';
3686
+ const locusUrlA = 'http://locus-url-A.com';
3687
+ const locusUrlB = 'http://locus-url-B.com';
3688
+
3689
+ let HashTreeParserStub;
3690
+
3691
+ const createMockApiParser = (state = 'active') => ({
3692
+ state,
3693
+ stop: sinon.stub(),
3694
+ resumeFromApiResponse: sinon.stub(),
3695
+ handleLocusUpdate: sinon.stub(),
3696
+ initializeFromGetLociResponse: sinon.stub(),
3697
+ });
3698
+
3699
+ const createLocusWithReplaces = (url, replacedLocusUrl, replacedAt) => ({
3700
+ url,
3701
+ self: {
3702
+ devices: [{url: deviceUrl, replaces: [{locusUrl: replacedLocusUrl, replacedAt}]}],
3703
+ },
3704
+ });
3705
+
3706
+ const createLocusWithoutReplaces = (url) => ({
3707
+ url,
3708
+ self: {devices: [{url: deviceUrl}]},
3709
+ });
3710
+
3711
+ beforeEach(() => {
3712
+ locusInfo.webex.internal.device.url = deviceUrl;
3713
+ HashTreeParserStub = sinon
3714
+ .stub(HashTreeParserModule, 'default')
3715
+ .returns(createMockApiParser());
3716
+ });
3717
+
3718
+ it('should create a new parser and initialize it when no entry exists for the locusUrl', () => {
3719
+ // existing parser for a different url so hashTreeParsers.size > 0
3720
+ locusInfo.hashTreeParsers.set(locusUrlA, {parser: createMockApiParser(), initializedFromHashTree: true});
3721
+
3722
+ const locus = createLocusWithReplaces(locusUrlB, locusUrlA, '2026-01-01T00:00:00Z');
3723
+ sinon.stub(locusInfo, 'handleLocusDelta');
3724
+
3725
+ locusInfo.handleLocusAPIResponse(mockMeeting, {locus});
3726
+
3727
+ assert.isTrue(locusInfo.hashTreeParsers.has(locusUrlB));
3728
+ const newEntry = locusInfo.hashTreeParsers.get(locusUrlB);
3729
+ assert.isFalse(newEntry.initializedFromHashTree);
3730
+
3731
+ // the stub returns the mock, so initializeFromGetLociResponse should be called on it
3732
+ const createdParser = HashTreeParserStub.returnValues[0];
3733
+ assert.calledOnceWithExactly(createdParser.initializeFromGetLociResponse, locus);
3734
+ assert.notCalled(locusInfo.handleLocusDelta);
3735
+ });
3736
+
3737
+ it('should reactivate a stopped parser when replaces info is newer', () => {
3738
+ const parserA = createMockApiParser('stopped');
3739
+ const parserB = createMockApiParser('active');
3740
+ locusInfo.hashTreeParsers.set(locusUrlA, {parser: parserA, replacedAt: '2026-01-01T00:00:00Z', initializedFromHashTree: true});
3741
+ locusInfo.hashTreeParsers.set(locusUrlB, {parser: parserB, initializedFromHashTree: true});
3742
+
3743
+ const locus = createLocusWithReplaces(locusUrlA, locusUrlB, '2026-02-01T00:00:00Z');
3744
+
3745
+ locusInfo.handleLocusAPIResponse(mockMeeting, {locus});
3746
+
3747
+ assert.calledOnce(parserA.resumeFromApiResponse);
3748
+ assert.calledWithExactly(parserA.resumeFromApiResponse, locus);
3749
+ assert.calledOnce(parserB.stop);
3750
+ assert.equal(locusInfo.hashTreeParsers.get(locusUrlB).replacedAt, '2026-02-01T00:00:00Z');
3751
+ assert.isFalse(locusInfo.hashTreeParsers.get(locusUrlA).initializedFromHashTree);
3752
+ });
3753
+
3754
+ it('should not reactivate a stopped parser when replaces info is not newer', () => {
3755
+ const parserA = createMockApiParser('stopped');
3756
+ const parserB = createMockApiParser('active');
3757
+ locusInfo.hashTreeParsers.set(locusUrlA, {parser: parserA, replacedAt: '2026-03-01T00:00:00Z', initializedFromHashTree: true});
3758
+ locusInfo.hashTreeParsers.set(locusUrlB, {parser: parserB, initializedFromHashTree: true});
3759
+
3760
+ const locus = createLocusWithReplaces(locusUrlA, locusUrlB, '2026-01-01T00:00:00Z');
3761
+
3762
+ locusInfo.handleLocusAPIResponse(mockMeeting, {locus});
3763
+
3764
+ assert.notCalled(parserA.resumeFromApiResponse);
3765
+ assert.notCalled(parserB.stop);
3766
+ });
3767
+
3768
+ it('should not reactivate a stopped parser when no replaces info is available', () => {
3769
+ const parserA = createMockApiParser('stopped');
3770
+ locusInfo.hashTreeParsers.set(locusUrlA, {parser: parserA, initializedFromHashTree: true});
3771
+
3772
+ const locus = createLocusWithoutReplaces(locusUrlA);
3773
+
3774
+ locusInfo.handleLocusAPIResponse(mockMeeting, {locus});
3775
+
3776
+ assert.notCalled(parserA.resumeFromApiResponse);
3777
+ });
3778
+ });
3779
+ });
3780
+
3781
+ describe('#syncAllHashTreeDatasets', () => {
3782
+ it('should call syncAllDatasets on each parser that has an entry', async () => {
3783
+ const parser1 = {syncAllDatasets: sinon.stub().resolves()};
3784
+ const parser2 = {syncAllDatasets: sinon.stub().resolves()};
3785
+ locusInfo.hashTreeParsers.set('url1', {parser: parser1});
3786
+ locusInfo.hashTreeParsers.set('url2', {parser: parser2});
3787
+
3788
+ await locusInfo.syncAllHashTreeDatasets();
3789
+
3790
+ assert.calledOnce(parser1.syncAllDatasets);
3791
+ assert.calledOnce(parser2.syncAllDatasets);
3792
+ });
3793
+
3794
+ it('should skip parser entries without a parser object', async () => {
3795
+ const parser1 = {syncAllDatasets: sinon.stub().resolves()};
3796
+ locusInfo.hashTreeParsers.set('url1', {parser: parser1});
3797
+ locusInfo.hashTreeParsers.set('url2', {parser: undefined});
3798
+
3799
+ await locusInfo.syncAllHashTreeDatasets();
3800
+
3801
+ assert.calledOnce(parser1.syncAllDatasets);
3802
+ });
3803
+
3804
+ it('should forward options to each parser syncAllDatasets', async () => {
3805
+ const parser1 = {syncAllDatasets: sinon.stub().resolves()};
3806
+ const parser2 = {syncAllDatasets: sinon.stub().resolves()};
3807
+ locusInfo.hashTreeParsers.set('url1', {parser: parser1});
3808
+ locusInfo.hashTreeParsers.set('url2', {parser: parser2});
3809
+
3810
+ await locusInfo.syncAllHashTreeDatasets({onlyLLM: true});
3811
+
3812
+ assert.calledOnceWithExactly(parser1.syncAllDatasets, {onlyLLM: true});
3813
+ assert.calledOnceWithExactly(parser2.syncAllDatasets, {onlyLLM: true});
3814
+ });
3815
+
3816
+ it('should await each parsers syncAllDatasets sequentially', async () => {
3817
+ const callOrder = [];
3818
+ const parser1 = {syncAllDatasets: sinon.stub().callsFake(() => {
3819
+ callOrder.push('start1');
3820
+ return new Promise((resolve) => {
3821
+ setTimeout(() => {
3822
+ callOrder.push('end1');
3823
+ resolve();
3824
+ }, 100);
3825
+ });
3826
+ })};
3827
+ const parser2 = {syncAllDatasets: sinon.stub().callsFake(() => {
3828
+ callOrder.push('start2');
3829
+ return Promise.resolve();
3830
+ })};
3831
+ locusInfo.hashTreeParsers.set('url1', {parser: parser1});
3832
+ locusInfo.hashTreeParsers.set('url2', {parser: parser2});
3833
+
3834
+ const clock = sinon.useFakeTimers();
3835
+ const promise = locusInfo.syncAllHashTreeDatasets();
3836
+ // parser1 started but parser2 not yet
3837
+ assert.deepEqual(callOrder, ['start1']);
3838
+
3839
+ await clock.tickAsync(100);
3840
+ await promise;
3841
+ // parser1 finished, then parser2 started and finished
3842
+ assert.deepEqual(callOrder, ['start1', 'end1', 'start2']);
3843
+ clock.restore();
3433
3844
  });
3434
3845
  });
3435
3846
 
@@ -3521,49 +3932,23 @@ describe('plugin-meetings', () => {
3521
3932
  assert.deepEqual(callOrder, ['updateLocusUrl', 'updateMeetingInfo']);
3522
3933
  });
3523
3934
 
3524
- it('#updateLocusInfo ignores breakout LEFT message', () => {
3525
- const newLocus = {
3526
- self: {
3527
- reason: 'MOVED',
3528
- state: 'LEFT',
3529
- },
3530
- };
3935
+ it('#updateLocusInfo ignores locus when isSelfMovedOrBreakoutEnded returns true', () => {
3936
+ const newLocus = {self: {state: 'JOINED'}};
3937
+
3938
+ sinon.stub(MeetingsUtil, 'isSelfMovedOrBreakoutEnded').returns(true);
3531
3939
 
3532
3940
  locusInfo.updateControls = sinon.stub();
3533
- locusInfo.updateConversationUrl = sinon.stub();
3534
- locusInfo.updateCreated = sinon.stub();
3535
3941
  locusInfo.updateFullState = sinon.stub();
3536
- locusInfo.updateHostInfo = sinon.stub();
3537
- locusInfo.updateMeetingInfo = sinon.stub();
3538
- locusInfo.updateMediaShares = sinon.stub();
3539
- locusInfo.updateReplaces = sinon.stub();
3540
3942
  locusInfo.updateSelf = sinon.stub();
3541
- locusInfo.updateLocusUrl = sinon.stub();
3542
- locusInfo.updateAclUrl = sinon.stub();
3543
- locusInfo.updateBasequence = sinon.stub();
3544
- locusInfo.updateSequence = sinon.stub();
3545
- locusInfo.updateEmbeddedApps = sinon.stub();
3546
- locusInfo.updateLinks = sinon.stub();
3547
- locusInfo.compareAndUpdate = sinon.stub();
3548
3943
 
3549
3944
  locusInfo.updateLocusInfo(newLocus);
3550
3945
 
3946
+ assert.calledOnceWithExactly(MeetingsUtil.isSelfMovedOrBreakoutEnded, newLocus);
3551
3947
  assert.notCalled(locusInfo.updateControls);
3552
- assert.notCalled(locusInfo.updateConversationUrl);
3553
- assert.notCalled(locusInfo.updateCreated);
3554
3948
  assert.notCalled(locusInfo.updateFullState);
3555
- assert.notCalled(locusInfo.updateHostInfo);
3556
- assert.notCalled(locusInfo.updateMeetingInfo);
3557
- assert.notCalled(locusInfo.updateMediaShares);
3558
- assert.notCalled(locusInfo.updateReplaces);
3559
3949
  assert.notCalled(locusInfo.updateSelf);
3560
- assert.notCalled(locusInfo.updateLocusUrl);
3561
- assert.notCalled(locusInfo.updateAclUrl);
3562
- assert.notCalled(locusInfo.updateBasequence);
3563
- assert.notCalled(locusInfo.updateSequence);
3564
- assert.notCalled(locusInfo.updateEmbeddedApps);
3565
- assert.notCalled(locusInfo.updateLinks);
3566
- assert.notCalled(locusInfo.compareAndUpdate);
3950
+
3951
+ MeetingsUtil.isSelfMovedOrBreakoutEnded.restore();
3567
3952
  });
3568
3953
 
3569
3954
  it('#updateLocusInfo puts the Locus DTO top level properties at the right place in LocusInfo class', () => {
@@ -4413,6 +4798,31 @@ describe('plugin-meetings', () => {
4413
4798
  });
4414
4799
  });
4415
4800
 
4801
+ describe('#cleanUp', () => {
4802
+ it('calls cleanUp on all hash tree parsers and clears maps', () => {
4803
+ const parser1 = {cleanUp: sinon.stub()};
4804
+ const parser2 = {cleanUp: sinon.stub()};
4805
+
4806
+ locusInfo.hashTreeParsers.set('url1', {parser: parser1, initializedFromHashTree: true});
4807
+ locusInfo.hashTreeParsers.set('url2', {parser: parser2, initializedFromHashTree: true});
4808
+ locusInfo.hashTreeObjectId2ParticipantId.set(1, 'participant1');
4809
+
4810
+ locusInfo.cleanUp();
4811
+
4812
+ assert.calledOnce(parser1.cleanUp);
4813
+ assert.calledOnce(parser2.cleanUp);
4814
+ assert.equal(locusInfo.hashTreeParsers.size, 0);
4815
+ assert.equal(locusInfo.hashTreeObjectId2ParticipantId.size, 0);
4816
+ });
4817
+
4818
+ it('works when there are no hash tree parsers', () => {
4819
+ locusInfo.cleanUp();
4820
+
4821
+ assert.equal(locusInfo.hashTreeParsers.size, 0);
4822
+ assert.equal(locusInfo.hashTreeObjectId2ParticipantId.size, 0);
4823
+ });
4824
+ });
4825
+
4416
4826
  describe('#handleOneonOneEvent', () => {
4417
4827
  beforeEach(() => {
4418
4828
  locusInfo.emitScoped = sinon.stub();
@@ -4455,6 +4865,9 @@ describe('plugin-meetings', () => {
4455
4865
  });
4456
4866
 
4457
4867
  describe('#isMeetingActive', () => {
4868
+ beforeEach(() => {
4869
+ webex.internal.newMetrics.submitClientEvent.resetHistory();
4870
+ });
4458
4871
  forEach([_CALL_, _SIP_BRIDGE_, _SPACE_SHARE_], (type) => {
4459
4872
  describe(`type = ${type}`, () => {
4460
4873
  it('sends client event correctly for state = inactive', () => {
@@ -4475,6 +4888,11 @@ describe('plugin-meetings', () => {
4475
4888
  options: {
4476
4889
  meetingId: locusInfo.meetingId,
4477
4890
  },
4891
+ payload: {
4892
+ eventData: {
4893
+ joinInProgress: false,
4894
+ },
4895
+ },
4478
4896
  });
4479
4897
  });
4480
4898
 
@@ -4495,6 +4913,11 @@ describe('plugin-meetings', () => {
4495
4913
  options: {
4496
4914
  meetingId: locusInfo.meetingId,
4497
4915
  },
4916
+ payload: {
4917
+ eventData: {
4918
+ joinInProgress: false,
4919
+ },
4920
+ },
4498
4921
  });
4499
4922
  });
4500
4923
 
@@ -4516,12 +4939,17 @@ describe('plugin-meetings', () => {
4516
4939
  options: {
4517
4940
  meetingId: locusInfo.meetingId,
4518
4941
  },
4942
+ payload: {
4943
+ eventData: {
4944
+ joinInProgress: false,
4945
+ },
4946
+ },
4519
4947
  });
4520
4948
  });
4521
4949
  });
4522
4950
  });
4523
4951
 
4524
- it('sends client event correctly for state = MEETING_INACTIVE_TERMINATING', () => {
4952
+ it('sends client event correctly for state = MEETING_INACTIVE', () => {
4525
4953
  locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
4526
4954
  locusInfo.parsedLocus = {
4527
4955
  fullState: {
@@ -4543,7 +4971,7 @@ describe('plugin-meetings', () => {
4543
4971
  });
4544
4972
  });
4545
4973
 
4546
- it('sends client event correctly for state = FULLSTATE_REMOVED', () => {
4974
+ it('does not send client event when state = INACTIVE and endMeetingReason = BREAKOUT_ENDED', () => {
4547
4975
  locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
4548
4976
  locusInfo.parsedLocus = {
4549
4977
  fullState: {
@@ -4552,16 +4980,127 @@ describe('plugin-meetings', () => {
4552
4980
  };
4553
4981
 
4554
4982
  locusInfo.fullState = {
4555
- removed: true,
4983
+ state: LOCUS.STATE.INACTIVE,
4984
+ endMeetingReason: 'BREAKOUT_ENDED',
4556
4985
  };
4557
4986
 
4558
4987
  locusInfo.isMeetingActive();
4559
4988
 
4560
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
4561
- name: 'client.call.remote-ended',
4562
- options: {
4563
- meetingId: locusInfo.meetingId,
4989
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
4990
+ });
4991
+
4992
+ it('sends client event correctly for state self removed', () => {
4993
+ locusInfo.emitScoped = sinon.stub();
4994
+ locusInfo.parsedLocus = {
4995
+ fullState: {
4996
+ type: _MEETING_,
4564
4997
  },
4998
+ self: {
4999
+ removed: true,
5000
+ }
5001
+ };
5002
+
5003
+ locusInfo.isMeetingActive();
5004
+
5005
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
5006
+ assert.calledOnceWithExactly(
5007
+ locusInfo.emitScoped,
5008
+ {
5009
+ file: 'locus-info',
5010
+ function: 'isMeetingActive',
5011
+ },
5012
+ EVENTS.DESTROY_MEETING,
5013
+ {
5014
+ reason: MEETING_REMOVED_REASON.SELF_REMOVED,
5015
+ shouldLeave: false,
5016
+ }
5017
+ );
5018
+ });
5019
+
5020
+ describe('destroyMeetingSuspended', () => {
5021
+ it('suppresses DESTROY_MEETING for SELF_REMOVED when suspended', () => {
5022
+ locusInfo.emitScoped = sinon.stub();
5023
+ locusInfo.suspendDestroyMeeting(true);
5024
+ locusInfo.parsedLocus = {
5025
+ fullState: {
5026
+ type: _MEETING_,
5027
+ },
5028
+ self: {
5029
+ removed: true,
5030
+ }
5031
+ };
5032
+
5033
+ locusInfo.isMeetingActive();
5034
+
5035
+ assert.notCalled(locusInfo.emitScoped);
5036
+ assert.calledOnceWithExactly(
5037
+ sendBehavioralMetricStub,
5038
+ BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED,
5039
+ {
5040
+ meetingId: locusInfo.meetingId,
5041
+ reason: 'SELF_REMOVED',
5042
+ }
5043
+ );
5044
+ });
5045
+
5046
+ it('suppresses DESTROY_MEETING for MEETING_INACTIVE_TERMINATING when suspended', () => {
5047
+ locusInfo.emitScoped = sinon.stub();
5048
+ locusInfo.suspendDestroyMeeting(true);
5049
+ locusInfo.parsedLocus = {
5050
+ fullState: {
5051
+ type: _MEETING_,
5052
+ },
5053
+ };
5054
+ locusInfo.fullState = {
5055
+ state: LOCUS.STATE.INACTIVE,
5056
+ };
5057
+
5058
+ locusInfo.isMeetingActive();
5059
+
5060
+ assert.notCalled(locusInfo.emitScoped);
5061
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
5062
+ assert.calledOnceWithExactly(
5063
+ sendBehavioralMetricStub,
5064
+ BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED,
5065
+ {
5066
+ meetingId: locusInfo.meetingId,
5067
+ reason: 'MEETING_INACTIVE_TERMINATING',
5068
+ }
5069
+ );
5070
+ });
5071
+
5072
+ [
5073
+ {reason: 'CALL_INACTIVE', setup: () => {
5074
+ locusInfo.parsedLocus = {fullState: {type: _CALL_}};
5075
+ locusInfo.fullState = {state: LOCUS.STATE.INACTIVE};
5076
+ }},
5077
+ {reason: 'PARTNER_LEFT', setup: () => {
5078
+ locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
5079
+ locusInfo.parsedLocus = {fullState: {type: _CALL_}, self: {state: MEETING_STATE.STATES.JOINED}};
5080
+ }},
5081
+ {reason: 'SELF_LEFT', setup: () => {
5082
+ locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
5083
+ locusInfo.parsedLocus = {fullState: {type: _CALL_}, self: {state: MEETING_STATE.STATES.LEFT}};
5084
+ }},
5085
+ ].forEach(({reason, setup}) => {
5086
+ it(`sends joinInProgress=true in client event for ${reason} when suspended`, () => {
5087
+ locusInfo.suspendDestroyMeeting(true);
5088
+ setup();
5089
+
5090
+ locusInfo.isMeetingActive();
5091
+
5092
+ assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
5093
+ name: 'client.call.remote-ended',
5094
+ options: {
5095
+ meetingId: locusInfo.meetingId,
5096
+ },
5097
+ payload: {
5098
+ eventData: {
5099
+ joinInProgress: true,
5100
+ },
5101
+ },
5102
+ });
5103
+ });
4565
5104
  });
4566
5105
  });
4567
5106
  });
@@ -4954,6 +5493,31 @@ describe('plugin-meetings', () => {
4954
5493
  );
4955
5494
  assert.notCalled(getTheLocusToUpdateStub);
4956
5495
  });
5496
+
5497
+ it('should call handleLocusAPIResponse for SDK_LOCUS_FROM_SYNC_MEETINGS when hash tree parsers exist', () => {
5498
+ const fakeLocusUrl = 'http://locus-url.com';
5499
+ const fakeLocus = {url: fakeLocusUrl, fullState: {state: 'ACTIVE'}};
5500
+ const mockHashTreeParser = {
5501
+ handleMessage: sinon.stub(),
5502
+ handleLocusUpdate: sinon.stub(),
5503
+ };
5504
+ locusInfo.hashTreeParsers.set(fakeLocusUrl, {
5505
+ parser: mockHashTreeParser,
5506
+ initializedFromHashTree: true,
5507
+ });
5508
+
5509
+ sinon.stub(locusInfo, 'handleLocusDelta');
5510
+
5511
+ locusInfo.parse(mockMeeting, {
5512
+ eventType: LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
5513
+ locus: fakeLocus,
5514
+ });
5515
+
5516
+ // should route through handleLocusAPIResponse which passes unwrapped LocusDTO to parser
5517
+ assert.calledOnce(mockHashTreeParser.handleLocusUpdate);
5518
+ assert.notCalled(mockHashTreeParser.handleMessage);
5519
+ assert.notCalled(locusInfo.handleLocusDelta);
5520
+ });
4957
5521
  });
4958
5522
  });
4959
5523
 
@@ -5146,6 +5710,7 @@ describe('plugin-meetings', () => {
5146
5710
  return {
5147
5711
  htMeta: {elementId: {type: 'Self'}},
5148
5712
  data: {
5713
+ deviceUrl,
5149
5714
  devices,
5150
5715
  },
5151
5716
  };