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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/.sdd/manifest.json +1312 -0
  2. package/.sdd/templates/.source.json +30 -0
  3. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
  4. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
  5. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
  6. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
  7. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
  8. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
  9. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
  10. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
  11. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
  12. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
  13. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
  14. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
  15. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
  16. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
  17. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
  18. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
  19. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
  20. package/.sdd/templates/component-repo/template-map.json +112 -0
  21. package/AGENTS.md +135 -0
  22. package/ai-docs/ARCHITECTURE.md +207 -0
  23. package/ai-docs/CONTRACTS.md +267 -0
  24. package/ai-docs/DATA_MODEL.md +64 -0
  25. package/ai-docs/GETTING_STARTED.md +73 -0
  26. package/ai-docs/GLOSSARY.md +56 -0
  27. package/ai-docs/REVIEW_CHECKLIST.md +45 -0
  28. package/ai-docs/RULES.md +79 -0
  29. package/ai-docs/SECURITY.md +74 -0
  30. package/ai-docs/SERVICE_STATE.md +59 -0
  31. package/ai-docs/SPEC_INDEX.md +85 -0
  32. package/ai-docs/TEST_INDEX.md +45 -0
  33. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
  34. package/ai-docs/patterns/defensive-error-propagation.md +55 -0
  35. package/ai-docs/patterns/event-scope-emission.md +46 -0
  36. package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
  37. package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
  38. package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
  39. package/dist/aiEnableRequest/index.js +15 -2
  40. package/dist/aiEnableRequest/index.js.map +1 -1
  41. package/dist/annotation/index.js +2 -2
  42. package/dist/annotation/index.js.map +1 -1
  43. package/dist/breakouts/breakout.js +8 -3
  44. package/dist/breakouts/breakout.js.map +1 -1
  45. package/dist/breakouts/events.js +29 -14
  46. package/dist/breakouts/events.js.map +1 -1
  47. package/dist/breakouts/index.js +99 -4
  48. package/dist/breakouts/index.js.map +1 -1
  49. package/dist/common/errors/webex-errors.js +49 -5
  50. package/dist/common/errors/webex-errors.js.map +1 -1
  51. package/dist/config.js +2 -2
  52. package/dist/config.js.map +1 -1
  53. package/dist/constants.js +37 -10
  54. package/dist/constants.js.map +1 -1
  55. package/dist/controls-options-manager/index.js +46 -10
  56. package/dist/controls-options-manager/index.js.map +1 -1
  57. package/dist/hashTree/constants.js +4 -1
  58. package/dist/hashTree/constants.js.map +1 -1
  59. package/dist/hashTree/hashTreeParser.js +1096 -391
  60. package/dist/hashTree/hashTreeParser.js.map +1 -1
  61. package/dist/hashTree/utils.js +20 -0
  62. package/dist/hashTree/utils.js.map +1 -1
  63. package/dist/index.js +7 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  66. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  67. package/dist/interceptors/locusRetry.js +23 -8
  68. package/dist/interceptors/locusRetry.js.map +1 -1
  69. package/dist/interpretation/index.js +55 -12
  70. package/dist/interpretation/index.js.map +1 -1
  71. package/dist/interpretation/interpretation.types.js +7 -0
  72. package/dist/interpretation/interpretation.types.js.map +1 -0
  73. package/dist/interpretation/siLanguage.js +1 -1
  74. package/dist/locus-info/controlsUtils.js +4 -1
  75. package/dist/locus-info/controlsUtils.js.map +1 -1
  76. package/dist/locus-info/index.js +615 -176
  77. package/dist/locus-info/index.js.map +1 -1
  78. package/dist/locus-info/infoUtils.js +36 -5
  79. package/dist/locus-info/infoUtils.js.map +1 -1
  80. package/dist/locus-info/types.js +20 -0
  81. package/dist/locus-info/types.js.map +1 -1
  82. package/dist/media/MediaConnectionAwaiter.js +15 -2
  83. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  84. package/dist/media/index.js +8 -2
  85. package/dist/media/index.js.map +1 -1
  86. package/dist/media/properties.js +4 -5
  87. package/dist/media/properties.js.map +1 -1
  88. package/dist/meeting/in-meeting-actions.js +7 -1
  89. package/dist/meeting/in-meeting-actions.js.map +1 -1
  90. package/dist/meeting/index.js +1684 -835
  91. package/dist/meeting/index.js.map +1 -1
  92. package/dist/meeting/locusMediaRequest.js +229 -82
  93. package/dist/meeting/locusMediaRequest.js.map +1 -1
  94. package/dist/meeting/muteState.js +10 -1
  95. package/dist/meeting/muteState.js.map +1 -1
  96. package/dist/meeting/request.js +5 -2
  97. package/dist/meeting/request.js.map +1 -1
  98. package/dist/meeting/util.js +37 -3
  99. package/dist/meeting/util.js.map +1 -1
  100. package/dist/meeting/voicea-meeting.js +2 -1
  101. package/dist/meeting/voicea-meeting.js.map +1 -1
  102. package/dist/meeting-info/meeting-info-v2.js +9 -3
  103. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  104. package/dist/meetings/index.js +300 -128
  105. package/dist/meetings/index.js.map +1 -1
  106. package/dist/meetings/meetings.types.js +6 -1
  107. package/dist/meetings/meetings.types.js.map +1 -1
  108. package/dist/meetings/request.js +39 -0
  109. package/dist/meetings/request.js.map +1 -1
  110. package/dist/meetings/util.js +116 -18
  111. package/dist/meetings/util.js.map +1 -1
  112. package/dist/member/index.js +10 -0
  113. package/dist/member/index.js.map +1 -1
  114. package/dist/member/types.js.map +1 -1
  115. package/dist/member/util.js +30 -0
  116. package/dist/member/util.js.map +1 -1
  117. package/dist/members/index.js +101 -43
  118. package/dist/members/index.js.map +1 -1
  119. package/dist/members/util.js +8 -1
  120. package/dist/members/util.js.map +1 -1
  121. package/dist/metrics/constants.js +7 -1
  122. package/dist/metrics/constants.js.map +1 -1
  123. package/dist/multistream/codec/constants.js +63 -0
  124. package/dist/multistream/codec/constants.js.map +1 -0
  125. package/dist/multistream/mediaRequestManager.js +62 -15
  126. package/dist/multistream/mediaRequestManager.js.map +1 -1
  127. package/dist/multistream/receiveSlot.js +9 -0
  128. package/dist/multistream/receiveSlot.js.map +1 -1
  129. package/dist/reachability/clusterReachability.js.map +1 -1
  130. package/dist/reachability/index.js +121 -83
  131. package/dist/reachability/index.js.map +1 -1
  132. package/dist/reachability/reachability.types.js +2 -0
  133. package/dist/reachability/reachability.types.js.map +1 -1
  134. package/dist/reachability/util.js +45 -0
  135. package/dist/reachability/util.js.map +1 -1
  136. package/dist/reactions/reactions.type.js.map +1 -1
  137. package/dist/recording-controller/index.js +1 -3
  138. package/dist/recording-controller/index.js.map +1 -1
  139. package/dist/roap/turnDiscovery.js +8 -1
  140. package/dist/roap/turnDiscovery.js.map +1 -1
  141. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  142. package/dist/types/config.d.ts +2 -2
  143. package/dist/types/constants.d.ts +13 -1
  144. package/dist/types/controls-options-manager/index.d.ts +16 -0
  145. package/dist/types/hashTree/constants.d.ts +1 -0
  146. package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
  147. package/dist/types/hashTree/utils.d.ts +7 -0
  148. package/dist/types/index.d.ts +3 -0
  149. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  150. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  151. package/dist/types/locus-info/index.d.ts +106 -8
  152. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  153. package/dist/types/locus-info/types.d.ts +22 -1
  154. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  155. package/dist/types/media/properties.d.ts +6 -2
  156. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  157. package/dist/types/meeting/index.d.ts +176 -11
  158. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  159. package/dist/types/meeting/request.d.ts +1 -0
  160. package/dist/types/meeting/util.d.ts +9 -0
  161. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  162. package/dist/types/meetings/index.d.ts +40 -19
  163. package/dist/types/meetings/meetings.types.d.ts +15 -0
  164. package/dist/types/meetings/request.d.ts +14 -0
  165. package/dist/types/member/index.d.ts +1 -0
  166. package/dist/types/member/types.d.ts +1 -0
  167. package/dist/types/member/util.d.ts +9 -0
  168. package/dist/types/members/index.d.ts +15 -2
  169. package/dist/types/members/util.d.ts +1 -5
  170. package/dist/types/metrics/constants.d.ts +6 -0
  171. package/dist/types/multistream/codec/constants.d.ts +7 -0
  172. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  173. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  174. package/dist/types/reachability/index.d.ts +10 -3
  175. package/dist/types/reachability/reachability.types.d.ts +7 -0
  176. package/dist/types/reachability/util.d.ts +17 -0
  177. package/dist/types/reactions/reactions.type.d.ts +3 -0
  178. package/dist/webinar/index.js +307 -161
  179. package/dist/webinar/index.js.map +1 -1
  180. package/package.json +23 -23
  181. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  182. package/src/aiEnableRequest/index.ts +16 -0
  183. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  184. package/src/annotation/index.ts +6 -4
  185. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  186. package/src/breakouts/breakout.ts +3 -1
  187. package/src/breakouts/events.ts +33 -11
  188. package/src/breakouts/index.ts +122 -2
  189. package/src/common/errors/webex-errors.ts +50 -3
  190. package/src/config.ts +2 -2
  191. package/src/constants.ts +21 -3
  192. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  193. package/src/controls-options-manager/index.ts +62 -10
  194. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  195. package/src/hashTree/constants.ts +7 -0
  196. package/src/hashTree/hashTreeParser.ts +861 -193
  197. package/src/hashTree/utils.ts +19 -0
  198. package/src/index.ts +6 -0
  199. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  200. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  201. package/src/interceptors/locusRetry.ts +25 -4
  202. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  203. package/src/interpretation/index.ts +65 -10
  204. package/src/interpretation/interpretation.types.ts +11 -0
  205. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  206. package/src/locus-info/controlsUtils.ts +3 -1
  207. package/src/locus-info/index.ts +566 -164
  208. package/src/locus-info/infoUtils.ts +41 -6
  209. package/src/locus-info/types.ts +26 -1
  210. package/src/media/MediaConnectionAwaiter.ts +21 -4
  211. package/src/media/ai-docs/media-spec.md +267 -0
  212. package/src/media/index.ts +10 -1
  213. package/src/media/properties.ts +8 -3
  214. package/src/meeting/ai-docs/meeting-spec.md +401 -0
  215. package/src/meeting/in-meeting-actions.ts +12 -0
  216. package/src/meeting/index.ts +937 -119
  217. package/src/meeting/locusMediaRequest.ts +106 -6
  218. package/src/meeting/muteState.ts +10 -1
  219. package/src/meeting/request.ts +11 -0
  220. package/src/meeting/util.ts +51 -7
  221. package/src/meeting/voicea-meeting.ts +1 -1
  222. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  223. package/src/meeting-info/meeting-info-v2.ts +10 -4
  224. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  225. package/src/meetings/index.ts +200 -80
  226. package/src/meetings/meetings.types.ts +19 -0
  227. package/src/meetings/request.ts +43 -0
  228. package/src/meetings/util.ts +117 -4
  229. package/src/member/ai-docs/member-spec.md +196 -0
  230. package/src/member/index.ts +10 -0
  231. package/src/member/types.ts +1 -0
  232. package/src/member/util.ts +29 -0
  233. package/src/members/ai-docs/members-spec.md +256 -0
  234. package/src/members/index.ts +70 -7
  235. package/src/members/util.ts +12 -4
  236. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  237. package/src/metrics/constants.ts +6 -0
  238. package/src/multistream/ai-docs/multistream-spec.md +292 -0
  239. package/src/multistream/codec/constants.ts +58 -0
  240. package/src/multistream/mediaRequestManager.ts +119 -28
  241. package/src/multistream/receiveSlot.ts +18 -0
  242. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  243. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  244. package/src/reachability/clusterReachability.ts +3 -2
  245. package/src/reachability/index.ts +47 -16
  246. package/src/reachability/reachability.types.ts +11 -0
  247. package/src/reachability/util.ts +36 -0
  248. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  249. package/src/reactions/reactions.type.ts +3 -0
  250. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  251. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  252. package/src/recording-controller/index.ts +1 -2
  253. package/src/roap/ai-docs/roap-spec.md +241 -0
  254. package/src/roap/turnDiscovery.ts +9 -1
  255. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  256. package/src/webinar/index.ts +216 -38
  257. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  258. package/test/unit/spec/annotation/index.ts +3 -3
  259. package/test/unit/spec/breakouts/breakout.ts +9 -3
  260. package/test/unit/spec/breakouts/events.ts +120 -2
  261. package/test/unit/spec/breakouts/index.ts +223 -3
  262. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  263. package/test/unit/spec/controls-options-manager/index.js +139 -32
  264. package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
  265. package/test/unit/spec/hashTree/utils.ts +37 -0
  266. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  267. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  268. package/test/unit/spec/interpretation/index.ts +119 -4
  269. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  270. package/test/unit/spec/locus-info/index.js +1014 -58
  271. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  272. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  273. package/test/unit/spec/media/index.ts +92 -0
  274. package/test/unit/spec/media/properties.ts +23 -23
  275. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  276. package/test/unit/spec/meeting/index.js +2811 -117
  277. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  278. package/test/unit/spec/meeting/muteState.js +81 -0
  279. package/test/unit/spec/meeting/request.js +12 -0
  280. package/test/unit/spec/meeting/utils.js +179 -16
  281. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  282. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  283. package/test/unit/spec/meetings/index.js +544 -49
  284. package/test/unit/spec/meetings/request.js +141 -0
  285. package/test/unit/spec/meetings/utils.js +402 -51
  286. package/test/unit/spec/member/index.js +7 -0
  287. package/test/unit/spec/member/util.js +89 -0
  288. package/test/unit/spec/members/index.js +216 -0
  289. package/test/unit/spec/members/request.js +37 -1
  290. package/test/unit/spec/members/utils.js +63 -0
  291. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  292. package/test/unit/spec/reachability/index.ts +128 -46
  293. package/test/unit/spec/reachability/util.ts +31 -0
  294. package/test/unit/spec/recording-controller/index.js +9 -8
  295. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  296. package/test/unit/spec/webinar/index.ts +332 -31
