@webex/plugin-meetings 3.12.0-webex-services-ready.4 → 3.13.0-next.1

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 (165) 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 +130 -4
  22. package/ai-docs/ARCHITECTURE.md +208 -0
  23. package/ai-docs/CONTRACTS.md +267 -0
  24. package/ai-docs/DATA_MODEL.md +64 -0
  25. package/ai-docs/GETTING_STARTED.md +73 -0
  26. package/ai-docs/GLOSSARY.md +56 -0
  27. package/ai-docs/REVIEW_CHECKLIST.md +45 -0
  28. package/ai-docs/RULES.md +79 -0
  29. package/ai-docs/SECURITY.md +74 -0
  30. package/ai-docs/SERVICE_STATE.md +59 -0
  31. package/ai-docs/SPEC_INDEX.md +85 -0
  32. package/ai-docs/TEST_INDEX.md +45 -0
  33. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
  34. package/ai-docs/patterns/defensive-error-propagation.md +55 -0
  35. package/ai-docs/patterns/event-scope-emission.md +46 -0
  36. package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
  37. package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
  38. package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
  39. package/assets/README.md +28 -0
  40. package/assets/e2ee-0.0.1.js +2 -0
  41. package/assets/e2ee-0.0.1.wasm +0 -0
  42. package/dist/aiEnableRequest/index.js +1 -1
  43. package/dist/annotation/index.js +55 -19
  44. package/dist/annotation/index.js.map +1 -1
  45. package/dist/assets/e2ee-0.0.1.js +2 -0
  46. package/dist/assets/e2ee-0.0.1.wasm +0 -0
  47. package/dist/breakouts/breakout.js +1 -1
  48. package/dist/breakouts/index.js +39 -5
  49. package/dist/breakouts/index.js.map +1 -1
  50. package/dist/common/errors/webex-errors.js +7 -2
  51. package/dist/common/errors/webex-errors.js.map +1 -1
  52. package/dist/config.js +1 -0
  53. package/dist/config.js.map +1 -1
  54. package/dist/constants.js +6 -5
  55. package/dist/constants.js.map +1 -1
  56. package/dist/hashTree/hashTreeParser.js +101 -48
  57. package/dist/hashTree/hashTreeParser.js.map +1 -1
  58. package/dist/index.js +1 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/interceptors/dataChannelAuthToken.js +41 -59
  61. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  62. package/dist/interceptors/locusRetry.js +1 -1
  63. package/dist/interceptors/locusRetry.js.map +1 -1
  64. package/dist/interpretation/index.js +46 -12
  65. package/dist/interpretation/index.js.map +1 -1
  66. package/dist/interpretation/siLanguage.js +1 -1
  67. package/dist/locus-info/index.js +236 -80
  68. package/dist/locus-info/index.js.map +1 -1
  69. package/dist/locus-info/types.js +2 -1
  70. package/dist/locus-info/types.js.map +1 -1
  71. package/dist/media/MediaConnectionAwaiter.js +225 -175
  72. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  73. package/dist/meeting/index.js +355 -299
  74. package/dist/meeting/index.js.map +1 -1
  75. package/dist/meeting/util.js +8 -2
  76. package/dist/meeting/util.js.map +1 -1
  77. package/dist/meeting/voicea-meeting.js +2 -1
  78. package/dist/meeting/voicea-meeting.js.map +1 -1
  79. package/dist/meeting-info/meeting-info-v2.js +10 -3
  80. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  81. package/dist/meetings/index.js +72 -31
  82. package/dist/meetings/index.js.map +1 -1
  83. package/dist/multistream/remoteMediaManager.js +32 -4
  84. package/dist/multistream/remoteMediaManager.js.map +1 -1
  85. package/dist/multistream/sendSlotManager.js +11 -1
  86. package/dist/multistream/sendSlotManager.js.map +1 -1
  87. package/dist/types/annotation/index.d.ts +19 -0
  88. package/dist/types/common/errors/webex-errors.d.ts +6 -2
  89. package/dist/types/config.d.ts +1 -0
  90. package/dist/types/constants.d.ts +2 -1
  91. package/dist/types/hashTree/hashTreeParser.d.ts +12 -0
  92. package/dist/types/index.d.ts +1 -0
  93. package/dist/types/locus-info/index.d.ts +45 -1
  94. package/dist/types/locus-info/types.d.ts +1 -0
  95. package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -53
  96. package/dist/types/meeting/index.d.ts +49 -12
  97. package/dist/types/meeting/util.d.ts +3 -1
  98. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  99. package/dist/types/meetings/index.d.ts +2 -1
  100. package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
  101. package/dist/types/multistream/sendSlotManager.d.ts +5 -1
  102. package/dist/webinar/index.js +298 -255
  103. package/dist/webinar/index.js.map +1 -1
  104. package/package.json +25 -23
  105. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  106. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  107. package/src/annotation/index.ts +61 -29
  108. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  109. package/src/breakouts/index.ts +35 -2
  110. package/src/common/errors/webex-errors.ts +8 -2
  111. package/src/config.ts +5 -1
  112. package/src/constants.ts +2 -1
  113. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  114. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  115. package/src/hashTree/hashTreeParser.ts +67 -3
  116. package/src/index.ts +1 -0
  117. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  118. package/src/interceptors/dataChannelAuthToken.ts +48 -77
  119. package/src/interceptors/locusRetry.ts +1 -1
  120. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  121. package/src/interpretation/index.ts +38 -1
  122. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  123. package/src/locus-info/index.ts +156 -35
  124. package/src/locus-info/types.ts +1 -0
  125. package/src/media/MediaConnectionAwaiter.ts +223 -207
  126. package/src/media/ai-docs/media-spec.md +267 -0
  127. package/src/meeting/ai-docs/meeting-spec.md +404 -0
  128. package/src/meeting/index.ts +332 -296
  129. package/src/meeting/util.ts +7 -4
  130. package/src/meeting/voicea-meeting.ts +1 -1
  131. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  132. package/src/meeting-info/meeting-info-v2.ts +7 -2
  133. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  134. package/src/meetings/index.ts +59 -23
  135. package/src/member/ai-docs/member-spec.md +196 -0
  136. package/src/members/ai-docs/members-spec.md +256 -0
  137. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  138. package/src/multistream/ai-docs/multistream-spec.md +295 -0
  139. package/src/multistream/remoteMediaManager.ts +23 -1
  140. package/src/multistream/sendSlotManager.ts +15 -1
  141. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  142. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  143. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  144. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  145. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  146. package/src/roap/ai-docs/roap-spec.md +241 -0
  147. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  148. package/src/webinar/index.ts +168 -188
  149. package/test/unit/spec/annotation/index.ts +214 -182
  150. package/test/unit/spec/breakouts/index.ts +145 -13
  151. package/test/unit/spec/hashTree/hashTreeParser.ts +212 -1
  152. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +81 -99
  153. package/test/unit/spec/interceptors/locusRetry.ts +29 -1
  154. package/test/unit/spec/interpretation/index.ts +93 -0
  155. package/test/unit/spec/locus-info/index.js +397 -0
  156. package/test/unit/spec/media/MediaConnectionAwaiter.ts +426 -19
  157. package/test/unit/spec/media/properties.ts +3 -3
  158. package/test/unit/spec/meeting/index.js +1219 -723
  159. package/test/unit/spec/meeting/utils.js +52 -18
  160. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  161. package/test/unit/spec/meeting-info/meetinginfov2.js +69 -1
  162. package/test/unit/spec/meetings/index.js +145 -43
  163. package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
  164. package/test/unit/spec/multistream/sendSlotManager.ts +30 -2
  165. package/test/unit/spec/webinar/index.ts +886 -718
