@webex/plugin-meetings 3.12.0-next.16 → 3.12.0-next.160

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 (301) hide show
  1. package/.sdd/manifest.json +1312 -0
  2. package/.sdd/templates/.source.json +30 -0
  3. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
  4. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
  5. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
  6. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
  7. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
  8. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
  9. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
  10. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
  11. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
  12. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
  13. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
  14. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
  15. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
  16. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
  17. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
  18. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
  19. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
  20. package/.sdd/templates/component-repo/template-map.json +112 -0
  21. package/AGENTS.md +135 -0
  22. package/ai-docs/ARCHITECTURE.md +207 -0
  23. package/ai-docs/CONTRACTS.md +267 -0
  24. package/ai-docs/DATA_MODEL.md +64 -0
  25. package/ai-docs/GETTING_STARTED.md +73 -0
  26. package/ai-docs/GLOSSARY.md +56 -0
  27. package/ai-docs/REVIEW_CHECKLIST.md +45 -0
  28. package/ai-docs/RULES.md +79 -0
  29. package/ai-docs/SECURITY.md +74 -0
  30. package/ai-docs/SERVICE_STATE.md +59 -0
  31. package/ai-docs/SPEC_INDEX.md +85 -0
  32. package/ai-docs/TEST_INDEX.md +45 -0
  33. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
  34. package/ai-docs/patterns/defensive-error-propagation.md +55 -0
  35. package/ai-docs/patterns/event-scope-emission.md +46 -0
  36. package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
  37. package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
  38. package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
  39. package/dist/aiEnableRequest/index.js +15 -2
  40. package/dist/aiEnableRequest/index.js.map +1 -1
  41. package/dist/annotation/index.js +2 -2
  42. package/dist/annotation/index.js.map +1 -1
  43. package/dist/breakouts/breakout.js +8 -3
  44. package/dist/breakouts/breakout.js.map +1 -1
  45. package/dist/breakouts/events.js +29 -14
  46. package/dist/breakouts/events.js.map +1 -1
  47. package/dist/breakouts/index.js +99 -4
  48. package/dist/breakouts/index.js.map +1 -1
  49. package/dist/common/errors/webex-errors.js +49 -5
  50. package/dist/common/errors/webex-errors.js.map +1 -1
  51. package/dist/config.js +2 -2
  52. package/dist/config.js.map +1 -1
  53. package/dist/constants.js +37 -10
  54. package/dist/constants.js.map +1 -1
  55. package/dist/controls-options-manager/index.js +46 -10
  56. package/dist/controls-options-manager/index.js.map +1 -1
  57. package/dist/hashTree/constants.js +4 -1
  58. package/dist/hashTree/constants.js.map +1 -1
  59. package/dist/hashTree/hashTreeParser.js +1096 -391
  60. package/dist/hashTree/hashTreeParser.js.map +1 -1
  61. package/dist/hashTree/utils.js +20 -0
  62. package/dist/hashTree/utils.js.map +1 -1
  63. package/dist/index.js +7 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  66. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  67. package/dist/interceptors/locusRetry.js +24 -9
  68. package/dist/interceptors/locusRetry.js.map +1 -1
  69. package/dist/interpretation/index.js +55 -12
  70. package/dist/interpretation/index.js.map +1 -1
  71. package/dist/interpretation/interpretation.types.js +7 -0
  72. package/dist/interpretation/interpretation.types.js.map +1 -0
  73. package/dist/interpretation/siLanguage.js +1 -1
  74. package/dist/locus-info/controlsUtils.js +4 -1
  75. package/dist/locus-info/controlsUtils.js.map +1 -1
  76. package/dist/locus-info/index.js +615 -176
  77. package/dist/locus-info/index.js.map +1 -1
  78. package/dist/locus-info/infoUtils.js +36 -5
  79. package/dist/locus-info/infoUtils.js.map +1 -1
  80. package/dist/locus-info/types.js +20 -0
  81. package/dist/locus-info/types.js.map +1 -1
  82. package/dist/media/MediaConnectionAwaiter.js +15 -2
  83. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  84. package/dist/media/index.js +8 -2
  85. package/dist/media/index.js.map +1 -1
  86. package/dist/media/properties.js +4 -5
  87. package/dist/media/properties.js.map +1 -1
  88. package/dist/meeting/in-meeting-actions.js +7 -1
  89. package/dist/meeting/in-meeting-actions.js.map +1 -1
  90. package/dist/meeting/index.js +1688 -835
  91. package/dist/meeting/index.js.map +1 -1
  92. package/dist/meeting/locusMediaRequest.js +229 -82
  93. package/dist/meeting/locusMediaRequest.js.map +1 -1
  94. package/dist/meeting/muteState.js +10 -1
  95. package/dist/meeting/muteState.js.map +1 -1
  96. package/dist/meeting/request.js +5 -2
  97. package/dist/meeting/request.js.map +1 -1
  98. package/dist/meeting/util.js +37 -3
  99. package/dist/meeting/util.js.map +1 -1
  100. package/dist/meeting/voicea-meeting.js +2 -1
  101. package/dist/meeting/voicea-meeting.js.map +1 -1
  102. package/dist/meeting-info/meeting-info-v2.js +9 -3
  103. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  104. package/dist/meetings/index.js +300 -128
  105. package/dist/meetings/index.js.map +1 -1
  106. package/dist/meetings/meetings.types.js +6 -1
  107. package/dist/meetings/meetings.types.js.map +1 -1
  108. package/dist/meetings/request.js +39 -0
  109. package/dist/meetings/request.js.map +1 -1
  110. package/dist/meetings/util.js +116 -18
  111. package/dist/meetings/util.js.map +1 -1
  112. package/dist/member/index.js +10 -0
  113. package/dist/member/index.js.map +1 -1
  114. package/dist/member/types.js.map +1 -1
  115. package/dist/member/util.js +30 -0
  116. package/dist/member/util.js.map +1 -1
  117. package/dist/members/index.js +101 -43
  118. package/dist/members/index.js.map +1 -1
  119. package/dist/members/util.js +8 -1
  120. package/dist/members/util.js.map +1 -1
  121. package/dist/metrics/constants.js +7 -1
  122. package/dist/metrics/constants.js.map +1 -1
  123. package/dist/multistream/codec/constants.js +63 -0
  124. package/dist/multistream/codec/constants.js.map +1 -0
  125. package/dist/multistream/mediaRequestManager.js +62 -15
  126. package/dist/multistream/mediaRequestManager.js.map +1 -1
  127. package/dist/multistream/receiveSlot.js +9 -0
  128. package/dist/multistream/receiveSlot.js.map +1 -1
  129. package/dist/multistream/remoteMediaManager.js +32 -4
  130. package/dist/multistream/remoteMediaManager.js.map +1 -1
  131. package/dist/reachability/clusterReachability.js.map +1 -1
  132. package/dist/reachability/index.js +121 -83
  133. package/dist/reachability/index.js.map +1 -1
  134. package/dist/reachability/reachability.types.js +2 -0
  135. package/dist/reachability/reachability.types.js.map +1 -1
  136. package/dist/reachability/util.js +45 -0
  137. package/dist/reachability/util.js.map +1 -1
  138. package/dist/reactions/reactions.type.js.map +1 -1
  139. package/dist/recording-controller/index.js +1 -3
  140. package/dist/recording-controller/index.js.map +1 -1
  141. package/dist/roap/turnDiscovery.js +8 -1
  142. package/dist/roap/turnDiscovery.js.map +1 -1
  143. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  144. package/dist/types/config.d.ts +2 -2
  145. package/dist/types/constants.d.ts +13 -1
  146. package/dist/types/controls-options-manager/index.d.ts +16 -0
  147. package/dist/types/hashTree/constants.d.ts +1 -0
  148. package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
  149. package/dist/types/hashTree/utils.d.ts +7 -0
  150. package/dist/types/index.d.ts +3 -0
  151. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  152. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  153. package/dist/types/locus-info/index.d.ts +106 -8
  154. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  155. package/dist/types/locus-info/types.d.ts +22 -1
  156. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  157. package/dist/types/media/properties.d.ts +6 -2
  158. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  159. package/dist/types/meeting/index.d.ts +176 -11
  160. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  161. package/dist/types/meeting/request.d.ts +1 -0
  162. package/dist/types/meeting/util.d.ts +9 -0
  163. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  164. package/dist/types/meetings/index.d.ts +40 -19
  165. package/dist/types/meetings/meetings.types.d.ts +15 -0
  166. package/dist/types/meetings/request.d.ts +14 -0
  167. package/dist/types/member/index.d.ts +1 -0
  168. package/dist/types/member/types.d.ts +1 -0
  169. package/dist/types/member/util.d.ts +9 -0
  170. package/dist/types/members/index.d.ts +15 -2
  171. package/dist/types/members/util.d.ts +1 -5
  172. package/dist/types/metrics/constants.d.ts +6 -0
  173. package/dist/types/multistream/codec/constants.d.ts +7 -0
  174. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  175. package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
  176. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  177. package/dist/types/reachability/index.d.ts +10 -3
  178. package/dist/types/reachability/reachability.types.d.ts +7 -0
  179. package/dist/types/reachability/util.d.ts +17 -0
  180. package/dist/types/reactions/reactions.type.d.ts +3 -0
  181. package/dist/webinar/index.js +307 -161
  182. package/dist/webinar/index.js.map +1 -1
  183. package/package.json +23 -23
  184. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  185. package/src/aiEnableRequest/index.ts +16 -0
  186. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  187. package/src/annotation/index.ts +6 -4
  188. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  189. package/src/breakouts/breakout.ts +3 -1
  190. package/src/breakouts/events.ts +33 -11
  191. package/src/breakouts/index.ts +122 -2
  192. package/src/common/errors/webex-errors.ts +50 -3
  193. package/src/config.ts +2 -2
  194. package/src/constants.ts +21 -3
  195. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  196. package/src/controls-options-manager/index.ts +62 -10
  197. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  198. package/src/hashTree/constants.ts +7 -0
  199. package/src/hashTree/hashTreeParser.ts +861 -193
  200. package/src/hashTree/utils.ts +19 -0
  201. package/src/index.ts +6 -0
  202. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  203. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  204. package/src/interceptors/locusRetry.ts +26 -5
  205. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  206. package/src/interpretation/index.ts +65 -10
  207. package/src/interpretation/interpretation.types.ts +11 -0
  208. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  209. package/src/locus-info/controlsUtils.ts +3 -1
  210. package/src/locus-info/index.ts +566 -164
  211. package/src/locus-info/infoUtils.ts +41 -6
  212. package/src/locus-info/types.ts +26 -1
  213. package/src/media/MediaConnectionAwaiter.ts +21 -4
  214. package/src/media/ai-docs/media-spec.md +267 -0
  215. package/src/media/index.ts +10 -1
  216. package/src/media/properties.ts +8 -3
  217. package/src/meeting/ai-docs/meeting-spec.md +401 -0
  218. package/src/meeting/in-meeting-actions.ts +12 -0
  219. package/src/meeting/index.ts +946 -120
  220. package/src/meeting/locusMediaRequest.ts +106 -6
  221. package/src/meeting/muteState.ts +10 -1
  222. package/src/meeting/request.ts +11 -0
  223. package/src/meeting/util.ts +51 -7
  224. package/src/meeting/voicea-meeting.ts +1 -1
  225. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  226. package/src/meeting-info/meeting-info-v2.ts +10 -4
  227. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  228. package/src/meetings/index.ts +200 -80
  229. package/src/meetings/meetings.types.ts +19 -0
  230. package/src/meetings/request.ts +43 -0
  231. package/src/meetings/util.ts +117 -4
  232. package/src/member/ai-docs/member-spec.md +196 -0
  233. package/src/member/index.ts +10 -0
  234. package/src/member/types.ts +1 -0
  235. package/src/member/util.ts +29 -0
  236. package/src/members/ai-docs/members-spec.md +256 -0
  237. package/src/members/index.ts +70 -7
  238. package/src/members/util.ts +12 -4
  239. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  240. package/src/metrics/constants.ts +6 -0
  241. package/src/multistream/ai-docs/multistream-spec.md +292 -0
  242. package/src/multistream/codec/constants.ts +58 -0
  243. package/src/multistream/mediaRequestManager.ts +119 -28
  244. package/src/multistream/receiveSlot.ts +18 -0
  245. package/src/multistream/remoteMediaManager.ts +23 -1
  246. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  247. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  248. package/src/reachability/clusterReachability.ts +3 -2
  249. package/src/reachability/index.ts +47 -16
  250. package/src/reachability/reachability.types.ts +11 -0
  251. package/src/reachability/util.ts +36 -0
  252. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  253. package/src/reactions/reactions.type.ts +3 -0
  254. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  255. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  256. package/src/recording-controller/index.ts +1 -2
  257. package/src/roap/ai-docs/roap-spec.md +241 -0
  258. package/src/roap/turnDiscovery.ts +9 -1
  259. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  260. package/src/webinar/index.ts +216 -38
  261. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  262. package/test/unit/spec/annotation/index.ts +3 -3
  263. package/test/unit/spec/breakouts/breakout.ts +9 -3
  264. package/test/unit/spec/breakouts/events.ts +120 -2
  265. package/test/unit/spec/breakouts/index.ts +223 -3
  266. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  267. package/test/unit/spec/controls-options-manager/index.js +139 -32
  268. package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
  269. package/test/unit/spec/hashTree/utils.ts +37 -0
  270. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  271. package/test/unit/spec/interceptors/locusRetry.ts +234 -5
  272. package/test/unit/spec/interpretation/index.ts +119 -4
  273. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  274. package/test/unit/spec/locus-info/index.js +1014 -58
  275. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  276. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  277. package/test/unit/spec/media/index.ts +92 -0
  278. package/test/unit/spec/media/properties.ts +23 -23
  279. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  280. package/test/unit/spec/meeting/index.js +2838 -109
  281. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  282. package/test/unit/spec/meeting/muteState.js +81 -0
  283. package/test/unit/spec/meeting/request.js +12 -0
  284. package/test/unit/spec/meeting/utils.js +189 -17
  285. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  286. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  287. package/test/unit/spec/meetings/index.js +544 -49
  288. package/test/unit/spec/meetings/request.js +141 -0
  289. package/test/unit/spec/meetings/utils.js +402 -51
  290. package/test/unit/spec/member/index.js +7 -0
  291. package/test/unit/spec/member/util.js +89 -0
  292. package/test/unit/spec/members/index.js +216 -0
  293. package/test/unit/spec/members/request.js +37 -1
  294. package/test/unit/spec/members/utils.js +63 -0
  295. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  296. package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
  297. package/test/unit/spec/reachability/index.ts +128 -46
  298. package/test/unit/spec/reachability/util.ts +31 -0
  299. package/test/unit/spec/recording-controller/index.js +9 -8
  300. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  301. package/test/unit/spec/webinar/index.ts +332 -31