@@ -21,8 +21,9 @@ exports.createLocusFromHashTreeMessage = createLocusFromHashTreeMessage;
21
21
  exports.default = void 0;
22
22
  exports.findMeetingForHashTreeMessage = findMeetingForHashTreeMessage;
23
23
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
24
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
25
24
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
25
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
26
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
26
27
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
27
28
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
28
29
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
@@ -32,10 +33,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
32
33
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
33
34
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
34
35
  var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
36
+ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
35
37
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
36
38
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
37
- var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
38
39
  var _lodash = require("lodash");
40
+ var _uuid = _interopRequireDefault(require("uuid"));
41
+ var _webexCore = require("@webex/webex-core");
39
42
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
40
43
  var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
41
44
  var _constants = require("../constants");
@@ -53,7 +56,7 @@ var _hashTreeParser2 = _interopRequireWildcard(require("../hashTree/hashTreePars
53
56
  var _types = require("../hashTree/types");
54
57
  var _utils = require("../hashTree/utils");
55
58
  var _util = _interopRequireDefault(require("../meetings/util"));
56
- function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
59
+ function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
57
60
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
58
61
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
59
62
  function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -76,7 +79,7 @@ var LocusObjectStateAfterUpdates = {
76
79
  * Gets the replacement information
77
80
  *
78
81
  * @param {any} self - "self" object from Locus DTO
79
- * @param {string} deviceUrl - The URL of the user's device
82
+ * @param {string} deviceUrl - The URL of the specified device
80
83
  * @returns {any} The replace information if available, otherwise undefined
81
84
  */
82
85
  function getReplaceInfoFromSelf(self, deviceUrl) {
@@ -115,11 +118,13 @@ function findLocusUrlInAnyHashTreeParser(meetingCollection, locusUrl) {
115
118
  *
116
119
  * @param {HashTreeMessage} message - The hash tree message to find the meeting for
117
120
  * @param {MeetingCollection} meetingCollection - The collection of meetings to search
118
- * @param {string} deviceUrl - The URL of the user's device
119
121
  * @returns {any} The meeting if found, otherwise undefined
120
122
  */
121
- function findMeetingForHashTreeMessage(message, meetingCollection, deviceUrl) {
123
+ function findMeetingForHashTreeMessage(message, meetingCollection) {
122
124
  var _message$locusStateEl, _message$locusStateEl2;
125
+ if (!message) {
126
+ return undefined;
127
+ }
123
128
  var foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, message.locusUrl);
124
129
  if (foundMeeting) {
125
130
  return foundMeeting;
@@ -130,7 +135,7 @@ function findMeetingForHashTreeMessage(message, meetingCollection, deviceUrl) {
130
135
  var self = (_message$locusStateEl = message.locusStateElements) === null || _message$locusStateEl === void 0 ? void 0 : (_message$locusStateEl2 = _message$locusStateEl.find(function (el) {
131
136
  return (0, _utils.isSelf)(el);
132
137
  })) === null || _message$locusStateEl2 === void 0 ? void 0 : _message$locusStateEl2.data;
133
- var replaces = getReplaceInfoFromSelf(self, deviceUrl);
138
+ var replaces = getReplaceInfoFromSelf(self, self === null || self === void 0 ? void 0 : self.deviceUrl);
134
139
  if (replaces !== null && replaces !== void 0 && replaces.locusUrl) {
135
140
  foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, replaces.locusUrl);
136
141
  return foundMeeting;
@@ -242,12 +247,13 @@ function createLocusFromHashTreeMessage(message) {
242
247
  var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
243
248
  /**
244
249
  * Constructor
245
- * @param {function} updateMeeting callback to update the meeting object from an object
250
+ * @param {Object} callbacks callbacks used by LocusInfo
251
+ * @param {function} callbacks.updateMeeting callback to update the meeting object from an object
246
252
  * @param {object} webex
247
253
  * @param {string} meetingId
248
254
  * @returns {undefined}
249
255
  */
250
- function LocusInfo(updateMeeting, webex, meetingId) {
256
+ function LocusInfo(callbacks, webex, meetingId) {
251
257
  var _this;
252
258
  (0, _classCallCheck2.default)(this, LocusInfo);
253
259
  _this = _callSuper(this, LocusInfo);
@@ -256,7 +262,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
256
262
  (0, _defineProperty2.default)(_this, "locusParser", void 0);
257
263
  (0, _defineProperty2.default)(_this, "meetingId", void 0);
258
264
  (0, _defineProperty2.default)(_this, "parsedLocus", void 0);
259
- (0, _defineProperty2.default)(_this, "updateMeeting", void 0);
260
265
  (0, _defineProperty2.default)(_this, "webex", void 0);
261
266
  (0, _defineProperty2.default)(_this, "aclUrl", void 0);
262
267
  (0, _defineProperty2.default)(_this, "baseSequence", void 0);
@@ -281,14 +286,16 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
281
286
  (0, _defineProperty2.default)(_this, "hashTreeObjectId2ParticipantId", void 0);
282
287
  // mapping of hash tree object ids to participant ids
283
288
  (0, _defineProperty2.default)(_this, "classicVsHashTreeMismatchMetricCounter", 0);
289
+ (0, _defineProperty2.default)(_this, "callbacks", void 0);
290
+ (0, _defineProperty2.default)(_this, "destroyMeetingSuspended", false);
284
291
  _this.parsedLocus = {
285
292
  states: []
286
293
  };
294
+ _this.callbacks = callbacks;
287
295
  _this.webex = webex;
288
296
  _this.emitChange = false;
289
297
  _this.compareAndUpdateFlags = {};
290
298
  _this.meetingId = meetingId;
291
- _this.updateMeeting = updateMeeting;
292
299
  _this.locusParser = new _parser.default();
293
300
  _this.hashTreeParsers = new _map.default();
294
301
  _this.hashTreeObjectId2ParticipantId = new _map.default();
@@ -296,23 +303,46 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
296
303
  }
297
304
 
298
305
  /**
299
- * 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.
300
- * WARNING: This function must not be used for hash tree based Locus meetings.
306
+ * Whether this meeting uses hash tree based Locus (as opposed to a classic, delta based Locus).
301
307
  *
302
- * @param {Meeting} meeting
303
- * @param {boolean} isLocusUrlChanged
304
- * @param {Locus} locus
305
- * @returns {undefined}
308
+ * @returns {boolean}
306
309
  */
307
310
  (0, _inherits2.default)(LocusInfo, _EventsScope);
308
311
  return (0, _createClass2.default)(LocusInfo, [{
312
+ key: "isUsingHashTrees",
313
+ value: function isUsingHashTrees() {
314
+ return this.hashTreeParsers.size > 0;
315
+ }
316
+
317
+ /**
318
+ * 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.
319
+ * WARNING: This function must not be used for hash tree based Locus meetings.
320
+ *
321
+ * @param {Meeting} meeting
322
+ * @param {boolean} isLocusUrlChanged
323
+ * @param {Locus} locus
324
+ * @param {Object} [options]
325
+ * @param {boolean} [options.destroyOnTransientFailure=true] controls what happens on a *transient*
326
+ * sync failure (a terminal failure, e.g. a 403 meaning the meeting has ended, always destroys
327
+ * the meeting regardless of this flag). When true, a transient failure destroys the meeting and
328
+ * the returned promise still resolves. When false, the meeting is preserved and the returned
329
+ * promise rejects so the caller can retry.
330
+ * @returns {Promise} resolves once the fetched DTO has been applied; see destroyOnTransientFailure
331
+ * for the failure behavior
332
+ */
333
+ }, {
309
334
  key: "doLocusSync",
310
335
  value: function doLocusSync(meeting, isLocusUrlChanged, locus) {
311
336
  var _this$locusParser$wor,
312
337
  _this2 = this;
338
+ var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
339
+ _ref$destroyOnTransie = _ref.destroyOnTransientFailure,
340
+ destroyOnTransientFailure = _ref$destroyOnTransie === void 0 ? true : _ref$destroyOnTransie;
313
341
  var url;
314
342
  var isDelta = false;
315
343
  var meetingDestroyed = false;
344
+ // whether the DTO fetch itself failed (as opposed to applying a successfully fetched DTO)
345
+ var fetchFailed = false;
316
346
  if (isLocusUrlChanged) {
317
347
  // 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,
318
348
  // so use the main session locus url to get the full locus(full participants list in the response).
@@ -327,8 +357,28 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
327
357
  }
328
358
  _loggerProxy.default.logger.info("Locus-info:index#doLocusSync --> doing Locus sync (getting ".concat(isDelta ? 'delta' : 'full', " DTO)"));
329
359
 
330
- // return value ignored on purpose
331
- meeting.meetingRequest.getLocusDTO({
360
+ // Called once the DTO fetch (delta plus any full-sync fallback) has failed and we're giving up.
361
+ // The meeting is destroyed when either the delta-processing path asked for it, or the failure is
362
+ // terminal (e.g. a 403 meaning the meeting has ended) - in both cases there's nothing left to
363
+ // sync or retry, so the trailing catch below swallows the rejection whenever meetingDestroyed is
364
+ // set. On the caller-driven reconnection path a non-terminal failure preserves the meeting and
365
+ // lets the rejection propagate so the caller can retry.
366
+ var onFetchFailure = function onFetchFailure(error, logMessage) {
367
+ var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
368
+ _ref2$terminal = _ref2.terminal,
369
+ terminal = _ref2$terminal === void 0 ? false : _ref2$terminal;
370
+ // terminal failures always destroy the meeting; destroyOnTransientFailure only controls the
371
+ // non-terminal case
372
+ var destroyMeeting = terminal || destroyOnTransientFailure;
373
+ _loggerProxy.default.logger.info("Locus-info:index#doLocusSync --> ".concat(logMessage).concat(destroyMeeting ? ', destroying the meeting' : ''));
374
+ fetchFailed = true;
375
+ if (destroyMeeting) {
376
+ _this2.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
377
+ meetingDestroyed = true;
378
+ }
379
+ throw error;
380
+ };
381
+ return meeting.meetingRequest.getLocusDTO({
332
382
  url: url
333
383
  }).catch(function (e) {
334
384
  if (isDelta) {
@@ -348,19 +398,25 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
348
398
  return meeting.meetingRequest.getLocusDTO({
349
399
  url: meeting.locusUrl
350
400
  }).catch(function (err) {
351
- _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> fallback full sync failed, destroying the meeting');
352
- _this2.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
353
- meetingDestroyed = true;
354
- throw err;
401
+ return (
402
+ // A 403 from the fallback full sync is also terminal (meeting has ended), so remove the
403
+ // meeting even on the reconnection path instead of preserving it and rejecting.
404
+ onFetchFailure(err, 'fallback full sync failed', {
405
+ terminal: err.statusCode === 403
406
+ })
407
+ );
355
408
  });
356
409
  }
357
- _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> got 403 from Locus, skipping fallback to full sync, destroying the meeting');
358
- } else {
359
- _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> fallback full sync failed, destroying the meeting');
410
+
411
+ // A 403 means the meeting has ended - this is terminal, so remove the meeting even on the
412
+ // reconnection path (there's nothing to retry) instead of preserving it and rejecting.
413
+ return onFetchFailure(e, 'got 403 from Locus, skipping fallback to full sync', {
414
+ terminal: true
415
+ });
360
416
  }
361
- _this2.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
362
- meetingDestroyed = true;
363
- throw e;
417
+ return onFetchFailure(e, 'full sync failed', {
418
+ terminal: e.statusCode === 403
419
+ });
364
420
  }).then(function (res) {
365
421
  if ((0, _lodash.isEmpty)(res.body)) {
366
422
  if (isDelta) {
@@ -380,15 +436,27 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
380
436
  }
381
437
  meeting.locusInfo.onFullLocus('classic Locus sync', res.body);
382
438
  }).catch(function (e) {
383
- _loggerProxy.default.logger.info("Locus-info:index#doLocusSync --> getLocusDTO succeeded but failed to handle result, locus parser will resume but not all data may be synced (".concat(e.toString(), ")"));
384
- _metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_SYNC_HANDLING_FAILED, {
385
- correlationId: meeting.correlationId,
386
- url: url,
387
- reason: e.message,
388
- errorName: e.name,
389
- stack: e.stack,
390
- code: e.code
391
- });
439
+ if (!fetchFailed) {
440
+ // The DTO was fetched successfully but applying it failed. Retrying wouldn't help - it
441
+ // would re-fetch and re-apply the same unprocessable DTO and fail identically - so log and
442
+ // resume (swallow the error) instead of propagating it. Propagating here would make the
443
+ // reconnection flow (which treats a rejection as retryable) retry indefinitely.
444
+ _loggerProxy.default.logger.info("Locus-info:index#doLocusSync --> getLocusDTO succeeded but failed to handle result, locus parser will resume but not all data may be synced (".concat(e.toString(), ")"));
445
+ _metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_SYNC_HANDLING_FAILED, {
446
+ correlationId: meeting.correlationId,
447
+ url: url,
448
+ reason: e.message,
449
+ errorName: e.name,
450
+ stack: e.stack,
451
+ code: e.code
452
+ });
453
+ return;
454
+ }
455
+ if (!destroyOnTransientFailure && !meetingDestroyed) {
456
+ // caller-driven sync (e.g. reconnection): propagate a transient fetch failure so it can be
457
+ // retried. If the meeting was destroyed (terminal failure), there's nothing to retry.
458
+ throw e;
459
+ }
392
460
  }).finally(function () {
393
461
  if (!meetingDestroyed) {
394
462
  // Notify parser to resume processing delta events.
@@ -398,6 +466,73 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
398
466
  });
399
467
  }
400
468
 
469
+ /**
470
+ * Syncs this meeting's Locus state (e.g. after a network reconnection), routing to whichever
471
+ * mechanism the meeting uses (a meeting only ever uses one): hash tree datasets via
472
+ * syncAllHashTreeDatasets() or a standalone Locus DTO fetch for classic meetings.
473
+ * A transient failure preserves the meeting (so the caller can retry); only a terminal failure
474
+ * (e.g. a 403 meaning the meeting has ended) destroys it.
475
+ *
476
+ * The classic path is only needed when Meetings#syncMeetings() can't do its usual
477
+ * getActiveMeetings() fetch (e.g. unverified guests, for whom Locus rejects that call); signed-in
478
+ * users resync classic meetings via getActiveMeetings() and pass canSyncClassicLocus as false.
479
+ *
480
+ * @param {Meeting} meeting
481
+ * @param {Object} options
482
+ * @param {boolean} options.canSyncClassicLocus - whether this sync is allowed to fetch a
483
+ * standalone Locus DTO for classic meetings
484
+ * @param {boolean} options.canSyncHashTree - whether this sync is allowed to sync hash tree
485
+ * datasets for hash tree based meetings
486
+ * @returns {Promise<void>} resolves once the sync (hash tree or classic) completes; for the
487
+ * classic path it rejects only on a transient failure, so the caller can retry (a terminal
488
+ * failure destroys the meeting and resolves)
489
+ */
490
+ }, {
491
+ key: "sync",
492
+ value: (function () {
493
+ var _sync = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(meeting, _ref3) {
494
+ var canSyncClassicLocus, canSyncHashTree;
495
+ return _regenerator.default.wrap(function (_context) {
496
+ while (1) switch (_context.prev = _context.next) {
497
+ case 0:
498
+ canSyncClassicLocus = _ref3.canSyncClassicLocus, canSyncHashTree = _ref3.canSyncHashTree;
499
+ if (!this.isUsingHashTrees()) {
500
+ _context.next = 2;
501
+ break;
502
+ }
503
+ if (!canSyncHashTree) {
504
+ _context.next = 1;
505
+ break;
506
+ }
507
+ _context.next = 1;
508
+ return this.syncAllHashTreeDatasets();
509
+ case 1:
510
+ return _context.abrupt("return");
511
+ case 2:
512
+ if (!(canSyncClassicLocus && meeting.locusUrl)) {
513
+ _context.next = 3;
514
+ break;
515
+ }
516
+ // Pause the parser so in-flight deltas don't race the DTO fetch; doLocusSync() resumes it.
517
+ this.locusParser.pause();
518
+ // destroyOnTransientFailure: false so a transient failure preserves the meeting and rejects,
519
+ // letting the reconnection flow retry instead of tearing the meeting down. A terminal failure
520
+ // (e.g. a 403 meaning the meeting has ended) still destroys the meeting.
521
+ _context.next = 3;
522
+ return this.doLocusSync(meeting, false, undefined, {
523
+ destroyOnTransientFailure: false
524
+ });
525
+ case 3:
526
+ case "end":
527
+ return _context.stop();
528
+ }
529
+ }, _callee, this);
530
+ }));
531
+ function sync(_x, _x2) {
532
+ return _sync.apply(this, arguments);
533
+ }
534
+ return sync;
535
+ }()
401
536
  /**
402
537
  * Apply locus delta data to meeting
403
538
  * @param {string} action Locus delta action
@@ -405,6 +540,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
405
540
  * @param {Meeting} meeting
406
541
  * @returns {undefined}
407
542
  */
543
+ )
408
544
  }, {
409
545
  key: "applyLocusDeltaData",
410
546
  value: function applyLocusDeltaData(action, locus, meeting) {
@@ -490,7 +626,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
490
626
  this.updateControls(locus.controls, locus.self);
491
627
  this.updateLocusUrl(locus.url, _controlsUtils.default.isMainSessionDTO(locus));
492
628
  this.updateFullState(locus.fullState);
493
- this.updateMeetingInfo(locus.info);
629
+ this.updateMeetingInfo(locus.info, locus.self);
494
630
  this.updateEmbeddedApps(locus.embeddedApps);
495
631
  // self and participants generate sipUrl for 1:1 meeting
496
632
  this.updateSelf(locus.self);
@@ -499,6 +635,18 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
499
635
  this.updateLinks(locus.links);
500
636
  }
501
637
 
638
+ /**
639
+ * Whether we expect to receive updates over the LLM connection. This is used by hash tree parsers
640
+ * to decide whether to arm heartbeat watchdog timers for LLM data sets.
641
+ * @returns {boolean}
642
+ */
643
+ }, {
644
+ key: "isLlmExpected",
645
+ value: function isLlmExpected() {
646
+ var _this$parsedLocus$sel, _this$parsedLocus$sel2;
647
+ return ((_this$parsedLocus$sel = this.parsedLocus.self) === null || _this$parsedLocus$sel === void 0 ? void 0 : (_this$parsedLocus$sel2 = _this$parsedLocus$sel.joinedWith) === null || _this$parsedLocus$sel2 === void 0 ? void 0 : _this$parsedLocus$sel2.state) === 'JOINED';
648
+ }
649
+
502
650
  /**
503
651
  * Creates a HashTreeParser instance for a given locusUrl and stores it in the map.
504
652
  * @param {Object} params
@@ -510,19 +658,41 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
510
658
  */
511
659
  }, {
512
660
  key: "createHashTreeParser",
513
- value: function createHashTreeParser(_ref) {
514
- var _locusUrl$split, _locusUrl$split$pop, _this$webex$config$me;
515
- var locusUrl = _ref.locusUrl,
516
- initialLocus = _ref.initialLocus,
517
- metadata = _ref.metadata,
518
- replacedAt = _ref.replacedAt;
661
+ value: function createHashTreeParser(_ref4) {
662
+ var _this4 = this,
663
+ _locusUrl$split,
664
+ _locusUrl$split$pop,
665
+ _this$webex$config$me;
666
+ var locusUrl = _ref4.locusUrl,
667
+ initialLocus = _ref4.initialLocus,
668
+ metadata = _ref4.metadata,
669
+ replacedAt = _ref4.replacedAt;
519
670
  var parser = new _hashTreeParser2.default({
520
671
  initialLocus: initialLocus,
521
672
  metadata: metadata,
522
673
  webexRequest: this.webex.request.bind(this.webex),
523
- locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
674
+ callbacks: {
675
+ locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
676
+ syncLatencyTracker: this.callbacks.syncLatencyTracker,
677
+ isLlmExpected: function isLlmExpected() {
678
+ return _this4.isLlmExpected();
679
+ },
680
+ // Reuse webex-core's tracking-id interceptor sequence (exposed publicly via
681
+ // webexTrackingIdSequenceNumbers) so Locus requests share the client's unified
682
+ // ${sessionId}_${sequence} tracking id space instead of minting an unrelated id. Fall
683
+ // back to a uuid on the rare chance the interceptor hasn't issued any request yet (and so
684
+ // isn't in the map). The value is opaque to the metrics layer and is forced onto the
685
+ // /hashtree and /sync request headers.
686
+ generateTrackingId: function generateTrackingId() {
687
+ var interceptor = (0, _toConsumableArray2.default)(_webexCore.webexTrackingIdSequenceNumbers.keys()).find(function (candidate) {
688
+ return (candidate === null || candidate === void 0 ? void 0 : candidate.webex) === _this4.webex;
689
+ });
690
+ return "".concat(_this4.webex.sessionId, "_").concat(interceptor ? interceptor.sequence : _uuid.default.v4());
691
+ }
692
+ },
524
693
  debugId: "HT-".concat((_locusUrl$split = locusUrl.split('/')) === null || _locusUrl$split === void 0 ? void 0 : (_locusUrl$split$pop = _locusUrl$split.pop()) === null || _locusUrl$split$pop === void 0 ? void 0 : _locusUrl$split$pop.substring(0, 4)),
525
- excludedDataSets: (_this$webex$config$me = this.webex.config.meetings.locus) === null || _this$webex$config$me === void 0 ? void 0 : _this$webex$config$me.excludedDataSets
694
+ excludedDataSets: (_this$webex$config$me = this.webex.config.meetings.locus) === null || _this$webex$config$me === void 0 ? void 0 : _this$webex$config$me.excludedDataSets,
695
+ syncLatencyMeetingId: this.meetingId
526
696
  });
527
697
 
528
698
  // When a new HashTreeParser is created, previous one should be stopped.
@@ -558,24 +728,26 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
558
728
 
559
729
  /**
560
730
  * @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
731
+ * @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)
561
732
  * @returns {undefined}
562
733
  * @memberof LocusInfo
563
734
  */
564
735
  }, {
565
736
  key: "initialSetup",
566
737
  value: (function () {
567
- var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(data) {
738
+ var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(data, onLocusSynced) {
568
739
  var _data$locus, _data$locus$links, _data$locus$links$res, _data$locus$links$res2;
569
- var _data$hashTreeMessage, _metadataObject$data, metadataObject, hashTreeParser, _hashTreeParser, _t;
570
- return _regenerator.default.wrap(function (_context) {
571
- while (1) switch (_context.prev = _context.next) {
740
+ var initialFullLocus, _data$hashTreeMessage, _metadataObject$data, metadataObject, hashTreeParser, _hashTreeParser, _t;
741
+ return _regenerator.default.wrap(function (_context2) {
742
+ while (1) switch (_context2.prev = _context2.next) {
572
743
  case 0:
744
+ initialFullLocus = null;
573
745
  _t = data.trigger;
574
- _context.next = _t === 'locus-message' ? 1 : _t === 'join-response' ? 6 : _t === 'get-loci-response' ? 7 : 10;
746
+ _context2.next = _t === 'locus-message' ? 1 : _t === 'join-response' ? 6 : _t === 'get-loci-response' ? 7 : 10;
575
747
  break;
576
748
  case 1:
577
749
  if (!data.hashTreeMessage) {
578
- _context.next = 4;
750
+ _context2.next = 4;
579
751
  break;
580
752
  }
581
753
  // we need the Metadata object to be in the received message, because it contains visibleDataSets
@@ -584,7 +756,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
584
756
  return (0, _utils.isMetadata)(el);
585
757
  });
586
758
  if (metadataObject !== null && metadataObject !== void 0 && (_metadataObject$data = metadataObject.data) !== null && _metadataObject$data !== void 0 && _metadataObject$data.visibleDataSets) {
587
- _context.next = 2;
759
+ _context2.next = 2;
588
760
  break;
589
761
  }
590
762
  // this is a common case (not an error)
@@ -607,24 +779,25 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
607
779
  visibleDataSets: metadataObject.data.visibleDataSets
608
780
  }
609
781
  }); // now handle the message - that should populate all the visible datasets
610
- _context.next = 3;
782
+ _context2.next = 3;
611
783
  return hashTreeParser.initializeFromMessage(data.hashTreeMessage);
612
784
  case 3:
613
- _context.next = 5;
785
+ _context2.next = 5;
614
786
  break;
615
787
  case 4:
616
788
  // "classic" Locus case, no hash trees involved
617
789
  this.updateLocusCache(data.locus);
618
790
  this.onFullLocus('classic locus message', data.locus, undefined);
619
791
  case 5:
620
- return _context.abrupt("continue", 10);
792
+ return _context2.abrupt("continue", 10);
621
793
  case 6:
622
794
  this.updateLocusCache(data.locus);
623
795
  this.onFullLocus('join response', data.locus, undefined, data.dataSets, data.metadata);
624
- return _context.abrupt("continue", 10);
796
+ initialFullLocus = data.locus;
797
+ return _context2.abrupt("continue", 10);
625
798
  case 7:
626
799
  if (!((_data$locus = data.locus) !== null && _data$locus !== void 0 && (_data$locus$links = _data$locus.links) !== null && _data$locus$links !== void 0 && (_data$locus$links$res = _data$locus$links.resources) !== null && _data$locus$links$res !== void 0 && (_data$locus$links$res2 = _data$locus$links$res.visibleDataSets) !== null && _data$locus$links$res2 !== void 0 && _data$locus$links$res2.url)) {
627
- _context.next = 9;
800
+ _context2.next = 9;
628
801
  break;
629
802
  }
630
803
  _loggerProxy.default.logger.info('Locus-info:index#initialSetup --> creating HashTreeParser from get-loci-response');
@@ -637,36 +810,67 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
637
810
  },
638
811
  metadata: null // get-loci-response doesn't contain Metadata object
639
812
  }); // now initialize all the data
640
- _context.next = 8;
813
+ _context2.next = 8;
641
814
  return _hashTreeParser.initializeFromGetLociResponse(data.locus);
642
815
  case 8:
643
- _context.next = 10;
816
+ _context2.next = 10;
644
817
  break;
645
818
  case 9:
646
819
  // "classic" Locus case, no hash trees involved
647
820
  this.updateLocusCache(data.locus);
648
821
  this.onFullLocus('classic get-loci-response', data.locus, undefined);
822
+ initialFullLocus = data.locus || null;
649
823
  case 10:
824
+ if (onLocusSynced) {
825
+ try {
826
+ onLocusSynced(initialFullLocus || this.getCurrentLocusSnapshot());
827
+ } catch (error) {
828
+ _loggerProxy.default.logger.warn("Locus-info:index#initialSetup --> onLocusSynced callback failed: ".concat(error));
829
+ }
830
+ }
831
+
650
832
  // Change it to true after it receives it first locus object
651
833
  this.emitChange = true;
652
834
  case 11:
653
835
  case "end":
654
- return _context.stop();
836
+ return _context2.stop();
655
837
  }
656
- }, _callee, this);
838
+ }, _callee2, this);
657
839
  }));
658
- function initialSetup(_x) {
840
+ function initialSetup(_x3, _x4) {
659
841
  return _initialSetup.apply(this, arguments);
660
842
  }
661
843
  return initialSetup;
662
844
  }()
845
+ /**
846
+ * Builds a full locus DTO snapshot from current internal locus state.
847
+ *
848
+ * @returns {LocusDTO}
849
+ */
850
+ )
851
+ }, {
852
+ key: "getCurrentLocusSnapshot",
853
+ value: function getCurrentLocusSnapshot() {
854
+ var _this5 = this;
855
+ var locus = {};
856
+ LocusDtoTopLevelKeys.forEach(function (key) {
857
+ var value = _this5[key];
858
+ if (value !== undefined && value !== null) {
859
+ locus[key] = (0, _lodash.cloneDeep)(value);
860
+ }
861
+ });
862
+ if (!(0, _isArray.default)(locus.participants)) {
863
+ locus.participants = [];
864
+ }
865
+ return locus;
866
+ }
867
+
663
868
  /**
664
869
  * Handles HTTP response from Locus API call.
665
870
  * @param {Meeting} meeting meeting object
666
871
  * @param {LocusApiResponseBody} responseBody body of the http response from Locus API call
667
872
  * @returns {void}
668
873
  */
669
- )
670
874
  }, {
671
875
  key: "handleLocusAPIResponse",
672
876
  value: function handleLocusAPIResponse(meeting, responseBody) {
@@ -674,29 +878,38 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
674
878
  var isWrapped = 'locus' in responseBody;
675
879
  var locusUrl = isWrapped ? (_responseBody$locus = responseBody.locus) === null || _responseBody$locus === void 0 ? void 0 : _responseBody$locus.url : responseBody.url;
676
880
  var hashTreeParserEntry = locusUrl && this.hashTreeParsers.get(locusUrl);
677
- if (hashTreeParserEntry) {
678
- if (isWrapped) {
679
- if (!responseBody.dataSets) {
680
- this.sendClassicVsHashTreeMismatchMetric(meeting, "expected hash tree dataSets in API response but they are missing");
681
- // continuing as we can still manage without responseBody.dataSets, but this is very suspicious
881
+ var locus = isWrapped ? responseBody.locus : responseBody;
882
+ if (this.isUsingHashTrees()) {
883
+ // We are in hash tree mode. Check if we need to create/reactivate a parser for this locusUrl.
884
+ if (!hashTreeParserEntry || hashTreeParserEntry.parser.state === 'stopped') {
885
+ if (!locusUrl) {
886
+ _loggerProxy.default.logger.warn('Locus-info:index#handleLocusAPIResponse --> API response has no locusUrl, cannot handle hash tree parser switch');
887
+ return;
682
888
  }
683
- _loggerProxy.default.logger.info('Locus-info:index#handleLocusAPIResponse --> passing Locus API response to HashTreeParser: ', responseBody);
889
+ this.handleHashTreeParserSwitchForAPIResponse(locusUrl, locus);
890
+ return;
891
+ }
892
+
893
+ // Active parser found - pass the API response to it
894
+ if (isWrapped) {
684
895
  // update the data in our hash trees
685
896
  hashTreeParserEntry.parser.handleLocusUpdate(responseBody);
686
897
  } else {
687
- // LocusDTO without wrapper - pass it through as if it had no dataSets
898
+ // LocusDTO without wrapper - pass it through as if it had no dataSets nor metadata
688
899
  hashTreeParserEntry.parser.handleLocusUpdate({
689
900
  locus: responseBody
690
901
  });
691
902
  }
692
- } else {
693
- if (isWrapped && responseBody.dataSets) {
694
- this.sendClassicVsHashTreeMismatchMetric(meeting, "unexpected hash tree dataSets in API response");
695
- }
696
- // classic Locus delta
697
- var locus = isWrapped ? responseBody.locus : responseBody;
698
- this.handleLocusDelta(locus, meeting);
903
+ return;
904
+ }
905
+
906
+ // No hash tree parsers - classic Locus mode
907
+ if (isWrapped && responseBody.dataSets) {
908
+ this.sendClassicVsHashTreeMismatchMetric(meeting, "unexpected hash tree dataSets in API response");
699
909
  }
910
+
911
+ // classic Locus delta
912
+ this.handleLocusDelta(locus, meeting);
700
913
  }
701
914
 
702
915
  /**
@@ -707,7 +920,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
707
920
  }, {
708
921
  key: "updateLocusFromHashTreeObject",
709
922
  value: function updateLocusFromHashTreeObject(object, locus) {
710
- var _this4 = this,
923
+ var _this6 = this,
711
924
  _locus$self;
712
925
  var type = object.htMeta.elementId.type.toLowerCase();
713
926
  var addParticipantObject = function addParticipantObject(obj) {
@@ -715,7 +928,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
715
928
  locus.participants = [];
716
929
  }
717
930
  locus.participants.push(obj.data);
718
- _this4.hashTreeObjectId2ParticipantId.set(obj.htMeta.elementId.id, obj.data.id);
931
+ _this6.hashTreeObjectId2ParticipantId.set(obj.htMeta.elementId.id, obj.data.id);
719
932
  };
720
933
  switch (type) {
721
934
  case _types.ObjectType.locus:
@@ -826,10 +1039,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
826
1039
  if (!object.data) {
827
1040
  // self without data is handled inside HashTreeParser and results in LocusInfoUpdateType.MEETING_ENDED, so we should never get here
828
1041
  // all other types info, fullstate, etc - Locus should never send them without data
829
- _loggerProxy.default.logger.warn("Locus-info:index#updateLocusFromHashTreeObject --> received ".concat(type, " object without data, this is not expected! version=").concat(object.htMeta.elementId.version));
1042
+ // but we end up with this method being called without the data for them when the main dataset is removed from visible datasets list
1043
+ _loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> received ".concat(type, " object without data, version=").concat(object.htMeta.elementId.version));
830
1044
  } else {
831
1045
  var _locus$info, _object$data$controls, _object$data$controls2, _object$data$controls3;
832
1046
  _loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> ".concat(type, " object updated to version ").concat(object.htMeta.elementId.version));
1047
+ if (type === _types.ObjectType.self) {
1048
+ _loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> self data: removed=".concat(object.data.removed, " state=").concat(object.data.state, " reason=").concat(object.data.reason));
1049
+ }
833
1050
  var locusDtoKey = _types.ObjectTypeToLocusKeyMap[type];
834
1051
  locus[locusDtoKey] = object.data;
835
1052
 
@@ -879,6 +1096,81 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
879
1096
  }
880
1097
  }
881
1098
 
1099
+ /**
1100
+ * Helper that handles the common logic for reactivating a stopped HashTreeParser when
1101
+ * a newer "replaces" is detected. Used by both the message and API response parser switch methods.
1102
+ *
1103
+ * @param {string} callerName - name of the calling method, used in log messages
1104
+ * @param {string} locusUrl - the locus URL of the stopped parser
1105
+ * @param {HashTreeParserEntry} stoppedEntry - the stopped parser entry
1106
+ * @param {ReplacesInfo} replaces - replacement info extracted from self
1107
+ * @param {Function} resumeCallback - callback to invoke after reactivation to resume the parser
1108
+ * @returns {void}
1109
+ */
1110
+ }, {
1111
+ key: "resumeStoppedParser",
1112
+ value: function resumeStoppedParser(callerName, locusUrl, stoppedEntry, replaces, resumeCallback) {
1113
+ // this check is just for typescript, it should never happen, replaces should always be defined
1114
+ if (!replaces) {
1115
+ _loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> received data for stopped HashTreeParser with locusUrl ").concat(locusUrl, ", but no replaces info provided, so not re-activating the parser"));
1116
+ return;
1117
+ }
1118
+ if (replaces.replacedAt <= (stoppedEntry.replacedAt || '')) {
1119
+ _loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> received data for stopped HashTreeParser with locusUrl ").concat(locusUrl, ", but replaces info provided is not newer, so not re-activating the parser"));
1120
+ return;
1121
+ }
1122
+ _loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> reactivating HashTreeParser for locusUrl=").concat(locusUrl, ", which replaces ").concat(replaces.locusUrl));
1123
+ var replacedEntry = this.hashTreeParsers.get(replaces.locusUrl);
1124
+ if (replacedEntry) {
1125
+ replacedEntry.replacedAt = replaces.replacedAt;
1126
+ replacedEntry.parser.stop();
1127
+ } else {
1128
+ _loggerProxy.default.logger.warn("Locus-info:index#".concat(callerName, " --> the parser that is supposed to be replaced with the currently reactivated parser is not found, locusUrl=").concat(replaces.locusUrl));
1129
+ }
1130
+ stoppedEntry.initializedFromHashTree = false;
1131
+ this.hashTreeObjectId2ParticipantId.clear();
1132
+ resumeCallback();
1133
+ }
1134
+
1135
+ /**
1136
+ * Handles an API response whose locusUrl doesn't match any active HashTreeParser
1137
+ * (either no entry exists, or the existing entry is stopped).
1138
+ * Creates a new parser or reactivates a stopped one using initializeFromGetLociResponse.
1139
+ *
1140
+ * @param {string} locusUrl - the locus URL from the API response
1141
+ * @param {LocusDTO} locus - the locus DTO from the API response
1142
+ * @returns {void}
1143
+ */
1144
+ }, {
1145
+ key: "handleHashTreeParserSwitchForAPIResponse",
1146
+ value: function handleHashTreeParserSwitchForAPIResponse(locusUrl, locus) {
1147
+ var entry = this.hashTreeParsers.get(locusUrl);
1148
+ var replaces = getReplaceInfoFromSelf(locus.self,
1149
+ // @ts-ignore
1150
+ this.webex.internal.device.url);
1151
+ if (!entry) {
1152
+ _loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitchForAPIResponse --> no parser for locusUrl ".concat(locusUrl, ", creating a new one"));
1153
+ var parser = this.createHashTreeParser({
1154
+ locusUrl: locusUrl,
1155
+ initialLocus: {
1156
+ locus: null,
1157
+ dataSets: []
1158
+ },
1159
+ metadata: null,
1160
+ replacedAt: replaces === null || replaces === void 0 ? void 0 : replaces.replacedAt
1161
+ });
1162
+ parser.initializeFromGetLociResponse(locus);
1163
+ return;
1164
+ }
1165
+ if (entry.parser.state !== 'stopped') {
1166
+ _loggerProxy.default.logger.warn("Locus-info:index#handleHashTreeParserSwitchForAPIResponse --> unexpected parser state \"".concat(entry.parser.state, "\" for locusUrl ").concat(locusUrl));
1167
+ return;
1168
+ }
1169
+ this.resumeStoppedParser('handleHashTreeParserSwitchForAPIResponse', locusUrl, entry, replaces, function () {
1170
+ return entry.parser.resumeFromApiResponse(locus);
1171
+ });
1172
+ }
1173
+
882
1174
  /**
883
1175
  * Checks if the hash tree message should trigger a switch to a different HashTreeParser
884
1176
  *
@@ -926,25 +1218,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
926
1218
  if (entry.parser.state === 'stopped') {
927
1219
  // 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
928
1220
  // this happens when you move from breakout A -> breakout B -> back to breakout A
929
- if (replaces) {
930
- if (replaces.replacedAt > (entry.replacedAt || '')) {
931
- _loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> resuming a HashTreeParser for locusUrl=".concat(message.locusUrl, ", which replaces ").concat(replaces.locusUrl));
932
- var replacedEntry = this.hashTreeParsers.get(replaces.locusUrl);
933
- if (replacedEntry) {
934
- replacedEntry.replacedAt = replaces.replacedAt;
935
- entry.initializedFromHashTree = false;
936
- this.hashTreeObjectId2ParticipantId.clear();
937
- replacedEntry.parser.stop();
938
- entry.parser.resume(message);
939
- } else {
940
- _loggerProxy.default.logger.warn("Locus-info:index#handleHashTreeParserSwitch --> the parser that is supposed to be replaced with the currently resumed parser is not found, locusUrl=".concat(replaces.locusUrl));
941
- }
942
- } else {
943
- _loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> received message for stopped HashTreeParser with locusUrl ".concat(message.locusUrl, ", but replaces info provided is not newer, so not re-activating the parser"));
944
- }
945
- return true;
946
- }
947
- _loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> received message for stopped HashTreeParser with locusUrl ".concat(message.locusUrl, ", but no replaces info provided, so not re-activating the parser"));
1221
+ this.resumeStoppedParser('handleHashTreeParserSwitch', message.locusUrl, entry, replaces, function () {
1222
+ return entry.parser.resumeFromMessage(message);
1223
+ });
948
1224
  return true;
949
1225
  }
950
1226
  return false;
@@ -977,6 +1253,69 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
977
1253
  }
978
1254
  }
979
1255
 
1256
+ /**
1257
+ * Triggers a sync of all hash tree datasets for all hash tree parsers associated with this meeting.
1258
+ * The syncs are executed sequentially within each parser.
1259
+ *
1260
+ * @param {Object} [options={}] - Options for syncing
1261
+ * @param {boolean} [options.onlyLLM=false] - Whether to sync only LLM based data sets
1262
+ * @returns {Promise<void>}
1263
+ */
1264
+ }, {
1265
+ key: "syncAllHashTreeDatasets",
1266
+ value: (function () {
1267
+ var _syncAllHashTreeDatasets = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
1268
+ var options,
1269
+ _iterator3,
1270
+ _step3,
1271
+ _step3$value,
1272
+ entry,
1273
+ _args3 = arguments,
1274
+ _t2;
1275
+ return _regenerator.default.wrap(function (_context3) {
1276
+ while (1) switch (_context3.prev = _context3.next) {
1277
+ case 0:
1278
+ options = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
1279
+ _iterator3 = _createForOfIteratorHelper(this.hashTreeParsers);
1280
+ _context3.prev = 1;
1281
+ _iterator3.s();
1282
+ case 2:
1283
+ if ((_step3 = _iterator3.n()).done) {
1284
+ _context3.next = 4;
1285
+ break;
1286
+ }
1287
+ _step3$value = (0, _slicedToArray2.default)(_step3.value, 2), entry = _step3$value[1];
1288
+ if (!entry.parser) {
1289
+ _context3.next = 3;
1290
+ break;
1291
+ }
1292
+ _context3.next = 3;
1293
+ return entry.parser.syncAllDatasets(options);
1294
+ case 3:
1295
+ _context3.next = 2;
1296
+ break;
1297
+ case 4:
1298
+ _context3.next = 6;
1299
+ break;
1300
+ case 5:
1301
+ _context3.prev = 5;
1302
+ _t2 = _context3["catch"](1);
1303
+ _iterator3.e(_t2);
1304
+ case 6:
1305
+ _context3.prev = 6;
1306
+ _iterator3.f();
1307
+ return _context3.finish(6);
1308
+ case 7:
1309
+ case "end":
1310
+ return _context3.stop();
1311
+ }
1312
+ }, _callee3, this, [[1, 5, 6, 7]]);
1313
+ }));
1314
+ function syncAllHashTreeDatasets() {
1315
+ return _syncAllHashTreeDatasets.apply(this, arguments);
1316
+ }
1317
+ return syncAllHashTreeDatasets;
1318
+ }()
980
1319
  /**
981
1320
  * Callback registered with HashTreeParser to receive locus info updates.
982
1321
  * Updates our locus info based on the data parsed by the hash tree parser.
@@ -985,10 +1324,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
985
1324
  * @param {LocusInfoUpdate} update - Details about the update.
986
1325
  * @returns {void}
987
1326
  */
1327
+ )
988
1328
  }, {
989
1329
  key: "updateFromHashTree",
990
1330
  value: function updateFromHashTree(locusUrl, update) {
991
- var _this5 = this;
1331
+ var _this7 = this;
992
1332
  switch (update.updateType) {
993
1333
  case _hashTreeParser2.LocusInfoUpdateType.OBJECTS_UPDATED:
994
1334
  {
@@ -1012,7 +1352,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1012
1352
  // but these should never happen
1013
1353
  _loggerProxy.default.logger.warn("Locus-info:index#updateFromHashTree --> received multiple LOCUS objects in one update, this is unexpected!");
1014
1354
  _metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_HASH_TREE_UNSUPPORTED_OPERATION, {
1015
- locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) || _this5.url,
1355
+ locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) || _this7.url,
1016
1356
  message: object.data ? 'multiple LOCUS object updates' : 'LOCUS object update followed by removal'
1017
1357
  });
1018
1358
  }
@@ -1046,7 +1386,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1046
1386
  // copy over all of existing locus except participants
1047
1387
  LocusDtoTopLevelKeys.forEach(function (key) {
1048
1388
  if (key !== 'participants') {
1049
- locus[key] = (0, _lodash.cloneDeep)(_this5[key]);
1389
+ locus[key] = (0, _lodash.cloneDeep)(_this7[key]);
1050
1390
  }
1051
1391
  });
1052
1392
  } else {
@@ -1054,7 +1394,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1054
1394
  // (except participants, which need to stay empty - that means "no participant changes")
1055
1395
  (0, _values.default)(_types.ObjectTypeToLocusKeyMap).forEach(function (locusDtoKey) {
1056
1396
  if (locusDtoKey !== 'participants') {
1057
- locus[locusDtoKey] = (0, _lodash.cloneDeep)(_this5[locusDtoKey]);
1397
+ locus[locusDtoKey] = (0, _lodash.cloneDeep)(_this7[locusDtoKey]);
1058
1398
  }
1059
1399
  });
1060
1400
  }
@@ -1067,7 +1407,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1067
1407
  }))));