@@ -21,9 +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"));
26
25
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
26
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
27
27
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
28
28
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
29
29
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
@@ -303,23 +303,46 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
303
303
  }
304
304
 
305
305
  /**
306
- * 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.
307
- * 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).
308
307
  *
309
- * @param {Meeting} meeting
310
- * @param {boolean} isLocusUrlChanged
311
- * @param {Locus} locus
312
- * @returns {undefined}
308
+ * @returns {boolean}
313
309
  */
314
310
  (0, _inherits2.default)(LocusInfo, _EventsScope);
315
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
+ }, {
316
334
  key: "doLocusSync",
317
335
  value: function doLocusSync(meeting, isLocusUrlChanged, locus) {
318
336
  var _this$locusParser$wor,
319
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;
320
341
  var url;
321
342
  var isDelta = false;
322
343
  var meetingDestroyed = false;
344
+ // whether the DTO fetch itself failed (as opposed to applying a successfully fetched DTO)
345
+ var fetchFailed = false;
323
346
  if (isLocusUrlChanged) {
324
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,
325
348
  // so use the main session locus url to get the full locus(full participants list in the response).
@@ -334,8 +357,28 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
334
357
  }
335
358
  _loggerProxy.default.logger.info("Locus-info:index#doLocusSync --> doing Locus sync (getting ".concat(isDelta ? 'delta' : 'full', " DTO)"));
336
359
 
337
- // return value ignored on purpose
338
- 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({
339
382
  url: url
340
383
  }).catch(function (e) {
341
384
  if (isDelta) {
@@ -355,19 +398,25 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
355
398
  return meeting.meetingRequest.getLocusDTO({
356
399
  url: meeting.locusUrl
357
400
  }).catch(function (err) {
358
- _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> fallback full sync failed, destroying the meeting');
359
- _this2.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
360
- meetingDestroyed = true;
361
- 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
+ );
362
408
  });
363
409
  }
364
- _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> got 403 from Locus, skipping fallback to full sync, destroying the meeting');
365
- } else {
366
- _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
+ });
367
416
  }