@@ -1,4 +1,6 @@
1
1
  import {isEqual, assignWith, cloneDeep, isEmpty} from 'lodash';
2
+ import uuid from 'uuid';
3
+ import {webexTrackingIdSequenceNumbers} from '@webex/webex-core';
2
4
 
3
5
  import LoggerProxy from '../common/logs/logger-proxy';
4
6
  import EventsScope from '../common/events/events-scope';
@@ -37,6 +39,7 @@ import HashTreeParser, {
37
39
  LocusInfoUpdate,
38
40
  LocusInfoUpdateType,
39
41
  Metadata,
42
+ SyncLatencyTracker,
40
43
  } from '../hashTree/hashTreeParser';
41
44
  import {HashTreeObject, ObjectType, ObjectTypeToLocusKeyMap} from '../hashTree/types';
42
45
  import {isMetadata, isSelf} from '../hashTree/utils';
@@ -46,6 +49,7 @@ import {MEETING_KEY} from '../meetings/meetings.types';
46
49
  import MeetingCollection from '../meetings/collection';
47
50
 
48
51
  export type LocusLLMEvent = {
52
+ trackingId?: string;
49
53
  data: {
50
54
  eventType: typeof LOCUSEVENT.HASH_TREE_DATA_UPDATED;
51
55
  stateElementsMessage: HashTreeMessage;
@@ -94,11 +98,16 @@ export type HashTreeParserEntry = {
94
98
  initializedFromHashTree: boolean;
95
99
  };
96
100
 
101
+ export type LocusInfoCallbacks = {
102
+ updateMeeting: (object: any) => void;
103
+ syncLatencyTracker?: SyncLatencyTracker;
104
+ };
105
+
97
106
  /**
98
107
  * Gets the replacement information
99
108
  *
100
109
  * @param {any} self - "self" object from Locus DTO
101
- * @param {string} deviceUrl - The URL of the user's device
110
+ * @param {string} deviceUrl - The URL of the specified device
102
111
  * @returns {any} The replace information if available, otherwise undefined
103
112
  */
104
113
  function getReplaceInfoFromSelf(self: any, deviceUrl: string): ReplacesInfo | undefined {
@@ -138,14 +147,15 @@ function findLocusUrlInAnyHashTreeParser(
138
147
  *
139
148
  * @param {HashTreeMessage} message - The hash tree message to find the meeting for
140
149
  * @param {MeetingCollection} meetingCollection - The collection of meetings to search
141
- * @param {string} deviceUrl - The URL of the user's device
142
150
  * @returns {any} The meeting if found, otherwise undefined
143
151
  */
144
152
  export function findMeetingForHashTreeMessage(
145
- message: HashTreeMessage,
146
- meetingCollection: MeetingCollection,
147
- deviceUrl: string
153
+ message: HashTreeMessage | undefined,
154
+ meetingCollection: MeetingCollection
148
155
  ): any {
156
+ if (!message) {
157
+ return undefined;
158
+ }
149
159
  let foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, message.locusUrl);
150
160
 
151
161
  if (foundMeeting) {
@@ -155,7 +165,7 @@ export function findMeetingForHashTreeMessage(
155
165
  // if we haven't found anything, it may mean that message has a new locusUrl
156
166
  // check if it indicates that it replaces some existing current locusUrl (this is indicated in "self")
157
167
  const self = message.locusStateElements?.find((el) => isSelf(el))?.data;
158
- const replaces = getReplaceInfoFromSelf(self, deviceUrl);
168
+ const replaces = getReplaceInfoFromSelf(self, self?.deviceUrl);
159
169
 
160
170
  if (replaces?.locusUrl) {
161
171
  foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, replaces.locusUrl);
@@ -261,7 +271,6 @@ export default class LocusInfo extends EventsScope {
261
271
  locusParser: any;
262
272
  meetingId: any;
263
273
  parsedLocus: any;
264
- updateMeeting: any;
265
274
  webex: any;
266
275
  aclUrl: any;
267
276
  baseSequence: any;
@@ -285,29 +294,41 @@ export default class LocusInfo extends EventsScope {
285
294
  hashTreeParsers: Map<string, HashTreeParserEntry>;
286
295
  hashTreeObjectId2ParticipantId: Map<number, string>; // mapping of hash tree object ids to participant ids
287
296
  classicVsHashTreeMismatchMetricCounter = 0;
297
+ private callbacks: LocusInfoCallbacks;
298
+ private destroyMeetingSuspended = false;
288
299
 
289
300
  /**
290
301
  * Constructor
291
- * @param {function} updateMeeting callback to update the meeting object from an object
302
+ * @param {Object} callbacks callbacks used by LocusInfo
303
+ * @param {function} callbacks.updateMeeting callback to update the meeting object from an object
292
304
  * @param {object} webex
293
305
  * @param {string} meetingId
294
306
  * @returns {undefined}
295
307
  */
296
- constructor(updateMeeting, webex, meetingId) {
308
+ constructor(callbacks: LocusInfoCallbacks, webex: any, meetingId: any) {
297
309
  super();
298
310
  this.parsedLocus = {
299
311
  states: [],
300
312
  };
313
+ this.callbacks = callbacks;
301
314
  this.webex = webex;
302
315
  this.emitChange = false;
303
316
  this.compareAndUpdateFlags = {};
304
317
  this.meetingId = meetingId;
305
- this.updateMeeting = updateMeeting;
306
318
  this.locusParser = new LocusDeltaParser();
307
319
  this.hashTreeParsers = new Map();
308
320
  this.hashTreeObjectId2ParticipantId = new Map();
309
321
  }
310
322
 
323
+ /**
324
+ * Whether this meeting uses hash tree based Locus (as opposed to a classic, delta based Locus).
325
+ *
326
+ * @returns {boolean}
327
+ */
328
+ isUsingHashTrees(): boolean {
329
+ return this.hashTreeParsers.size > 0;
330
+ }
331
+
311
332
  /**
312
333
  * Does a Locus sync. It tries to get the latest delta DTO or if it can't, it falls back to getting the full Locus DTO.
313
334
  * WARNING: This function must not be used for hash tree based Locus meetings.
@@ -315,12 +336,26 @@ export default class LocusInfo extends EventsScope {
315
336
  * @param {Meeting} meeting
316
337
  * @param {boolean} isLocusUrlChanged
317
338
  * @param {Locus} locus
318
- * @returns {undefined}
339
+ * @param {Object} [options]
340
+ * @param {boolean} [options.destroyOnTransientFailure=true] controls what happens on a *transient*
341
+ * sync failure (a terminal failure, e.g. a 403 meaning the meeting has ended, always destroys
342
+ * the meeting regardless of this flag). When true, a transient failure destroys the meeting and
343
+ * the returned promise still resolves. When false, the meeting is preserved and the returned
344
+ * promise rejects so the caller can retry.
345
+ * @returns {Promise} resolves once the fetched DTO has been applied; see destroyOnTransientFailure
346
+ * for the failure behavior
319
347
  */
320
- private doLocusSync(meeting: any, isLocusUrlChanged: boolean, locus: any) {
348
+ private doLocusSync(
349
+ meeting: any,
350
+ isLocusUrlChanged: boolean,
351
+ locus: any,
352
+ {destroyOnTransientFailure = true}: {destroyOnTransientFailure?: boolean} = {}
353
+ ) {
321
354
  let url;
322
355
  let isDelta = false;
323
356
  let meetingDestroyed = false;
357
+ // whether the DTO fetch itself failed (as opposed to applying a successfully fetched DTO)
358
+ let fetchFailed = false;
324
359
 
325
360
  if (isLocusUrlChanged) {
326
361
  // for the locus url changed case from breakout to main session, we should always do a full sync, in this case, the url from locus is always on main session,
@@ -341,8 +376,30 @@ export default class LocusInfo extends EventsScope {
341
376
  } DTO)`
342
377
  );
343
378
 
344
- // return value ignored on purpose
345
- meeting.meetingRequest
379
+ // Called once the DTO fetch (delta plus any full-sync fallback) has failed and we're giving up.
380
+ // The meeting is destroyed when either the delta-processing path asked for it, or the failure is
381
+ // terminal (e.g. a 403 meaning the meeting has ended) - in both cases there's nothing left to
382
+ // sync or retry, so the trailing catch below swallows the rejection whenever meetingDestroyed is
383
+ // set. On the caller-driven reconnection path a non-terminal failure preserves the meeting and
384
+ // lets the rejection propagate so the caller can retry.
385
+ const onFetchFailure = (error: any, logMessage: string, {terminal = false} = {}) => {
386
+ // terminal failures always destroy the meeting; destroyOnTransientFailure only controls the
387
+ // non-terminal case
388
+ const destroyMeeting = terminal || destroyOnTransientFailure;
389
+ LoggerProxy.logger.info(
390
+ `Locus-info:index#doLocusSync --> ${logMessage}${
391
+ destroyMeeting ? ', destroying the meeting' : ''
392
+ }`
393
+ );
394
+ fetchFailed = true;
395
+ if (destroyMeeting) {
396
+ this.webex.meetings.destroy(meeting, MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
397
+ meetingDestroyed = true;
398
+ }
399
+ throw error;
400
+ };
401
+
402
+ return meeting.meetingRequest
346
403
  .getLocusDTO({url})
347
404
  .catch((e) => {
348
405
  if (isDelta) {
@@ -363,26 +420,21 @@ export default class LocusInfo extends EventsScope {
363
420
 
364
421
  // Locus sometimes returns 403, for example if meeting has ended, no point trying the fallback to full sync in that case
365
422
  if (e.statusCode !== 403) {
366
- return meeting.meetingRequest.getLocusDTO({url: meeting.locusUrl}).catch((err) => {
367
- LoggerProxy.logger.info(
368
- 'Locus-info:index#doLocusSync --> fallback full sync failed, destroying the meeting'
369
- );
370
- this.webex.meetings.destroy(meeting, MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
371
- meetingDestroyed = true;
372
- throw err;
373
- });
423
+ return meeting.meetingRequest.getLocusDTO({url: meeting.locusUrl}).catch((err) =>
424
+ // A 403 from the fallback full sync is also terminal (meeting has ended), so remove the
425
+ // meeting even on the reconnection path instead of preserving it and rejecting.
426
+ onFetchFailure(err, 'fallback full sync failed', {terminal: err.statusCode === 403})
427
+ );
374
428
  }
375
- LoggerProxy.logger.info(
376
- 'Locus-info:index#doLocusSync --> got 403 from Locus, skipping fallback to full sync, destroying the meeting'
377
- );
378
- } else {
379
- LoggerProxy.logger.info(
380
- 'Locus-info:index#doLocusSync --> fallback full sync failed, destroying the meeting'
381
- );
429
+
430
+ // A 403 means the meeting has ended - this is terminal, so remove the meeting even on the
431
+ // reconnection path (there's nothing to retry) instead of preserving it and rejecting.
432
+ return onFetchFailure(e, 'got 403 from Locus, skipping fallback to full sync', {
433
+ terminal: true,
434
+ });
382
435
  }
383
- this.webex.meetings.destroy(meeting, MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
384
- meetingDestroyed = true;
385
- throw e;
436
+
437
+ return onFetchFailure(e, 'full sync failed', {terminal: e.statusCode === 403});
386
438
  })
387
439
  .then((res) => {
388
440
  if (isEmpty(res.body)) {
@@ -413,18 +465,32 @@ export default class LocusInfo extends EventsScope {
413
465
  meeting.locusInfo.onFullLocus('classic Locus sync', res.body);
414
466
  })
415
467
  .catch((e) => {
416
- LoggerProxy.logger.info(
417
- `Locus-info:index#doLocusSync --> getLocusDTO succeeded but failed to handle result, locus parser will resume but not all data may be synced (${e.toString()})`
418
- );
468
+ if (!fetchFailed) {
469
+ // The DTO was fetched successfully but applying it failed. Retrying wouldn't help - it
470
+ // would re-fetch and re-apply the same unprocessable DTO and fail identically - so log and
471
+ // resume (swallow the error) instead of propagating it. Propagating here would make the
472
+ // reconnection flow (which treats a rejection as retryable) retry indefinitely.
473
+ LoggerProxy.logger.info(
474
+ `Locus-info:index#doLocusSync --> getLocusDTO succeeded but failed to handle result, locus parser will resume but not all data may be synced (${e.toString()})`
475
+ );
419
476
 
420
- Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_SYNC_HANDLING_FAILED, {
421
- correlationId: meeting.correlationId,
422
- url,
423
- reason: e.message,
424
- errorName: e.name,
425
- stack: e.stack,
426
- code: e.code,
427
- });
477
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_SYNC_HANDLING_FAILED, {
478
+ correlationId: meeting.correlationId,
479
+ url,
480
+ reason: e.message,
481
+ errorName: e.name,
482
+ stack: e.stack,
483
+ code: e.code,
484
+ });
485
+
486
+ return;
487
+ }
488
+
489
+ if (!destroyOnTransientFailure && !meetingDestroyed) {
490
+ // caller-driven sync (e.g. reconnection): propagate a transient fetch failure so it can be
491
+ // retried. If the meeting was destroyed (terminal failure), there's nothing to retry.
492
+ throw e;
493
+ }
428
494
  })
429
495
  .finally(() => {
430
496
  if (!meetingDestroyed) {
@@ -435,6 +501,52 @@ export default class LocusInfo extends EventsScope {
435
501
  });
436
502
  }
437
503
 
504
+ /**
505
+ * Syncs this meeting's Locus state (e.g. after a network reconnection), routing to whichever
506
+ * mechanism the meeting uses (a meeting only ever uses one): hash tree datasets via
507
+ * syncAllHashTreeDatasets() or a standalone Locus DTO fetch for classic meetings.
508
+ * A transient failure preserves the meeting (so the caller can retry); only a terminal failure
509
+ * (e.g. a 403 meaning the meeting has ended) destroys it.
510
+ *
511
+ * The classic path is only needed when Meetings#syncMeetings() can't do its usual
512
+ * getActiveMeetings() fetch (e.g. unverified guests, for whom Locus rejects that call); signed-in
513
+ * users resync classic meetings via getActiveMeetings() and pass canSyncClassicLocus as false.
514
+ *
515
+ * @param {Meeting} meeting
516
+ * @param {Object} options
517
+ * @param {boolean} options.canSyncClassicLocus - whether this sync is allowed to fetch a
518
+ * standalone Locus DTO for classic meetings
519
+ * @param {boolean} options.canSyncHashTree - whether this sync is allowed to sync hash tree
520
+ * datasets for hash tree based meetings
521
+ * @returns {Promise<void>} resolves once the sync (hash tree or classic) completes; for the
522
+ * classic path it rejects only on a transient failure, so the caller can retry (a terminal
523
+ * failure destroys the meeting and resolves)
524
+ */
525
+ async sync(
526
+ meeting: any,
527
+ {canSyncClassicLocus, canSyncHashTree}: {canSyncClassicLocus: boolean; canSyncHashTree: boolean}
528
+ ): Promise<void> {
529
+ if (this.isUsingHashTrees()) {
530
+ // hash tree based meeting: doLocusSync must not be used, sync the hash tree datasets instead
531
+ if (canSyncHashTree) {
532
+ await this.syncAllHashTreeDatasets();
533
+ }
534
+
535
+ return;
536
+ }
537
+
538
+ // classic (non hash tree) meeting: only sync if there's a Locus URL to fetch against, otherwise
539
+ // getLocusDTO() would reject and doLocusSync() would destroy the (e.g. not-yet-joined) meeting
540
+ if (canSyncClassicLocus && meeting.locusUrl) {
541
+ // Pause the parser so in-flight deltas don't race the DTO fetch; doLocusSync() resumes it.
542
+ this.locusParser.pause();
543
+ // destroyOnTransientFailure: false so a transient failure preserves the meeting and rejects,
544
+ // letting the reconnection flow retry instead of tearing the meeting down. A terminal failure
545
+ // (e.g. a 403 meaning the meeting has ended) still destroys the meeting.
546
+ await this.doLocusSync(meeting, false, undefined, {destroyOnTransientFailure: false});
547
+ }
548
+ }
549
+
438
550
  /**
439
551
  * Apply locus delta data to meeting
440
552
  * @param {string} action Locus delta action
@@ -517,7 +629,7 @@ export default class LocusInfo extends EventsScope {
517
629
  this.updateControls(locus.controls, locus.self);
518
630
  this.updateLocusUrl(locus.url, ControlsUtils.isMainSessionDTO(locus));
519
631
  this.updateFullState(locus.fullState);
520
- this.updateMeetingInfo(locus.info);
632
+ this.updateMeetingInfo(locus.info, locus.self);
521
633
  this.updateEmbeddedApps(locus.embeddedApps);
522
634
  // self and participants generate sipUrl for 1:1 meeting
523
635
  this.updateSelf(locus.self);
@@ -526,6 +638,15 @@ export default class LocusInfo extends EventsScope {
526
638
  this.updateLinks(locus.links);
527
639
  }
528
640
 
641
+ /**
642
+ * Whether we expect to receive updates over the LLM connection. This is used by hash tree parsers
643
+ * to decide whether to arm heartbeat watchdog timers for LLM data sets.
644
+ * @returns {boolean}
645
+ */
646
+ private isLlmExpected(): boolean {
647
+ return this.parsedLocus.self?.joinedWith?.state === 'JOINED';
648
+ }
649
+
529
650
  /**
530
651
  * Creates a HashTreeParser instance for a given locusUrl and stores it in the map.
531
652
  * @param {Object} params
@@ -553,9 +674,27 @@ export default class LocusInfo extends EventsScope {
553
674
  initialLocus,
554
675
  metadata,
555
676
  webexRequest: this.webex.request.bind(this.webex),
556
- locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
677
+ callbacks: {
678
+ locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
679
+ syncLatencyTracker: this.callbacks.syncLatencyTracker,
680
+ isLlmExpected: () => this.isLlmExpected(),
681
+ // Reuse webex-core's tracking-id interceptor sequence (exposed publicly via
682
+ // webexTrackingIdSequenceNumbers) so Locus requests share the client's unified
683
+ // ${sessionId}_${sequence} tracking id space instead of minting an unrelated id. Fall
684
+ // back to a uuid on the rare chance the interceptor hasn't issued any request yet (and so
685
+ // isn't in the map). The value is opaque to the metrics layer and is forced onto the
686
+ // /hashtree and /sync request headers.
687
+ generateTrackingId: () => {
688
+ const interceptor = [...webexTrackingIdSequenceNumbers.keys()].find(
689
+ (candidate) => candidate?.webex === this.webex
690
+ );
691
+
692
+ return `${this.webex.sessionId}_${interceptor ? interceptor.sequence : uuid.v4()}`;
693
+ },
694
+ },
557
695
  debugId: `HT-${locusUrl.split('/')?.pop()?.substring(0, 4)}`,
558
696
  excludedDataSets: this.webex.config.meetings.locus?.excludedDataSets,
697
+ syncLatencyMeetingId: this.meetingId,
559
698
  });
560
699
 
561
700
  // When a new HashTreeParser is created, previous one should be stopped.
@@ -581,6 +720,7 @@ export default class LocusInfo extends EventsScope {
581
720
 
582
721
  /**
583
722
  * @param {Object} data - data to initialize locus info with. It may be from a join or GET /loci response or from a Mercury event that triggers a creation of meeting object
723
+ * @param {Function} [onLocusSynced] - optional callback that will be called at the end of initial setup, when locus info is fully synced. It will be called with the full locus snapshot as an argument (which may be null if we haven't received any full locus DTOs during the initial setup, for example in case we receive only hash tree messages without full locus DTOs)
584
724
  * @returns {undefined}
585
725
  * @memberof LocusInfo
586
726
  */
@@ -600,8 +740,10 @@ export default class LocusInfo extends EventsScope {
600
740
  | {
601
741
  trigger: 'get-loci-response';
602
742
  locus?: LocusDTO;
603
- }
743
+ },
744
+ onLocusSynced?: (locus: LocusDTO) => void
604
745
  ) {
746
+ let initialFullLocus: LocusDTO | null = null;
605
747
  switch (data.trigger) {
606
748
  case 'locus-message':
607
749
  if (data.hashTreeMessage) {
@@ -649,6 +791,7 @@ export default class LocusInfo extends EventsScope {
649
791
  case 'join-response':
650
792
  this.updateLocusCache(data.locus);
651
793
  this.onFullLocus('join response', data.locus, undefined, data.dataSets, data.metadata);
794
+ initialFullLocus = data.locus;
652
795
  break;
653
796
  case 'get-loci-response':
654
797
  if (data.locus?.links?.resources?.visibleDataSets?.url) {
@@ -671,52 +814,99 @@ export default class LocusInfo extends EventsScope {
671
814
  // "classic" Locus case, no hash trees involved
672
815
  this.updateLocusCache(data.locus);
673
816
  this.onFullLocus('classic get-loci-response', data.locus, undefined);
817
+ initialFullLocus = data.locus || null;
674
818
  }
675
819
  }
820
+
821
+ if (onLocusSynced) {
822
+ try {
823
+ onLocusSynced(initialFullLocus || this.getCurrentLocusSnapshot());
824
+ } catch (error) {
825
+ LoggerProxy.logger.warn(
826
+ `Locus-info:index#initialSetup --> onLocusSynced callback failed: ${error}`
827
+ );
828
+ }
829
+ }
830
+
676
831
  // Change it to true after it receives it first locus object
677
832
  this.emitChange = true;
678
833
  }
679
834
 
835
+ /**
836
+ * Builds a full locus DTO snapshot from current internal locus state.
837
+ *
838
+ * @returns {LocusDTO}
839
+ */
840
+ private getCurrentLocusSnapshot(): LocusDTO {
841
+ const locus: Record<string, any> = {};
842
+
843
+ LocusDtoTopLevelKeys.forEach((key) => {
844
+ const value = (this as Record<string, any>)[key];
845
+
846
+ if (value !== undefined && value !== null) {
847
+ locus[key] = cloneDeep(value);
848
+ }
849
+ });
850
+
851
+ if (!Array.isArray(locus.participants)) {
852
+ locus.participants = [];
853
+ }
854
+
855
+ return locus as LocusDTO;
856
+ }
857
+
680
858
  /**
681
859
  * Handles HTTP response from Locus API call.
682
860
  * @param {Meeting} meeting meeting object
683
861
  * @param {LocusApiResponseBody} responseBody body of the http response from Locus API call
684
862
  * @returns {void}
685
863
  */
686
- handleLocusAPIResponse(meeting, responseBody: LocusApiResponseBody): void {
864
+ handleLocusAPIResponse(meeting: any, responseBody: LocusApiResponseBody): void {
687
865
  const isWrapped = 'locus' in responseBody;
688
866
  const locusUrl = isWrapped ? responseBody.locus?.url : responseBody.url;
689
867
  const hashTreeParserEntry = locusUrl && this.hashTreeParsers.get(locusUrl);
690
- if (hashTreeParserEntry) {
691
- if (isWrapped) {
692
- if (!responseBody.dataSets) {
693
- this.sendClassicVsHashTreeMismatchMetric(
694
- meeting,
695
- `expected hash tree dataSets in API response but they are missing`
868
+ const locus = isWrapped
869
+ ? (responseBody as {locus: LocusDTO}).locus
870
+ : (responseBody as LocusDTO);
871
+
872
+ if (this.isUsingHashTrees()) {
873
+ // We are in hash tree mode. Check if we need to create/reactivate a parser for this locusUrl.
874
+ if (!hashTreeParserEntry || hashTreeParserEntry.parser.state === 'stopped') {
875
+ if (!locusUrl) {
876
+ LoggerProxy.logger.warn(
877
+ 'Locus-info:index#handleLocusAPIResponse --> API response has no locusUrl, cannot handle hash tree parser switch'
696
878
  );
697
- // continuing as we can still manage without responseBody.dataSets, but this is very suspicious
879
+
880
+ return;
698
881
  }
699
- LoggerProxy.logger.info(
700
- 'Locus-info:index#handleLocusAPIResponse --> passing Locus API response to HashTreeParser: ',
701
- responseBody
702
- );
882
+
883
+ this.handleHashTreeParserSwitchForAPIResponse(locusUrl, locus);
884
+
885
+ return;
886
+ }
887
+
888
+ // Active parser found - pass the API response to it
889
+ if (isWrapped) {
703
890
  // update the data in our hash trees
704
891
  hashTreeParserEntry.parser.handleLocusUpdate(responseBody);
705
892
  } else {
706
- // LocusDTO without wrapper - pass it through as if it had no dataSets
893
+ // LocusDTO without wrapper - pass it through as if it had no dataSets nor metadata
707
894
  hashTreeParserEntry.parser.handleLocusUpdate({locus: responseBody});
708
895
  }
709
- } else {
710
- if (isWrapped && responseBody.dataSets) {
711
- this.sendClassicVsHashTreeMismatchMetric(
712
- meeting,
713
- `unexpected hash tree dataSets in API response`
714
- );
715
- }
716
- // classic Locus delta
717
- const locus = isWrapped ? responseBody.locus : responseBody;
718
- this.handleLocusDelta(locus, meeting);
896
+
897
+ return;
719
898
  }
899
+
900
+ // No hash tree parsers - classic Locus mode
901
+ if (isWrapped && responseBody.dataSets) {
902
+ this.sendClassicVsHashTreeMismatchMetric(
903
+ meeting,
904
+ `unexpected hash tree dataSets in API response`
905
+ );
906
+ }
907
+
908
+ // classic Locus delta
909
+ this.handleLocusDelta(locus, meeting);
720
910
  }
721
911
 
722
912
  /**
@@ -878,14 +1068,22 @@ export default class LocusInfo extends EventsScope {
878
1068
  if (!object.data) {
879
1069
  // self without data is handled inside HashTreeParser and results in LocusInfoUpdateType.MEETING_ENDED, so we should never get here
880
1070
  // all other types info, fullstate, etc - Locus should never send them without data
881
- LoggerProxy.logger.warn(
882
- `Locus-info:index#updateLocusFromHashTreeObject --> received ${type} object without data, this is not expected! version=${object.htMeta.elementId.version}`
1071
+ // but we end up with this method being called without the data for them when the main dataset is removed from visible datasets list
1072
+ LoggerProxy.logger.info(
1073
+ `Locus-info:index#updateLocusFromHashTreeObject --> received ${type} object without data, version=${object.htMeta.elementId.version}`
883
1074
  );
884
1075
  } else {
885
1076
  LoggerProxy.logger.info(
886
1077
  `Locus-info:index#updateLocusFromHashTreeObject --> ${type} object updated to version ${object.htMeta.elementId.version}`
887
1078
  );
888
- const locusDtoKey = ObjectTypeToLocusKeyMap[type];
1079
+
1080
+ if (type === ObjectType.self) {
1081
+ LoggerProxy.logger.info(
1082
+ `Locus-info:index#updateLocusFromHashTreeObject --> self data: removed=${object.data.removed} state=${object.data.state} reason=${object.data.reason}`
1083
+ );
1084
+ }
1085
+
1086
+ const locusDtoKey = ObjectTypeToLocusKeyMap[type] as keyof LocusDTO;
889
1087
  locus[locusDtoKey] = object.data;
890
1088
 
891
1089
  /* Hash tree based webinar attendees don't receive a Participant object for themselves from Locus,
@@ -945,6 +1143,114 @@ export default class LocusInfo extends EventsScope {
945
1143
  }
946
1144
  }
947
1145
 
1146
+ /**
1147
+ * Helper that handles the common logic for reactivating a stopped HashTreeParser when
1148
+ * a newer "replaces" is detected. Used by both the message and API response parser switch methods.
1149
+ *
1150
+ * @param {string} callerName - name of the calling method, used in log messages
1151
+ * @param {string} locusUrl - the locus URL of the stopped parser
1152
+ * @param {HashTreeParserEntry} stoppedEntry - the stopped parser entry
1153
+ * @param {ReplacesInfo} replaces - replacement info extracted from self
1154
+ * @param {Function} resumeCallback - callback to invoke after reactivation to resume the parser
1155
+ * @returns {void}
1156
+ */
1157
+ private resumeStoppedParser(
1158
+ callerName: string,
1159
+ locusUrl: string,
1160
+ stoppedEntry: HashTreeParserEntry,
1161
+ replaces: ReplacesInfo | undefined,
1162
+ resumeCallback: () => void
1163
+ ): void {
1164
+ // this check is just for typescript, it should never happen, replaces should always be defined
1165
+ if (!replaces) {
1166
+ LoggerProxy.logger.info(
1167
+ `Locus-info:index#${callerName} --> received data for stopped HashTreeParser with locusUrl ${locusUrl}, but no replaces info provided, so not re-activating the parser`
1168
+ );
1169
+
1170
+ return;
1171
+ }
1172
+
1173
+ if (replaces.replacedAt <= (stoppedEntry.replacedAt || '')) {
1174
+ LoggerProxy.logger.info(
1175
+ `Locus-info:index#${callerName} --> received data for stopped HashTreeParser with locusUrl ${locusUrl}, but replaces info provided is not newer, so not re-activating the parser`
1176
+ );
1177
+
1178
+ return;
1179
+ }
1180
+
1181
+ LoggerProxy.logger.info(
1182
+ `Locus-info:index#${callerName} --> reactivating HashTreeParser for locusUrl=${locusUrl}, which replaces ${replaces.locusUrl}`
1183
+ );
1184
+
1185
+ const replacedEntry = this.hashTreeParsers.get(replaces.locusUrl);
1186
+
1187
+ if (replacedEntry) {
1188
+ replacedEntry.replacedAt = replaces.replacedAt;
1189
+ replacedEntry.parser.stop();
1190
+ } else {
1191
+ LoggerProxy.logger.warn(
1192
+ `Locus-info:index#${callerName} --> the parser that is supposed to be replaced with the currently reactivated parser is not found, locusUrl=${replaces.locusUrl}`
1193
+ );
1194
+ }
1195
+
1196
+ stoppedEntry.initializedFromHashTree = false;
1197
+ this.hashTreeObjectId2ParticipantId.clear();
1198
+
1199
+ resumeCallback();
1200
+ }
1201
+
1202
+ /**
1203
+ * Handles an API response whose locusUrl doesn't match any active HashTreeParser
1204
+ * (either no entry exists, or the existing entry is stopped).
1205
+ * Creates a new parser or reactivates a stopped one using initializeFromGetLociResponse.
1206
+ *
1207
+ * @param {string} locusUrl - the locus URL from the API response
1208
+ * @param {LocusDTO} locus - the locus DTO from the API response
1209
+ * @returns {void}
1210
+ */
1211
+ private handleHashTreeParserSwitchForAPIResponse(locusUrl: string, locus: LocusDTO): void {
1212
+ const entry = this.hashTreeParsers.get(locusUrl);
1213
+
1214
+ const replaces = getReplaceInfoFromSelf(
1215
+ locus.self,
1216
+ // @ts-ignore
1217
+ this.webex.internal.device.url
1218
+ );
1219
+
1220
+ if (!entry) {
1221
+ LoggerProxy.logger.info(
1222
+ `Locus-info:index#handleHashTreeParserSwitchForAPIResponse --> no parser for locusUrl ${locusUrl}, creating a new one`
1223
+ );
1224
+
1225
+ const parser = this.createHashTreeParser({
1226
+ locusUrl,
1227
+ initialLocus: {locus: null, dataSets: []},
1228
+ metadata: null,
1229
+ replacedAt: replaces?.replacedAt,
1230
+ });
1231
+
1232
+ parser.initializeFromGetLociResponse(locus);
1233
+
1234
+ return;
1235
+ }
1236
+
1237
+ if (entry.parser.state !== 'stopped') {
1238
+ LoggerProxy.logger.warn(
1239
+ `Locus-info:index#handleHashTreeParserSwitchForAPIResponse --> unexpected parser state "${entry.parser.state}" for locusUrl ${locusUrl}`
1240
+ );
1241
+
1242
+ return;
1243
+ }
1244
+
1245
+ this.resumeStoppedParser(
1246
+ 'handleHashTreeParserSwitchForAPIResponse',
1247
+ locusUrl,
1248
+ entry,
1249
+ replaces,
1250
+ () => entry.parser.resumeFromApiResponse(locus)
1251
+ );
1252
+ }
1253
+
948
1254
  /**
949
1255
  * Checks if the hash tree message should trigger a switch to a different HashTreeParser
950
1256
  *
@@ -993,36 +1299,12 @@ export default class LocusInfo extends EventsScope {
993
1299
  if (entry.parser.state === 'stopped') {
994
1300
  // the message matches a stopped parser, we need to check if maybe this is a new "replacement" and we need to re-activate the parser
995
1301
  // this happens when you move from breakout A -> breakout B -> back to breakout A
996
- if (replaces) {
997
- if (replaces.replacedAt > (entry.replacedAt || '')) {
998
- LoggerProxy.logger.info(
999
- `Locus-info:index#handleHashTreeParserSwitch --> resuming a HashTreeParser for locusUrl=${message.locusUrl}, which replaces ${replaces.locusUrl}`
1000
- );
1001
- const replacedEntry = this.hashTreeParsers.get(replaces.locusUrl);
1002
-
1003
- if (replacedEntry) {
1004
- replacedEntry.replacedAt = replaces.replacedAt;
1005
- entry.initializedFromHashTree = false;
1006
- this.hashTreeObjectId2ParticipantId.clear();
1007
-
1008
- replacedEntry.parser.stop();
1009
- entry.parser.resume(message);
1010
- } else {
1011
- LoggerProxy.logger.warn(
1012
- `Locus-info:index#handleHashTreeParserSwitch --> the parser that is supposed to be replaced with the currently resumed parser is not found, locusUrl=${replaces.locusUrl}`
1013
- );
1014
- }
1015
- } else {
1016
- LoggerProxy.logger.info(
1017
- `Locus-info:index#handleHashTreeParserSwitch --> received message for stopped HashTreeParser with locusUrl ${message.locusUrl}, but replaces info provided is not newer, so not re-activating the parser`
1018
- );
1019
- }
1020
-
1021
- return true;
1022
- }
1023
-
1024
- LoggerProxy.logger.info(
1025
- `Locus-info:index#handleHashTreeParserSwitch --> received message for stopped HashTreeParser with locusUrl ${message.locusUrl}, but no replaces info provided, so not re-activating the parser`
1302
+ this.resumeStoppedParser(
1303
+ 'handleHashTreeParserSwitch',
1304
+ message.locusUrl,
1305
+ entry,
1306
+ replaces,
1307
+ () => entry.parser.resumeFromMessage(message)
1026
1308
  );
1027
1309
 
1028
1310
  return true;
@@ -1063,6 +1345,23 @@ export default class LocusInfo extends EventsScope {
1063
1345
  }
1064
1346
  }
1065
1347
 
1348
+ /**
1349
+ * Triggers a sync of all hash tree datasets for all hash tree parsers associated with this meeting.
1350
+ * The syncs are executed sequentially within each parser.
1351
+ *
1352
+ * @param {Object} [options={}] - Options for syncing
1353
+ * @param {boolean} [options.onlyLLM=false] - Whether to sync only LLM based data sets
1354
+ * @returns {Promise<void>}
1355
+ */
1356
+ async syncAllHashTreeDatasets(options: {onlyLLM?: boolean} = {}): Promise<void> {
1357
+ for (const [, entry] of this.hashTreeParsers) {
1358
+ if (entry.parser) {
1359
+ // eslint-disable-next-line no-await-in-loop
1360
+ await entry.parser.syncAllDatasets(options);
1361
+ }
1362
+ }
1363
+ }
1364
+
1066
1365
  /**
1067
1366
  * Callback registered with HashTreeParser to receive locus info updates.
1068
1367
  * Updates our locus info based on the data parsed by the hash tree parser.
@@ -1189,6 +1488,21 @@ export default class LocusInfo extends EventsScope {
1189
1488
  );
1190
1489
  this.webex.meetings.destroy(meeting, MEETING_REMOVED_REASON.SELF_REMOVED);
1191
1490
  }
1491
+ break;
1492
+ }
1493
+
1494
+ case LocusInfoUpdateType.LOCUS_NOT_FOUND: {
1495
+ LoggerProxy.logger.info(
1496
+ `Locus-info:index#updateFromHashTree --> received LOCUS_NOT_FOUND for ${locusUrl}, triggering syncMeetings`
1497
+ );
1498
+ this.webex.meetings
1499
+ .syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: true})
1500
+ .catch((syncError) => {
1501
+ LoggerProxy.logger.error(
1502
+ `Locus-info:index#updateFromHashTree --> syncMeetings failed after LOCUS_NOT_FOUND: ${syncError}`
1503
+ );
1504
+ });
1505
+ break;
1192
1506
  }
1193
1507
  }
1194
1508
  }
@@ -1200,12 +1514,18 @@ export default class LocusInfo extends EventsScope {
1200
1514
  * @memberof LocusInfo
1201
1515
  */
1202
1516
  parse(meeting: any, data: any) {
1203
- if (this.hashTreeParsers.size > 0) {
1204
- this.handleHashTreeMessage(
1205
- meeting,
1206
- data.eventType,
1207
- data.stateElementsMessage as HashTreeMessage
1208
- );
1517
+ if (this.isUsingHashTrees()) {
1518
+ if (data.eventType === LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS) {
1519
+ // sync meetings response follows the format of "not wrapped" locus API responses,
1520
+ // so has no dataSets nor Metadata
1521
+ this.handleLocusAPIResponse(meeting, {...data.locus});
1522
+ } else {
1523
+ this.handleHashTreeMessage(
1524
+ meeting,
1525
+ data.eventType,
1526
+ data.stateElementsMessage as HashTreeMessage
1527
+ );
1528
+ }
1209
1529
  } else {
1210
1530
  const {eventType} = data;
1211
1531
 
@@ -1506,7 +1826,7 @@ export default class LocusInfo extends EventsScope {
1506
1826
  * @memberof LocusInfo
1507
1827
  */
1508
1828
  updateLocusInfo(locus) {
1509
- if (locus.self?.reason === 'MOVED' && locus.self?.state === 'LEFT') {
1829
+ if (MeetingsUtil.isSelfMovedOrBreakoutEnded(locus)) {
1510
1830
  // When moved to a breakout session locus sends a message for the previous locus
1511
1831
  // indicating that we have been moved. It isn't helpful to continue parsing this
1512
1832
  // as it gets interpreted as if we have left the call
@@ -1570,7 +1890,7 @@ export default class LocusInfo extends EventsScope {
1570
1890
  // @ts-ignore
1571
1891
  const partner = this.getLocusPartner(this.participants, this.self);
1572
1892
 
1573
- this.updateMeeting({partner});
1893
+ this.callbacks.updateMeeting({partner});
1574
1894
 
1575
1895
  // Check if guest user needs to be checked here
1576
1896
 
@@ -1591,8 +1911,19 @@ export default class LocusInfo extends EventsScope {
1591
1911
  options: {
1592
1912
  meetingId: this.meetingId,
1593
1913
  },
1914
+ payload: {
1915
+ eventData: {
1916
+ joinInProgress: this.destroyMeetingSuspended,
1917
+ },
1918
+ },
1594
1919
  });
1595
1920
 
1921
+ if (this.destroyMeetingSuspended) {
1922
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED, {
1923
+ meetingId: this.meetingId,
1924
+ reason: 'CALL_INACTIVE',
1925
+ });
1926
+ }
1596
1927
  this.emitScoped(
1597
1928
  {
1598
1929
  file: 'locus-info',
@@ -1617,7 +1948,18 @@ export default class LocusInfo extends EventsScope {
1617
1948
  options: {
1618
1949
  meetingId: this.meetingId,
1619
1950
  },
1951
+ payload: {
1952
+ eventData: {
1953
+ joinInProgress: this.destroyMeetingSuspended,
1954
+ },
1955
+ },
1620
1956
  });
1957
+ if (this.destroyMeetingSuspended) {
1958
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED, {
1959
+ meetingId: this.meetingId,
1960
+ reason: 'PARTNER_LEFT',
1961
+ });
1962
+ }
1621
1963
  this.emitScoped(
1622
1964
  {
1623
1965
  file: 'locus-info',
@@ -1644,8 +1986,19 @@ export default class LocusInfo extends EventsScope {
1644
1986
  options: {
1645
1987
  meetingId: this.meetingId,
1646
1988
  },
1989
+ payload: {
1990
+ eventData: {
1991
+ joinInProgress: this.destroyMeetingSuspended,
1992
+ },
1993
+ },
1647
1994
  });
1648
1995
 
1996
+ if (this.destroyMeetingSuspended) {
1997
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED, {
1998
+ meetingId: this.meetingId,
1999
+ reason: 'SELF_LEFT',
2000
+ });
2001
+ }
1649
2002
  this.emitScoped(
1650
2003
  {
1651
2004
  file: 'locus-info',
@@ -1659,56 +2012,82 @@ export default class LocusInfo extends EventsScope {
1659
2012
  );
1660
2013
  }
1661
2014
  } else if (this.parsedLocus.fullState?.type === _MEETING_) {
1662
- if (
1663
- this.fullState &&
1664
- (this.fullState.state === LOCUS.STATE.INACTIVE ||
2015
+ if (this.fullState && MeetingsUtil.isWholeMeetingEnded(this.fullState)) {
2016
+ if (this.destroyMeetingSuspended) {
2017
+ LoggerProxy.logger.info(
2018
+ 'Locus-info:index#isMeetingActive --> suppressing DESTROY_MEETING (MEETING_INACTIVE_TERMINATING) because destroyMeeting is suspended'
2019
+ );
2020
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED, {
2021
+ meetingId: this.meetingId,
2022
+ reason: 'MEETING_INACTIVE_TERMINATING',
2023
+ });
2024
+ } else {
2025
+ LoggerProxy.logger.warn(
2026
+ 'Locus-info:index#isMeetingActive --> Meeting is ending due to inactive'
2027
+ );
2028
+
1665
2029
  // @ts-ignore
1666
- this.fullState.state === LOCUS.STATE.TERMINATING)
1667
- ) {
1668
- LoggerProxy.logger.warn(
1669
- 'Locus-info:index#isMeetingActive --> Meeting is ending due to inactive or terminating'
1670
- );
2030
+ this.webex.internal.newMetrics.submitClientEvent({
2031
+ name: 'client.call.remote-ended',
2032
+ options: {
2033
+ meetingId: this.meetingId,
2034
+ },
2035
+ });
1671
2036
 
1672
- // @ts-ignore
1673
- this.webex.internal.newMetrics.submitClientEvent({
1674
- name: 'client.call.remote-ended',
1675
- options: {
1676
- meetingId: this.meetingId,
1677
- },
1678
- });
1679
- this.emitScoped(
1680
- {
1681
- file: 'locus-info',
1682
- function: 'isMeetingActive',
1683
- },
1684
- EVENTS.DESTROY_MEETING,
1685
- {
1686
- reason: MEETING_REMOVED_REASON.MEETING_INACTIVE_TERMINATING,
1687
- shouldLeave: false,
1688
- }
1689
- );
2037
+ this.emitScoped(
2038
+ {
2039
+ file: 'locus-info',
2040
+ function: 'isMeetingActive',
2041
+ },
2042
+ EVENTS.DESTROY_MEETING,
2043
+ {
2044
+ reason: MEETING_REMOVED_REASON.MEETING_INACTIVE_TERMINATING,
2045
+ shouldLeave: false,
2046
+ }
2047
+ );
2048
+ }
1690
2049
  }
1691
2050
  // If you are guest and you are removed from the meeting
1692
2051
  // You wont get any further events
1693
2052
  else if (this.parsedLocus.self && this.parsedLocus.self.removed) {
1694
- // Check if we need to send an event
1695
- this.emitScoped(
1696
- {
1697
- file: 'locus-info',
1698
- function: 'isMeetingActive',
1699
- },
1700
- EVENTS.DESTROY_MEETING,
1701
- {
1702
- reason: MEETING_REMOVED_REASON.SELF_REMOVED,
1703
- shouldLeave: false,
1704
- }
1705
- );
2053
+ if (this.destroyMeetingSuspended) {
2054
+ LoggerProxy.logger.info(
2055
+ 'Locus-info:index#isMeetingActive --> suppressing DESTROY_MEETING (SELF_REMOVED) because destroyMeeting is suspended'
2056
+ );
2057
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED, {
2058
+ meetingId: this.meetingId,
2059
+ reason: 'SELF_REMOVED',
2060
+ });
2061
+ } else {
2062
+ this.emitScoped(
2063
+ {
2064
+ file: 'locus-info',
2065
+ function: 'isMeetingActive',
2066
+ },
2067
+ EVENTS.DESTROY_MEETING,
2068
+ {
2069
+ reason: MEETING_REMOVED_REASON.SELF_REMOVED,
2070
+ shouldLeave: false,
2071
+ }
2072
+ );
2073
+ }
1706
2074
  }
1707
2075
  } else {
1708
2076
  LoggerProxy.logger.warn('Locus-info:index#isMeetingActive --> Meeting Type is unknown.');
1709
2077
  }
1710
2078
  }
1711
2079
 
2080
+ /**
2081
+ * Suspends or resumes the emission of DESTROY_MEETING events in certain situations.
2082
+ * Used by joinWithMedia to prevent meeting destruction during retry flows.
2083
+ * @param {boolean} suspend - true to suppress, false to resume
2084
+ * @returns {undefined}
2085
+ * @memberof LocusInfo
2086
+ */
2087
+ suspendDestroyMeeting(suspend: boolean) {
2088
+ this.destroyMeetingSuspended = suspend;
2089
+ }
2090
+
1712
2091
  /**
1713
2092
  * checks if the host permissions have changed while in the meeting
1714
2093
  * This would be the case if your role as host or moderator has been updated
@@ -1929,6 +2308,8 @@ export default class LocusInfo extends EventsScope {
1929
2308
  state,
1930
2309
  modifiedBy: current.record.modifiedBy,
1931
2310
  lastModified: current.record.lastModified,
2311
+ modifiedByServiceAppName: current.record.modifiedByServiceAppName,
2312
+ modifiedByServiceAppId: current.record.modifiedByServiceAppId,
1932
2313
  }
1933
2314
  );
1934
2315
  }
@@ -2058,7 +2439,7 @@ export default class LocusInfo extends EventsScope {
2058
2439
  if (hasEntryExitToneChanged) {
2059
2440
  const {entryExitTone} = current;
2060
2441
 
2061
- this.updateMeeting({entryExitTone});
2442
+ this.callbacks.updateMeeting({entryExitTone});
2062
2443
 
2063
2444
  this.emitScoped(
2064
2445
  {
@@ -2077,7 +2458,7 @@ export default class LocusInfo extends EventsScope {
2077
2458
  if (hasVideoEnabledChanged) {
2078
2459
  const {videoEnabled} = current;
2079
2460
 
2080
- this.updateMeeting({unmuteVideoAllowed: videoEnabled});
2461
+ this.callbacks.updateMeeting({unmuteVideoAllowed: videoEnabled});
2081
2462
 
2082
2463
  this.emitScoped(
2083
2464
  {
@@ -2169,14 +2550,14 @@ export default class LocusInfo extends EventsScope {
2169
2550
  updateConversationUrl(conversationUrl: string, info: any) {
2170
2551
  if (conversationUrl && !isEqual(this.conversationUrl, conversationUrl)) {
2171
2552
  this.conversationUrl = conversationUrl;
2172
- this.updateMeeting({conversationUrl});
2553
+ this.callbacks.updateMeeting({conversationUrl});
2173
2554
  } else if (
2174
2555
  info &&
2175
2556
  info.conversationUrl &&
2176
2557
  !isEqual(this.conversationUrl, info.conversationUrl)
2177
2558
  ) {
2178
2559
  this.conversationUrl = info.conversationUrl;
2179
- this.updateMeeting({conversationUrl: info.conversationUrl});
2560
+ this.callbacks.updateMeeting({conversationUrl: info.conversationUrl});
2180
2561
  }
2181
2562
  }
2182
2563
 
@@ -2238,7 +2619,7 @@ export default class LocusInfo extends EventsScope {
2238
2619
  if (fullState && !isEqual(this.fullState, fullState)) {
2239
2620
  const result = FullState.getFullState(this.fullState, fullState);
2240
2621
 
2241
- this.updateMeeting(result.current);
2622
+ this.callbacks.updateMeeting(result.current);
2242
2623
 
2243
2624
  if (result.updates.meetingStateChangedTo) {
2244
2625
  this.emitScoped(
@@ -2282,7 +2663,7 @@ export default class LocusInfo extends EventsScope {
2282
2663
  if (host && !isEqual(this.host, host)) {
2283
2664
  const parsedHosts = HostUtils.getHosts(this.host, host);
2284
2665
 
2285
- this.updateMeeting(parsedHosts.current);
2666
+ this.callbacks.updateMeeting(parsedHosts.current);
2286
2667
  this.parsedLocus.host = parsedHosts.current;
2287
2668
  if (parsedHosts.updates.isNewHost) {
2288
2669
  this.compareAndUpdateFlags.compareSelfAndHost = true;
@@ -2312,9 +2693,19 @@ export default class LocusInfo extends EventsScope {
2312
2693
  */
2313
2694
  updateMeetingInfo(info: object, self?: object) {
2314
2695
  const roles = self ? SelfUtils.getRoles(self) : this.parsedLocus.self?.roles || [];
2315
- if ((info && !isEqual(this.info, info)) || (!isEqual(this.roles, roles) && info)) {
2316
- const isJoined = SelfUtils.isJoined(self || this.parsedLocus.self);
2317
- const parsedInfo = InfoUtils.getInfos(this.parsedLocus.info, info, roles, isJoined);
2696
+ const isJoined = SelfUtils.isJoined(self || this.parsedLocus.self);
2697
+
2698
+ // The parsed userDisplayHints depend on info, roles and isJoined, so we must recompute
2699
+ // whenever any of them changes. A common case is self transitioning to JOINED via a delta
2700
+ // that doesn't carry an info section - in that case we fall back to the previously stored
2701
+ // info so the hints get reparsed with the new joined state (e.g. VIEW_THE_PARTICIPANT_LIST).
2702
+ const infoToParse = info || this.info;
2703
+ const infoChanged = info && !isEqual(this.info, info);
2704
+ const rolesChanged = !isEqual(this.roles, roles);
2705
+ const isJoinedChanged = SelfUtils.isJoined(this.parsedLocus.self) !== isJoined;
2706
+
2707
+ if (infoToParse && (infoChanged || rolesChanged || isJoinedChanged)) {
2708
+ const parsedInfo = InfoUtils.getInfos(this.parsedLocus.info, infoToParse, roles, isJoined);
2318
2709
 
2319
2710
  if (parsedInfo.updates.isLocked) {
2320
2711
  this.emitScoped(
@@ -2337,10 +2728,10 @@ export default class LocusInfo extends EventsScope {
2337
2728
  );
2338
2729
  }
2339
2730
 
2340
- this.info = info;
2731
+ this.info = infoToParse;
2341
2732
  this.parsedLocus.info = parsedInfo.current;
2342
2733
  // Parses the info and adds necessary values
2343
- this.updateMeeting(parsedInfo.current);
2734
+ this.callbacks.updateMeeting(parsedInfo.current);
2344
2735
 
2345
2736
  this.emitScoped(
2346
2737
  {
@@ -2369,7 +2760,7 @@ export default class LocusInfo extends EventsScope {
2369
2760
 
2370
2761
  const parsedEmbeddedApps = EmbeddedAppsUtils.parse(embeddedApps);
2371
2762
 
2372
- this.updateMeeting({embeddedApps: parsedEmbeddedApps});
2763
+ this.callbacks.updateMeeting({embeddedApps: parsedEmbeddedApps});
2373
2764
 
2374
2765
  this.emitScoped(
2375
2766
  {
@@ -2394,7 +2785,7 @@ export default class LocusInfo extends EventsScope {
2394
2785
  if (mediaShares && (!isEqual(this.mediaShares, mediaShares) || forceUpdate)) {
2395
2786
  const parsedMediaShares = MediaSharesUtils.getMediaShares(this.mediaShares, mediaShares);
2396
2787
 
2397
- this.updateMeeting(parsedMediaShares.current);
2788
+ this.callbacks.updateMeeting(parsedMediaShares.current);
2398
2789
  this.parsedLocus.mediaShares = parsedMediaShares.current;
2399
2790
  this.mediaShares = mediaShares;
2400
2791
  this.emitScoped(
@@ -2432,6 +2823,7 @@ export default class LocusInfo extends EventsScope {
2432
2823
  */
2433
2824
  updateSelf(self: any) {
2434
2825
  if (self) {
2826
+ const wasLlmExpected = this.isLlmExpected();
2435
2827
  // @ts-ignore
2436
2828
  const parsedSelves = SelfUtils.getSelves(
2437
2829
  this.parsedLocus.self,
@@ -2440,7 +2832,7 @@ export default class LocusInfo extends EventsScope {
2440
2832
  this.participants // using this.participants instead of locus.participants here, because with delta DTOs locus.participants will only contain a small subset of participants
2441
2833
  );
2442
2834
 
2443
- this.updateMeeting(parsedSelves.current);
2835
+ this.callbacks.updateMeeting(parsedSelves.current);
2444
2836
  this.parsedLocus.self = parsedSelves.current;
2445
2837
 
2446
2838
  const element = this.parsedLocus.states[this.parsedLocus.states.length - 1];
@@ -2458,7 +2850,7 @@ export default class LocusInfo extends EventsScope {
2458
2850
  );
2459
2851
 
2460
2852
  if (result?.sipUri) {
2461
- this.updateMeeting(result);
2853
+ this.callbacks.updateMeeting(result);
2462
2854
  }
2463
2855
 
2464
2856
  if (parsedSelves.updates.moderatorChanged) {
@@ -2585,6 +2977,7 @@ export default class LocusInfo extends EventsScope {
2585
2977
  {
2586
2978
  muted: parsedSelves.current.remoteMuted,
2587
2979
  unmuteAllowed: parsedSelves.current.unmuteAllowed,
2980
+ modifiedBy: parsedSelves.current.modifiedBy ?? null,
2588
2981
  }
2589
2982
  );
2590
2983
  }
@@ -2710,6 +3103,15 @@ export default class LocusInfo extends EventsScope {
2710
3103
  this.parsedLocus.self = parsedSelves.current;
2711
3104
  // @ts-ignore
2712
3105
  this.self = self;
3106
+
3107
+ // If LLM just became expected (self reported JOINED), some hash tree parsers may have skipped
3108
+ // arming heartbeat watchdog timers for LLM data sets whose messages arrived before this
3109
+ // update. Re-evaluate them now so those watchdogs get armed.
3110
+ if (!wasLlmExpected && this.isLlmExpected()) {
3111
+ this.hashTreeParsers.forEach((entry) => {
3112
+ entry.parser.reevaluateLlmWatchdogs();
3113
+ });
3114
+ }
2713
3115
  } else {
2714
3116
  this.compareAndUpdateFlags.compareHostAndSelf = false;
2715
3117
  }
@@ -2725,7 +3127,7 @@ export default class LocusInfo extends EventsScope {
2725
3127
  updateLocusUrl(url: string, isMainLocus = true) {
2726
3128
  if (url && this.url !== url) {
2727
3129
  this.url = url;
2728
- this.updateMeeting({locusUrl: url});
3130
+ this.callbacks.updateMeeting({locusUrl: url});
2729
3131
  this.emitScoped(
2730
3132
  {
2731
3133
  file: 'locus-info',