1068
1408
  // now apply all the updates from the hash tree onto the locus
1069
1409
  update.updatedObjects.forEach(function (object) {
1070
- locus = _this5.updateLocusFromHashTreeObject(object, locus);
1410
+ locus = _this7.updateLocusFromHashTreeObject(object, locus);
1071
1411
  });
1072
1412
 
1073
1413
  // update our locus info with the new locus
@@ -1081,6 +1421,18 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1081
1421
  _loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> received signal that meeting ended, destroying meeting ".concat(this.meetingId));
1082
1422
  this.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.SELF_REMOVED);
1083
1423
  }
1424
+ break;
1425
+ }
1426
+ case _hashTreeParser2.LocusInfoUpdateType.LOCUS_NOT_FOUND:
1427
+ {
1428
+ _loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> received LOCUS_NOT_FOUND for ".concat(locusUrl, ", triggering syncMeetings"));
1429
+ this.webex.meetings.syncMeetings({
1430
+ keepOnlyLocusMeetings: false,
1431
+ skipHashTreeSync: true
1432
+ }).catch(function (syncError) {
1433
+ _loggerProxy.default.logger.error("Locus-info:index#updateFromHashTree --> syncMeetings failed after LOCUS_NOT_FOUND: ".concat(syncError));
1434
+ });
1435
+ break;
1084
1436
  }