368
- _this2.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
369
- meetingDestroyed = true;
370
- throw e;
417
+ return onFetchFailure(e, 'full sync failed', {
418
+ terminal: e.statusCode === 403
419
+ });
371
420
  }).then(function (res) {
372
421
  if ((0, _lodash.isEmpty)(res.body)) {
373
422
  if (isDelta) {
@@ -387,15 +436,27 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
387
436
  }
388
437
  meeting.locusInfo.onFullLocus('classic Locus sync', res.body);
389
438
  }).catch(function (e) {
390
- _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(), ")"));
391
- _metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_SYNC_HANDLING_FAILED, {
392
- correlationId: meeting.correlationId,
393
- url: url,
394
- reason: e.message,
395
- errorName: e.name,
396
- stack: e.stack,
397
- code: e.code
398
- });
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
+ }
399
460
  }).finally(function () {
400
461
  if (!meetingDestroyed) {
401
462
  // Notify parser to resume processing delta events.
@@ -405,6 +466,73 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
405
466
  });
406
467
  }
407
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
+ }()
408
536
  /**
409
537
  * Apply locus delta data to meeting
410
538
  * @param {string} action Locus delta action
@@ -412,6 +540,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
412
540
  * @param {Meeting} meeting
413
541
  * @returns {undefined}
414
542
  */