1085
1437
  }
1086
1438
  }
@@ -1094,8 +1446,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1094
1446
  }, {
1095
1447
  key: "parse",
1096
1448
  value: function parse(meeting, data) {
1097
- if (this.hashTreeParsers.size > 0) {
1098
- this.handleHashTreeMessage(meeting, data.eventType, data.stateElementsMessage);
1449
+ if (this.isUsingHashTrees()) {
1450
+ if (data.eventType === _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS) {
1451
+ // sync meetings response follows the format of "not wrapped" locus API responses,
1452
+ // so has no dataSets nor Metadata
1453
+ this.handleLocusAPIResponse(meeting, _objectSpread({}, data.locus));
1454
+ } else {
1455
+ this.handleHashTreeMessage(meeting, data.eventType, data.stateElementsMessage);
1456
+ }
1099
1457
  } else {
1100
1458
  var eventType = data.eventType;
1101
1459
  if (eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
@@ -1246,7 +1604,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1246
1604
  key: "onFullLocusCommon",
1247
1605
  value: function onFullLocusCommon(locus, eventType) {
1248
1606
  var _this$participants,
1249
- _this6 = this,
1607
+ _this8 = this,
1250
1608
  _locus$jsSdkMeta;
1251
1609
  this.scheduledMeeting = locus.meeting || null;
1252
1610
  this.participants = locus.participants;
@@ -1254,7 +1612,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1254
1612
  var _participant$htMeta;
1255
1613
  // participant.htMeta is set only for hash tree based locus
1256
1614
  if (typeof ((_participant$htMeta = participant.htMeta) === null || _participant$htMeta === void 0 ? void 0 : _participant$htMeta.elementId.id) === 'number') {
1257
- _this6.hashTreeObjectId2ParticipantId.set(participant.htMeta.elementId.id, participant.id);
1615
+ _this8.hashTreeObjectId2ParticipantId.set(participant.htMeta.elementId.id, participant.id);
1258
1616
  }
1259
1617
  });
1260
1618
  var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
@@ -1362,8 +1720,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1362
1720
  }, {
1363
1721
  key: "updateLocusInfo",
1364
1722
  value: function updateLocusInfo(locus) {
1365
- var _locus$self2, _locus$self3;
1366
- if (((_locus$self2 = locus.self) === null || _locus$self2 === void 0 ? void 0 : _locus$self2.reason) === 'MOVED' && ((_locus$self3 = locus.self) === null || _locus$self3 === void 0 ? void 0 : _locus$self3.state) === 'LEFT') {
1723
+ if (_util.default.isSelfMovedOrBreakoutEnded(locus)) {
1367
1724
  // When moved to a breakout session locus sends a message for the previous locus
1368
1725
  // indicating that we have been moved. It isn't helpful to continue parsing this
1369
1726
  // as it gets interpreted as if we have left the call
@@ -1421,7 +1778,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1421
1778
  if (((_this$parsedLocus$ful3 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful3 === void 0 ? void 0 : _this$parsedLocus$ful3.type) === _constants._CALL_ || ((_this$parsedLocus$ful4 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful4 === void 0 ? void 0 : _this$parsedLocus$ful4.type) === _constants._SIP_BRIDGE_ || ((_this$parsedLocus$ful5 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful5 === void 0 ? void 0 : _this$parsedLocus$ful5.type) === _constants._SPACE_SHARE_) {
1422
1779
  // @ts-ignore
1423
1780
  var partner = this.getLocusPartner(this.participants, this.self);
1424
- this.updateMeeting({
1781
+ this.callbacks.updateMeeting({
1425
1782
  partner: partner
1426
1783
  });
1427
1784
 
@@ -1441,8 +1798,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1441
1798
  name: 'client.call.remote-ended',
1442
1799
  options: {
1443
1800
  meetingId: this.meetingId
1801
+ },
1802
+ payload: {
1803
+ eventData: {
1804
+ joinInProgress: this.destroyMeetingSuspended
1805
+ }
1444
1806
  }
1445
1807
  });
1808
+ if (this.destroyMeetingSuspended) {
1809
+ _metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
1810
+ meetingId: this.meetingId,
1811
+ reason: 'CALL_INACTIVE'
1812
+ });
1813
+ }
1446
1814
  this.emitScoped({
1447
1815
  file: 'locus-info',
1448
1816
  function: 'isMeetingActive'
@@ -1456,8 +1824,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1456
1824
  name: 'client.call.remote-ended',
1457
1825
  options: {
1458
1826
  meetingId: this.meetingId
1827
+ },
1828
+ payload: {
1829
+ eventData: {
1830
+ joinInProgress: this.destroyMeetingSuspended
1831
+ }
1459
1832
  }
1460
1833
  });
1834
+ if (this.destroyMeetingSuspended) {
1835
+ _metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
1836
+ meetingId: this.meetingId,
1837
+ reason: 'PARTNER_LEFT'
1838
+ });
1839
+ }
1461
1840
  this.emitScoped({
1462
1841
  file: 'locus-info',
1463
1842
  function: 'isMeetingActive'
@@ -1472,8 +1851,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1472
1851
  name: 'client.call.remote-ended',
1473
1852
  options: {
1474
1853
  meetingId: this.meetingId
1854
+ },
1855
+ payload: {
1856
+ eventData: {
1857
+ joinInProgress: this.destroyMeetingSuspended
1858
+ }
1475
1859
  }
1476
1860
  });
1861
+ if (this.destroyMeetingSuspended) {
1862
+ _metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
1863
+ meetingId: this.meetingId,
1864
+ reason: 'SELF_LEFT'
1865
+ });
1866
+ }
1477
1867
  this.emitScoped({
1478
1868
  file: 'locus-info',
1479
1869
  function: 'isMeetingActive'
@@ -1483,43 +1873,69 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1483
1873
  });
1484
1874
  }
1485
1875
  } else if (((_this$parsedLocus$ful6 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful6 === void 0 ? void 0 : _this$parsedLocus$ful6.type) === _constants._MEETING_) {
1486
- if (this.fullState && (this.fullState.state === _constants.LOCUS.STATE.INACTIVE ||
1487
- // @ts-ignore
1488
- this.fullState.state === _constants.LOCUS.STATE.TERMINATING)) {
1489
- _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting is ending due to inactive or terminating');
1876
+ if (this.fullState && _util.default.isWholeMeetingEnded(this.fullState)) {
1877
+ if (this.destroyMeetingSuspended) {
1878
+ _loggerProxy.default.logger.info('Locus-info:index#isMeetingActive --> suppressing DESTROY_MEETING (MEETING_INACTIVE_TERMINATING) because destroyMeeting is suspended');
1879
+ _metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
1880
+ meetingId: this.meetingId,
1881
+ reason: 'MEETING_INACTIVE_TERMINATING'
1882
+ });
1883
+ } else {
1884
+ _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting is ending due to inactive');
1490
1885
 
1491
- // @ts-ignore
1492
- this.webex.internal.newMetrics.submitClientEvent({
1493
- name: 'client.call.remote-ended',
1494
- options: {
1495
- meetingId: this.meetingId
1496
- }
1497
- });
1498
- this.emitScoped({
1499
- file: 'locus-info',
1500
- function: 'isMeetingActive'
1501
- }, _constants.EVENTS.DESTROY_MEETING, {
1502
- reason: _constants.MEETING_REMOVED_REASON.MEETING_INACTIVE_TERMINATING,
1503
- shouldLeave: false
1504
- });
1886
+ // @ts-ignore
1887
+ this.webex.internal.newMetrics.submitClientEvent({
1888
+ name: 'client.call.remote-ended',
1889
+ options: {
1890
+ meetingId: this.meetingId
1891
+ }
1892
+ });
1893
+ this.emitScoped({
1894
+ file: 'locus-info',
1895
+ function: 'isMeetingActive'
1896
+ }, _constants.EVENTS.DESTROY_MEETING, {
1897
+ reason: _constants.MEETING_REMOVED_REASON.MEETING_INACTIVE_TERMINATING,
1898
+ shouldLeave: false
1899
+ });
1900
+ }
1505
1901
  }
1506
1902
  // If you are guest and you are removed from the meeting
1507
1903
  // You wont get any further events
1508
1904
  else if (this.parsedLocus.self && this.parsedLocus.self.removed) {
1509
- // Check if we need to send an event
1510
- this.emitScoped({
1511
- file: 'locus-info',
1512
- function: 'isMeetingActive'
1513
- }, _constants.EVENTS.DESTROY_MEETING, {
1514
- reason: _constants.MEETING_REMOVED_REASON.SELF_REMOVED,
1515
- shouldLeave: false
1516
- });
1905
+ if (this.destroyMeetingSuspended) {
1906
+ _loggerProxy.default.logger.info('Locus-info:index#isMeetingActive --> suppressing DESTROY_MEETING (SELF_REMOVED) because destroyMeeting is suspended');
1907
+ _metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
1908
+ meetingId: this.meetingId,
1909
+ reason: 'SELF_REMOVED'
1910
+ });
1911
+ } else {
1912
+ this.emitScoped({
1913
+ file: 'locus-info',
1914
+ function: 'isMeetingActive'
1915
+ }, _constants.EVENTS.DESTROY_MEETING, {
1916
+ reason: _constants.MEETING_REMOVED_REASON.SELF_REMOVED,
1917
+ shouldLeave: false
1918
+ });
1919
+ }
1517
1920
  }
1518
1921
  } else {
1519
1922
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting Type is unknown.');
1520
1923
  }
1521
1924
  }
1522
1925
 
1926
+ /**
1927
+ * Suspends or resumes the emission of DESTROY_MEETING events in certain situations.
1928
+ * Used by joinWithMedia to prevent meeting destruction during retry flows.
1929
+ * @param {boolean} suspend - true to suppress, false to resume
1930
+ * @returns {undefined}
1931
+ * @memberof LocusInfo
1932
+ */
1933
+ }, {
1934
+ key: "suspendDestroyMeeting",
1935
+ value: function suspendDestroyMeeting(suspend) {
1936
+ this.destroyMeetingSuspended = suspend;
1937
+ }
1938
+
1523
1939
  /**
1524
1940
  * checks if the host permissions have changed while in the meeting
1525
1941
  * This would be the case if your role as host or moderator has been updated
@@ -1588,11 +2004,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1588
2004
  isReplace: isReplace
1589
2005
  });
1590
2006
  if (participants && (0, _isArray.default)(participants) && participants.length > 0) {
1591
- var _iterator3 = _createForOfIteratorHelper(participants),
1592
- _step3;
2007
+ var _iterator4 = _createForOfIteratorHelper(participants),
2008
+ _step4;
1593
2009
  try {
1594
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1595
- var participant = _step3.value;
2010
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
2011
+ var participant = _step4.value;
1596
2012
  if (participant && (participant === null || participant === void 0 ? void 0 : participant.reason) === 'FAILURE') {
1597
2013
  var _participant$person;
1598
2014
  this.emitScoped({
@@ -1604,9 +2020,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1604
2020
  }
1605
2021
  }
1606
2022
  } catch (err) {
1607
- _iterator3.e(err);
2023
+ _iterator4.e(err);
1608
2024
  } finally {
1609
- _iterator3.f();
2025
+ _iterator4.f();
1610
2026
  }
1611
2027
  }
1612
2028
  }
@@ -1727,7 +2143,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1727
2143
  }, _constants.LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED, {
1728
2144
  state: state,
1729
2145
  modifiedBy: current.record.modifiedBy,
1730
- lastModified: current.record.lastModified
2146
+ lastModified: current.record.lastModified,
2147
+ modifiedByServiceAppName: current.record.modifiedByServiceAppName,
2148
+ modifiedByServiceAppId: current.record.modifiedByServiceAppId
1731
2149
  });
1732
2150
  }
1733
2151
  if (hasMeetingContainerChanged) {
@@ -1807,7 +2225,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1807
2225
  }
1808
2226
  if (hasEntryExitToneChanged) {
1809
2227
  var entryExitTone = current.entryExitTone;
1810
- this.updateMeeting({
2228
+ this.callbacks.updateMeeting({
1811
2229
  entryExitTone: entryExitTone
1812
2230
  });
1813
2231
  this.emitScoped({
@@ -1822,7 +2240,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1822
2240
  // to fit with audio mute status logic
1823
2241
  if (hasVideoEnabledChanged) {
1824
2242
  var videoEnabled = current.videoEnabled;
1825
- this.updateMeeting({
2243
+ this.callbacks.updateMeeting({
1826
2244
  unmuteVideoAllowed: videoEnabled
1827
2245
  });
1828
2246
  this.emitScoped({
@@ -1912,12 +2330,12 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1912
2330
  value: function updateConversationUrl(conversationUrl, info) {
1913
2331
  if (conversationUrl && !(0, _lodash.isEqual)(this.conversationUrl, conversationUrl)) {
1914
2332
  this.conversationUrl = conversationUrl;
1915
- this.updateMeeting({
2333
+ this.callbacks.updateMeeting({
1916
2334
  conversationUrl: conversationUrl
1917
2335
  });
1918
2336
  } else if (info && info.conversationUrl && !(0, _lodash.isEqual)(this.conversationUrl, info.conversationUrl)) {
1919
2337
  this.conversationUrl = info.conversationUrl;
1920
- this.updateMeeting({
2338
+ this.callbacks.updateMeeting({
1921
2339
  conversationUrl: info.conversationUrl
1922
2340
  });
1923
2341
  }
@@ -1946,9 +2364,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1946
2364
  key: "updateLinks",
1947
2365
  value: function updateLinks(links) {
1948
2366
  var _this$links, _this$links2;
1949
- var _ref2 = links || {},
1950
- services = _ref2.services,
1951
- resources = _ref2.resources;
2367
+ var _ref5 = links || {},
2368
+ services = _ref5.services,
2369
+ resources = _ref5.resources;
1952
2370
  if (services && !(0, _lodash.isEqual)((_this$links = this.links) === null || _this$links === void 0 ? void 0 : _this$links.services, services)) {
1953
2371
  this.emitScoped({
1954
2372
  file: 'locus-info',
@@ -1978,7 +2396,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1978
2396
  value: function updateFullState(fullState) {
1979
2397
  if (fullState && !(0, _lodash.isEqual)(this.fullState, fullState)) {
1980
2398
  var result = _fullState.default.getFullState(this.fullState, fullState);
1981
- this.updateMeeting(result.current);
2399
+ this.callbacks.updateMeeting(result.current);
1982
2400
  if (result.updates.meetingStateChangedTo) {
1983
2401
  this.emitScoped({
1984
2402
  file: 'locus-info',
@@ -2013,7 +2431,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2013
2431
  value: function updateHostInfo(host) {
2014
2432
  if (host && !(0, _lodash.isEqual)(this.host, host)) {
2015
2433
  var parsedHosts = _hostUtils.default.getHosts(this.host, host);
2016
- this.updateMeeting(parsedHosts.current);
2434
+ this.callbacks.updateMeeting(parsedHosts.current);
2017
2435
  this.parsedLocus.host = parsedHosts.current;
2018
2436
  if (parsedHosts.updates.isNewHost) {
2019
2437
  this.compareAndUpdateFlags.compareSelfAndHost = true;
@@ -2040,11 +2458,20 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2040
2458
  }, {
2041
2459
  key: "updateMeetingInfo",
2042
2460
  value: function updateMeetingInfo(info, self) {
2043
- var _this$parsedLocus$sel;
2044
- var roles = self ? _selfUtils.default.getRoles(self) : ((_this$parsedLocus$sel = this.parsedLocus.self) === null || _this$parsedLocus$sel === void 0 ? void 0 : _this$parsedLocus$sel.roles) || [];
2045
- if (info && !(0, _lodash.isEqual)(this.info, info) || !(0, _lodash.isEqual)(this.roles, roles) && info) {
2046
- var isJoined = _selfUtils.default.isJoined(self || this.parsedLocus.self);
2047
- var parsedInfo = _infoUtils.default.getInfos(this.parsedLocus.info, info, roles, isJoined);
2461
+ var _this$parsedLocus$sel3;
2462
+ var roles = self ? _selfUtils.default.getRoles(self) : ((_this$parsedLocus$sel3 = this.parsedLocus.self) === null || _this$parsedLocus$sel3 === void 0 ? void 0 : _this$parsedLocus$sel3.roles) || [];
2463
+ var isJoined = _selfUtils.default.isJoined(self || this.parsedLocus.self);
2464
+
2465
+ // The parsed userDisplayHints depend on info, roles and isJoined, so we must recompute
2466
+ // whenever any of them changes. A common case is self transitioning to JOINED via a delta
2467
+ // that doesn't carry an info section - in that case we fall back to the previously stored
2468
+ // info so the hints get reparsed with the new joined state (e.g. VIEW_THE_PARTICIPANT_LIST).
2469
+ var infoToParse = info || this.info;
2470
+ var infoChanged = info && !(0, _lodash.isEqual)(this.info, info);
2471
+ var rolesChanged = !(0, _lodash.isEqual)(this.roles, roles);
2472
+ var isJoinedChanged = _selfUtils.default.isJoined(this.parsedLocus.self) !== isJoined;
2473
+ if (infoToParse && (infoChanged || rolesChanged || isJoinedChanged)) {
2474
+ var parsedInfo = _infoUtils.default.getInfos(this.parsedLocus.info, infoToParse, roles, isJoined);
2048
2475
  if (parsedInfo.updates.isLocked) {
2049
2476
  this.emitScoped({
2050
2477
  file: 'locus-info',
@@ -2057,10 +2484,10 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2057
2484
  function: 'updateMeetingInfo'
2058
2485
  }, _constants.LOCUSINFO.EVENTS.MEETING_UNLOCKED, info);
2059
2486
  }
2060
- this.info = info;
2487
+ this.info = infoToParse;
2061
2488
  this.parsedLocus.info = parsedInfo.current;
2062
2489
  // Parses the info and adds necessary values
2063
- this.updateMeeting(parsedInfo.current);
2490
+ this.callbacks.updateMeeting(parsedInfo.current);
2064
2491
  this.emitScoped({
2065
2492
  file: 'locus-info',
2066
2493
  function: 'updateMeetingInfo'
@@ -2084,7 +2511,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2084
2511
  return;
2085
2512
  }
2086
2513
  var parsedEmbeddedApps = _embeddedAppsUtils.default.parse(embeddedApps);
2087
- this.updateMeeting({
2514
+ this.callbacks.updateMeeting({
2088
2515
  embeddedApps: parsedEmbeddedApps
2089
2516
  });
2090
2517
  this.emitScoped({
@@ -2108,7 +2535,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2108
2535
  var forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2109
2536
  if (mediaShares && (!(0, _lodash.isEqual)(this.mediaShares, mediaShares) || forceUpdate)) {
2110
2537
  var parsedMediaShares = _mediaSharesUtils.default.getMediaShares(this.mediaShares, mediaShares);
2111
- this.updateMeeting(parsedMediaShares.current);
2538
+ this.callbacks.updateMeeting(parsedMediaShares.current);
2112
2539
  this.parsedLocus.mediaShares = parsedMediaShares.current;
2113
2540
  this.mediaShares = mediaShares;
2114
2541
  this.emitScoped({
@@ -2147,10 +2574,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2147
2574
  value: function updateSelf(self) {
2148
2575
  if (self) {
2149
2576
  var _this$parsedLocus$ful7, _this$parsedLocus$inf;
2577
+ var wasLlmExpected = this.isLlmExpected();
2150
2578
  // @ts-ignore
2151
2579
  var parsedSelves = _selfUtils.default.getSelves(this.parsedLocus.self, self, this.webex.internal.device.url, this.participants // using this.participants instead of locus.participants here, because with delta DTOs locus.participants will only contain a small subset of participants
2152
2580
  );
2153
- this.updateMeeting(parsedSelves.current);
2581
+ this.callbacks.updateMeeting(parsedSelves.current);
2154
2582
  this.parsedLocus.self = parsedSelves.current;
2155
2583
  var element = this.parsedLocus.states[this.parsedLocus.states.length - 1];
2156
2584
  if (element !== parsedSelves.current.state) {
@@ -2161,7 +2589,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2161
2589
  // this.emit(LOCUSINFO.EVENTS.MEETING_UPDATE, SelfUtils.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState?.type, this.parsedLocus.info?.sipUri));
2162
2590
  var result = _selfUtils.default.getSipUrl(this.getLocusPartner(this.participants, self), (_this$parsedLocus$ful7 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful7 === void 0 ? void 0 : _this$parsedLocus$ful7.type, (_this$parsedLocus$inf = this.parsedLocus.info) === null || _this$parsedLocus$inf === void 0 ? void 0 : _this$parsedLocus$inf.sipUri);
2163
2591
  if (result !== null && result !== void 0 && result.sipUri) {
2164
- this.updateMeeting(result);
2592
+ this.callbacks.updateMeeting(result);
2165
2593
  }
2166
2594
  if (parsedSelves.updates.moderatorChanged) {
2167
2595
  this.compareAndUpdateFlags.compareHostAndSelf = true;
@@ -2243,23 +2671,25 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2243
2671
  });
2244
2672
  }
2245
2673
  if (parsedSelves.updates.localAudioUnmuteRequiredByServer) {
2674
+ var _parsedSelves$current2;
2246
2675
  this.emitScoped({
2247
2676
  file: 'locus-info',
2248
2677
  function: 'updateSelf'
2249
2678
  }, _constants.LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUIRED, {
2250
2679
  muted: parsedSelves.current.remoteMuted,
2251
- unmuteAllowed: parsedSelves.current.unmuteAllowed
2680
+ unmuteAllowed: parsedSelves.current.unmuteAllowed,
2681
+ modifiedBy: (_parsedSelves$current2 = parsedSelves.current.modifiedBy) !== null && _parsedSelves$current2 !== void 0 ? _parsedSelves$current2 : null
2252
2682
  });
2253
2683
  }
2254
2684
  if (parsedSelves.updates.isMutedByOthersChanged) {
2255
- var _parsedSelves$current2;
2685
+ var _parsedSelves$current3;
2256
2686
  this.emitScoped({
2257
2687
  file: 'locus-info',
2258
2688
  function: 'updateSelf'
2259
2689
  }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED, {
2260
2690
  muted: parsedSelves.current.remoteMuted,
2261
2691
  unmuteAllowed: parsedSelves.current.unmuteAllowed,
2262
- modifiedBy: (_parsedSelves$current2 = parsedSelves.current.modifiedBy) !== null && _parsedSelves$current2 !== void 0 ? _parsedSelves$current2 : null
2692
+ modifiedBy: (_parsedSelves$current3 = parsedSelves.current.modifiedBy) !== null && _parsedSelves$current3 !== void 0 ? _parsedSelves$current3 : null
2263
2693
  });
2264
2694
  }
2265
2695
  if (parsedSelves.updates.localAudioUnmuteRequestedByServer) {
@@ -2289,14 +2719,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2289
2719
  _constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, _selfUtils.default.getMediaStatus(self.mediaSessions));
2290
2720
  }
2291
2721
  if (parsedSelves.updates.audioStateChange || parsedSelves.updates.videoStateChange || parsedSelves.updates.shareStateChange) {
2292
- var _parsedSelves$current3, _parsedSelves$current4, _parsedSelves$current5;
2722
+ var _parsedSelves$current4, _parsedSelves$current5, _parsedSelves$current6;
2293
2723
  this.emitScoped({
2294
2724
  file: 'locus-info',
2295
2725
  function: 'updateSelf'
2296
2726
  }, _constants.LOCUSINFO.EVENTS.MEDIA_STATUS_CHANGE, {
2297
- audioStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.audio,
2298
- videoStatus: (_parsedSelves$current4 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current4 === void 0 ? void 0 : _parsedSelves$current4.video,
2299
- shareStatus: (_parsedSelves$current5 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current5 === void 0 ? void 0 : _parsedSelves$current5.share
2727
+ audioStatus: (_parsedSelves$current4 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current4 === void 0 ? void 0 : _parsedSelves$current4.audio,
2728
+ videoStatus: (_parsedSelves$current5 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current5 === void 0 ? void 0 : _parsedSelves$current5.video,
2729
+ shareStatus: (_parsedSelves$current6 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current6 === void 0 ? void 0 : _parsedSelves$current6.share
2300
2730
  });
2301
2731
  }
2302
2732
  if (parsedSelves.updates.isUserObserving) {
@@ -2331,6 +2761,15 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2331
2761
  this.parsedLocus.self = parsedSelves.current;
2332
2762
  // @ts-ignore
2333
2763
  this.self = self;
2764
+
2765
+ // If LLM just became expected (self reported JOINED), some hash tree parsers may have skipped
2766
+ // arming heartbeat watchdog timers for LLM data sets whose messages arrived before this
2767
+ // update. Re-evaluate them now so those watchdogs get armed.
2768
+ if (!wasLlmExpected && this.isLlmExpected()) {
2769
+ this.hashTreeParsers.forEach(function (entry) {
2770
+ entry.parser.reevaluateLlmWatchdogs();
2771
+ });
2772
+ }
2334
2773
  } else {
2335
2774
  this.compareAndUpdateFlags.compareHostAndSelf = false;
2336
2775
  }
@@ -2349,7 +2788,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2349
2788
  var isMainLocus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2350
2789
  if (url && this.url !== url) {
2351
2790
  this.url = url;
2352
- this.updateMeeting({
2791
+ this.callbacks.updateMeeting({
2353
2792
  locusUrl: url
2354
2793
  });
2355
2794
  this.emitScoped({
@@ -2478,7 +2917,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2478
2917
  }, {
2479
2918
  key: "updateMainSessionLocusCache",
2480
2919
  value: function updateMainSessionLocusCache(mainLocus) {
2481
- var _this7 = this;
2920
+ var _this9 = this;
2482
2921
  if (!mainLocus) {
2483
2922
  return;
2484
2923
  }
@@ -2487,7 +2926,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2487
2926
  // shallow merge and do special merge for participants
2488
2927
  (0, _lodash.assignWith)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
2489
2928
  if (key === 'participants') {
2490
- return _this7.mergeParticipants(objValue, srcValue);
2929
+ return _this9.mergeParticipants(objValue, srcValue);
2491
2930
  }
2492
2931
  return srcValue || objValue;
2493
2932
  });