543
+ )
415
544
  }, {
416
545
  key: "applyLocusDeltaData",
417
546
  value: function applyLocusDeltaData(action, locus, meeting) {
@@ -506,6 +635,18 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
506
635
  this.updateLinks(locus.links);
507
636
  }
508
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
+
509
650
  /**
510
651
  * Creates a HashTreeParser instance for a given locusUrl and stores it in the map.
511
652
  * @param {Object} params
@@ -517,15 +658,15 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
517
658
  */
518
659
  }, {
519
660
  key: "createHashTreeParser",
520
- value: function createHashTreeParser(_ref) {
661
+ value: function createHashTreeParser(_ref4) {
521
662
  var _this4 = this,
522
663
  _locusUrl$split,
523
664
  _locusUrl$split$pop,
524
665
  _this$webex$config$me;
525
- var locusUrl = _ref.locusUrl,
526
- initialLocus = _ref.initialLocus,
527
- metadata = _ref.metadata,
528
- replacedAt = _ref.replacedAt;
666
+ var locusUrl = _ref4.locusUrl,
667
+ initialLocus = _ref4.initialLocus,
668
+ metadata = _ref4.metadata,
669
+ replacedAt = _ref4.replacedAt;
529
670
  var parser = new _hashTreeParser2.default({
530
671
  initialLocus: initialLocus,
531
672
  metadata: metadata,
@@ -533,6 +674,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
533
674
  callbacks: {
534
675
  locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
535
676
  syncLatencyTracker: this.callbacks.syncLatencyTracker,
677
+ isLlmExpected: function isLlmExpected() {
678
+ return _this4.isLlmExpected();
679
+ },
536
680
  // Reuse webex-core's tracking-id interceptor sequence (exposed publicly via
537
681
  // webexTrackingIdSequenceNumbers) so Locus requests share the client's unified
538
682
  // ${sessionId}_${sequence} tracking id space instead of minting an unrelated id. Fall
@@ -591,19 +735,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
591
735
  }, {
592
736
  key: "initialSetup",
593
737
  value: (function () {
594
- var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(data, onLocusSynced) {
738
+ var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(data, onLocusSynced) {
595
739
  var _data$locus, _data$locus$links, _data$locus$links$res, _data$locus$links$res2;
596
740
  var initialFullLocus, _data$hashTreeMessage, _metadataObject$data, metadataObject, hashTreeParser, _hashTreeParser, _t;
597
- return _regenerator.default.wrap(function (_context) {
598
- while (1) switch (_context.prev = _context.next) {
741
+ return _regenerator.default.wrap(function (_context2) {
742
+ while (1) switch (_context2.prev = _context2.next) {
599
743
  case 0:
600
744
  initialFullLocus = null;
601
745
  _t = data.trigger;
602
- _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;
603
747
  break;
604
748
  case 1:
605
749
  if (!data.hashTreeMessage) {
606
- _context.next = 4;
750
+ _context2.next = 4;
607
751
  break;
608
752
  }
609
753
  // we need the Metadata object to be in the received message, because it contains visibleDataSets
@@ -612,7 +756,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
612
756
  return (0, _utils.isMetadata)(el);
613
757
  });
614
758
  if (metadataObject !== null && metadataObject !== void 0 && (_metadataObject$data = metadataObject.data) !== null && _metadataObject$data !== void 0 && _metadataObject$data.visibleDataSets) {
615
- _context.next = 2;
759
+ _context2.next = 2;
616
760
  break;
617
761
  }
618
762
  // this is a common case (not an error)
@@ -635,25 +779,25 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
635
779
  visibleDataSets: metadataObject.data.visibleDataSets
636
780
  }
637
781
  }); // now handle the message - that should populate all the visible datasets
638
- _context.next = 3;
782
+ _context2.next = 3;
639
783
  return hashTreeParser.initializeFromMessage(data.hashTreeMessage);
640
784
  case 3:
641
- _context.next = 5;
785
+ _context2.next = 5;
642
786
  break;
643
787
  case 4:
644
788
  // "classic" Locus case, no hash trees involved
645
789
  this.updateLocusCache(data.locus);
646
790
  this.onFullLocus('classic locus message', data.locus, undefined);
647
791
  case 5:
648
- return _context.abrupt("continue", 10);
792
+ return _context2.abrupt("continue", 10);
649
793
  case 6:
650
794
  this.updateLocusCache(data.locus);
651
795
  this.onFullLocus('join response', data.locus, undefined, data.dataSets, data.metadata);
652
796
  initialFullLocus = data.locus;
653
- return _context.abrupt("continue", 10);
797
+ return _context2.abrupt("continue", 10);
654
798
  case 7:
655
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)) {
656
- _context.next = 9;
800
+ _context2.next = 9;
657
801
  break;
658
802
  }
659
803
  _loggerProxy.default.logger.info('Locus-info:index#initialSetup --> creating HashTreeParser from get-loci-response');
@@ -666,10 +810,10 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
666
810
  },
667
811
  metadata: null // get-loci-response doesn't contain Metadata object
668
812
  }); // now initialize all the data
669
- _context.next = 8;
813
+ _context2.next = 8;
670
814
  return _hashTreeParser.initializeFromGetLociResponse(data.locus);
671
815
  case 8:
672
- _context.next = 10;
816
+ _context2.next = 10;
673
817
  break;
674
818
  case 9:
675
819
  // "classic" Locus case, no hash trees involved
@@ -689,11 +833,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
689
833
  this.emitChange = true;
690
834
  case 11:
691
835
  case "end":
692
- return _context.stop();
836
+ return _context2.stop();
693
837
  }
694
- }, _callee, this);
838
+ }, _callee2, this);
695
839
  }));
696
- function initialSetup(_x, _x2) {
840
+ function initialSetup(_x3, _x4) {
697
841
  return _initialSetup.apply(this, arguments);
698
842
  }
699
843
  return initialSetup;
@@ -735,7 +879,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
735
879
  var locusUrl = isWrapped ? (_responseBody$locus = responseBody.locus) === null || _responseBody$locus === void 0 ? void 0 : _responseBody$locus.url : responseBody.url;
736
880
  var hashTreeParserEntry = locusUrl && this.hashTreeParsers.get(locusUrl);
737
881
  var locus = isWrapped ? responseBody.locus : responseBody;
738
- if (this.hashTreeParsers.size > 0) {
882
+ if (this.isUsingHashTrees()) {
739
883
  // We are in hash tree mode. Check if we need to create/reactivate a parser for this locusUrl.
740
884
  if (!hashTreeParserEntry || hashTreeParserEntry.parser.state === 'stopped') {
741
885
  if (!locusUrl) {
@@ -1120,52 +1264,52 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1120
1264
  }, {
1121
1265
  key: "syncAllHashTreeDatasets",
1122
1266
  value: (function () {
1123
- var _syncAllHashTreeDatasets = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
1267
+ var _syncAllHashTreeDatasets = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
1124
1268
  var options,
1125
1269
  _iterator3,
1126
1270
  _step3,
1127
1271
  _step3$value,
1128
1272
  entry,
1129
- _args2 = arguments,
1273
+ _args3 = arguments,
1130
1274
  _t2;
1131
- return _regenerator.default.wrap(function (_context2) {
1132
- while (1) switch (_context2.prev = _context2.next) {
1275
+ return _regenerator.default.wrap(function (_context3) {
1276
+ while (1) switch (_context3.prev = _context3.next) {
1133
1277
  case 0:
1134
- options = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
1278
+ options = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
1135
1279
  _iterator3 = _createForOfIteratorHelper(this.hashTreeParsers);
1136
- _context2.prev = 1;
1280
+ _context3.prev = 1;
1137
1281
  _iterator3.s();
1138
1282
  case 2:
1139
1283
  if ((_step3 = _iterator3.n()).done) {
1140
- _context2.next = 4;
1284
+ _context3.next = 4;
1141
1285
  break;
1142
1286
  }
1143
1287
  _step3$value = (0, _slicedToArray2.default)(_step3.value, 2), entry = _step3$value[1];
1144
1288
  if (!entry.parser) {
1145
- _context2.next = 3;
1289
+ _context3.next = 3;
1146
1290
  break;
1147
1291
  }
1148
- _context2.next = 3;
1292
+ _context3.next = 3;
1149
1293
  return entry.parser.syncAllDatasets(options);
1150
1294
  case 3:
1151
- _context2.next = 2;
1295
+ _context3.next = 2;
1152
1296
  break;
1153
1297
  case 4:
1154
- _context2.next = 6;
1298
+ _context3.next = 6;
1155
1299
  break;
1156
1300
  case 5:
1157
- _context2.prev = 5;
1158
- _t2 = _context2["catch"](1);
1301
+ _context3.prev = 5;
1302
+ _t2 = _context3["catch"](1);
1159
1303
  _iterator3.e(_t2);
1160
1304
  case 6:
1161
- _context2.prev = 6;
1305
+ _context3.prev = 6;
1162
1306
  _iterator3.f();
1163
- return _context2.finish(6);
1307
+ return _context3.finish(6);
1164
1308
  case 7:
1165
1309
  case "end":
1166
- return _context2.stop();
1310
+ return _context3.stop();
1167
1311
  }
1168
- }, _callee2, this, [[1, 5, 6, 7]]);
1312
+ }, _callee3, this, [[1, 5, 6, 7]]);
1169
1313
  }));
1170
1314
  function syncAllHashTreeDatasets() {
1171
1315
  return _syncAllHashTreeDatasets.apply(this, arguments);
@@ -1302,7 +1446,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1302
1446
  }, {
1303
1447
  key: "parse",
1304
1448
  value: function parse(meeting, data) {
1305
- if (this.hashTreeParsers.size > 0) {
1449
+ if (this.isUsingHashTrees()) {
1306
1450
  if (data.eventType === _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS) {
1307
1451
  // sync meetings response follows the format of "not wrapped" locus API responses,
1308
1452
  // so has no dataSets nor Metadata
@@ -2220,9 +2364,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2220
2364
  key: "updateLinks",
2221
2365
  value: function updateLinks(links) {
2222
2366
  var _this$links, _this$links2;
2223
- var _ref2 = links || {},
2224
- services = _ref2.services,
2225
- resources = _ref2.resources;
2367
+ var _ref5 = links || {},
2368
+ services = _ref5.services,
2369
+ resources = _ref5.resources;
2226
2370
  if (services && !(0, _lodash.isEqual)((_this$links = this.links) === null || _this$links === void 0 ? void 0 : _this$links.services, services)) {
2227
2371
  this.emitScoped({
2228
2372
  file: 'locus-info',
@@ -2314,8 +2458,8 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2314
2458
  }, {
2315
2459
  key: "updateMeetingInfo",
2316
2460
  value: function updateMeetingInfo(info, self) {
2317
- var _this$parsedLocus$sel;
2318
- 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) || [];
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) || [];
2319
2463
  var isJoined = _selfUtils.default.isJoined(self || this.parsedLocus.self);
2320
2464
 
2321
2465
  // The parsed userDisplayHints depend on info, roles and isJoined, so we must recompute
@@ -2430,6 +2574,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2430
2574
  value: function updateSelf(self) {
2431
2575
  if (self) {
2432
2576
  var _this$parsedLocus$ful7, _this$parsedLocus$inf;
2577
+ var wasLlmExpected = this.isLlmExpected();
2433
2578
  // @ts-ignore
2434
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
2435
2580
  );
@@ -2526,23 +2671,25 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2526
2671
  });
2527
2672
  }
2528
2673
  if (parsedSelves.updates.localAudioUnmuteRequiredByServer) {
2674
+ var _parsedSelves$current2;
2529
2675
  this.emitScoped({
2530
2676
  file: 'locus-info',
2531
2677
  function: 'updateSelf'
2532
2678
  }, _constants.LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUIRED, {
2533
2679
  muted: parsedSelves.current.remoteMuted,
2534
- unmuteAllowed: parsedSelves.current.unmuteAllowed
2680
+ unmuteAllowed: parsedSelves.current.unmuteAllowed,
2681
+ modifiedBy: (_parsedSelves$current2 = parsedSelves.current.modifiedBy) !== null && _parsedSelves$current2 !== void 0 ? _parsedSelves$current2 : null
2535
2682
  });
2536
2683
  }
2537
2684
  if (parsedSelves.updates.isMutedByOthersChanged) {
2538
- var _parsedSelves$current2;
2685
+ var _parsedSelves$current3;
2539
2686
  this.emitScoped({
2540
2687
  file: 'locus-info',
2541
2688
  function: 'updateSelf'
2542
2689
  }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED, {
2543
2690
  muted: parsedSelves.current.remoteMuted,
2544
2691
  unmuteAllowed: parsedSelves.current.unmuteAllowed,
2545
- 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
2546
2693
  });
2547
2694
  }
2548
2695
  if (parsedSelves.updates.localAudioUnmuteRequestedByServer) {
@@ -2572,14 +2719,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2572
2719
  _constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, _selfUtils.default.getMediaStatus(self.mediaSessions));
2573
2720
  }
2574
2721
  if (parsedSelves.updates.audioStateChange || parsedSelves.updates.videoStateChange || parsedSelves.updates.shareStateChange) {
2575
- var _parsedSelves$current3, _parsedSelves$current4, _parsedSelves$current5;
2722
+ var _parsedSelves$current4, _parsedSelves$current5, _parsedSelves$current6;
2576
2723
  this.emitScoped({
2577
2724
  file: 'locus-info',
2578
2725
  function: 'updateSelf'
2579
2726
  }, _constants.LOCUSINFO.EVENTS.MEDIA_STATUS_CHANGE, {
2580
- audioStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.audio,
2581
- videoStatus: (_parsedSelves$current4 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current4 === void 0 ? void 0 : _parsedSelves$current4.video,
2582
- 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
2583
2730
  });
2584
2731
  }
2585
2732
  if (parsedSelves.updates.isUserObserving) {
@@ -2614,6 +2761,15 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2614
2761
  this.parsedLocus.self = parsedSelves.current;
2615
2762
  // @ts-ignore
2616
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
+ }
2617
2773
  } else {
2618
2774
  this.compareAndUpdateFlags.compareHostAndSelf = false;
2619
2775
  }