@webex/plugin-meetings 3.12.0-next.3 → 3.12.0-next.31

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 (90) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +1 -1
  3. package/dist/breakouts/breakout.js +1 -1
  4. package/dist/breakouts/index.js +1 -1
  5. package/dist/constants.js +3 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/controls-options-manager/constants.js +11 -1
  8. package/dist/controls-options-manager/constants.js.map +1 -1
  9. package/dist/controls-options-manager/index.js +23 -21
  10. package/dist/controls-options-manager/index.js.map +1 -1
  11. package/dist/controls-options-manager/util.js +91 -0
  12. package/dist/controls-options-manager/util.js.map +1 -1
  13. package/dist/hashTree/constants.js +10 -1
  14. package/dist/hashTree/constants.js.map +1 -1
  15. package/dist/hashTree/hashTreeParser.js +550 -346
  16. package/dist/hashTree/hashTreeParser.js.map +1 -1
  17. package/dist/hashTree/utils.js +22 -0
  18. package/dist/hashTree/utils.js.map +1 -1
  19. package/dist/interceptors/locusRetry.js +23 -8
  20. package/dist/interceptors/locusRetry.js.map +1 -1
  21. package/dist/interpretation/index.js +1 -1
  22. package/dist/interpretation/siLanguage.js +1 -1
  23. package/dist/locus-info/index.js +222 -61
  24. package/dist/locus-info/index.js.map +1 -1
  25. package/dist/meeting/index.js +372 -292
  26. package/dist/meeting/index.js.map +1 -1
  27. package/dist/meeting/util.js +1 -0
  28. package/dist/meeting/util.js.map +1 -1
  29. package/dist/meetings/index.js +146 -62
  30. package/dist/meetings/index.js.map +1 -1
  31. package/dist/meetings/util.js +39 -5
  32. package/dist/meetings/util.js.map +1 -1
  33. package/dist/member/index.js +10 -0
  34. package/dist/member/index.js.map +1 -1
  35. package/dist/member/types.js.map +1 -1
  36. package/dist/member/util.js +3 -0
  37. package/dist/member/util.js.map +1 -1
  38. package/dist/metrics/constants.js +5 -1
  39. package/dist/metrics/constants.js.map +1 -1
  40. package/dist/multistream/sendSlotManager.js +116 -2
  41. package/dist/multistream/sendSlotManager.js.map +1 -1
  42. package/dist/types/constants.d.ts +1 -0
  43. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  44. package/dist/types/hashTree/constants.d.ts +1 -0
  45. package/dist/types/hashTree/hashTreeParser.d.ts +53 -15
  46. package/dist/types/hashTree/utils.d.ts +11 -0
  47. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  48. package/dist/types/locus-info/index.d.ts +38 -5
  49. package/dist/types/meeting/index.d.ts +11 -0
  50. package/dist/types/member/index.d.ts +1 -0
  51. package/dist/types/member/types.d.ts +1 -0
  52. package/dist/types/member/util.d.ts +1 -0
  53. package/dist/types/metrics/constants.d.ts +4 -0
  54. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  55. package/dist/webinar/index.js +301 -226
  56. package/dist/webinar/index.js.map +1 -1
  57. package/package.json +16 -16
  58. package/src/constants.ts +1 -0
  59. package/src/controls-options-manager/constants.ts +14 -1
  60. package/src/controls-options-manager/index.ts +26 -19
  61. package/src/controls-options-manager/util.ts +81 -1
  62. package/src/hashTree/constants.ts +9 -0
  63. package/src/hashTree/hashTreeParser.ts +273 -154
  64. package/src/hashTree/utils.ts +17 -0
  65. package/src/interceptors/locusRetry.ts +25 -4
  66. package/src/locus-info/index.ts +233 -79
  67. package/src/meeting/index.ts +98 -11
  68. package/src/meeting/util.ts +1 -0
  69. package/src/meetings/index.ts +58 -34
  70. package/src/meetings/util.ts +44 -1
  71. package/src/member/index.ts +10 -0
  72. package/src/member/types.ts +1 -0
  73. package/src/member/util.ts +3 -0
  74. package/src/metrics/constants.ts +5 -0
  75. package/src/multistream/sendSlotManager.ts +97 -3
  76. package/src/webinar/index.ts +75 -1
  77. package/test/unit/spec/controls-options-manager/index.js +114 -6
  78. package/test/unit/spec/controls-options-manager/util.js +165 -0
  79. package/test/unit/spec/hashTree/hashTreeParser.ts +839 -37
  80. package/test/unit/spec/hashTree/utils.ts +88 -1
  81. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  82. package/test/unit/spec/locus-info/index.js +262 -64
  83. package/test/unit/spec/meeting/index.js +54 -36
  84. package/test/unit/spec/meeting/utils.js +4 -0
  85. package/test/unit/spec/meetings/index.js +190 -8
  86. package/test/unit/spec/meetings/utils.js +124 -0
  87. package/test/unit/spec/member/index.js +7 -0
  88. package/test/unit/spec/member/util.js +24 -0
  89. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  90. package/test/unit/spec/webinar/index.ts +60 -0
@@ -64,7 +64,7 @@ var _noMeetingInfo = _interopRequireDefault(require("../common/errors/no-meeting
64
64
  var _joinForbiddenError = _interopRequireDefault(require("../common/errors/join-forbidden-error"));
65
65
  var _utils = require("../hashTree/utils");
66
66
  var _locusInfo = require("../locus-info");
67
- 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); }
67
+ 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 _t4 in e) "default" !== _t4 && {}.hasOwnProperty.call(e, _t4) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t4)) && (i.get || i.set) ? o(f, _t4, i) : f[_t4] = e[_t4]); return f; })(e, t); }
68
68
  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; }
69
69
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
70
70
  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)); }
@@ -354,11 +354,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
354
354
  return (0, _createClass2.default)(Meetings, [{
355
355
  key: "isNeedHandleMainLocus",
356
356
  value: function isNeedHandleMainLocus(meeting, newLocus) {
357
- var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _newLocus$self2, _newLocus$self3, _breakoutLocus$joined, _newLocus$self4;
357
+ var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _breakoutLocus$joined, _newLocus$self2;
358
358
  var breakoutUrl = (_newLocus$controls = newLocus.controls) === null || _newLocus$controls === void 0 ? void 0 : (_newLocus$controls$br = _newLocus$controls.breakout) === null || _newLocus$controls$br === void 0 ? void 0 : _newLocus$controls$br.url;
359
359
  var breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
360
360
  var isSelfJoined = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self = newLocus.self) === null || _newLocus$self === void 0 ? void 0 : _newLocus$self.state) === _constants._JOINED_;
361
- var isSelfMoved = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self2 = newLocus.self) === null || _newLocus$self2 === void 0 ? void 0 : _newLocus$self2.state) === _constants._LEFT_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self3 = newLocus.self) === null || _newLocus$self3 === void 0 ? void 0 : _newLocus$self3.reason) === _constants._MOVED_;
361
+ var isSelfMoved = _util2.default.isSelfMovedOrBreakoutEnded(newLocus);
362
362
  // @ts-ignore
363
363
  var deviceFromNewLocus = _util2.default.getThisDevice(newLocus, this.webex.internal.device.url);
364
364
  var isResourceMovedOnThisDevice = (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.state) === _constants._LEFT_ && (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.reason) === _constants._MOVED_;
@@ -383,7 +383,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
383
383
  _loggerProxy.default.logger.log("Meetings:index#isNeedHandleMainLocus --> there is active breakout session and joined on this device, and don't need to handle main session: ".concat(breakoutUrl));
384
384
  return false;
385
385
  }
386
- if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self4 = newLocus.self) !== null && _newLocus$self4 !== void 0 && _newLocus$self4.removed || isResourceMovedOnThisDevice)) {
386
+ if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self2 = newLocus.self) !== null && _newLocus$self2 !== void 0 && _newLocus$self2.removed || isResourceMovedOnThisDevice)) {
387
387
  _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle');
388
388
  return false;
389
389
  }
@@ -407,15 +407,15 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
407
407
  key: "isNeedHandleLocusDTO",
408
408
  value: function isNeedHandleLocusDTO(meeting, newLocus) {
409
409
  if (newLocus) {
410
- var _newLocus$self5, _newLocus$self6, _newLocus$self7, _newLocus$self7$devic, _newLocus$self7$devic2, _newLocus$self8, _newLocus$self8$devic, _newLocus$self8$devic2;
410
+ var _newLocus$self3, _newLocus$self3$devic, _newLocus$self3$devic2, _newLocus$self4, _newLocus$self4$devic, _newLocus$self4$devic2;
411
411
  var isNewLocusAsBreakout = _util2.default.isBreakoutLocusDTO(newLocus);
412
- var isSelfMoved = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self5 = newLocus.self) === null || _newLocus$self5 === void 0 ? void 0 : _newLocus$self5.state) === _constants._LEFT_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self6 = newLocus.self) === null || _newLocus$self6 === void 0 ? void 0 : _newLocus$self6.reason) === _constants._MOVED_;
413
- var isSelfMovedToLobby = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self7 = newLocus.self) === null || _newLocus$self7 === void 0 ? void 0 : (_newLocus$self7$devic = _newLocus$self7.devices[0]) === null || _newLocus$self7$devic === void 0 ? void 0 : (_newLocus$self7$devic2 = _newLocus$self7$devic.intent) === null || _newLocus$self7$devic2 === void 0 ? void 0 : _newLocus$self7$devic2.reason) === _constants._ON_HOLD_LOBBY_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self8 = newLocus.self) === null || _newLocus$self8 === void 0 ? void 0 : (_newLocus$self8$devic = _newLocus$self8.devices[0]) === null || _newLocus$self8$devic === void 0 ? void 0 : (_newLocus$self8$devic2 = _newLocus$self8$devic.intent) === null || _newLocus$self8$devic2 === void 0 ? void 0 : _newLocus$self8$devic2.type) === _constants._WAIT_;
412
+ var isSelfMoved = _util2.default.isSelfMovedOrBreakoutEnded(newLocus);
413
+ var isSelfMovedToLobby = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self3 = newLocus.self) === null || _newLocus$self3 === void 0 ? void 0 : (_newLocus$self3$devic = _newLocus$self3.devices[0]) === null || _newLocus$self3$devic === void 0 ? void 0 : (_newLocus$self3$devic2 = _newLocus$self3$devic.intent) === null || _newLocus$self3$devic2 === void 0 ? void 0 : _newLocus$self3$devic2.reason) === _constants._ON_HOLD_LOBBY_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self4 = newLocus.self) === null || _newLocus$self4 === void 0 ? void 0 : (_newLocus$self4$devic = _newLocus$self4.devices[0]) === null || _newLocus$self4$devic === void 0 ? void 0 : (_newLocus$self4$devic2 = _newLocus$self4$devic.intent) === null || _newLocus$self4$devic2 === void 0 ? void 0 : _newLocus$self4$devic2.type) === _constants._WAIT_;
414
414
  if (!meeting) {
415
415
  if (isNewLocusAsBreakout) {
416
- var _newLocus$fullState, _newLocus$self9;
416
+ var _newLocus$fullState, _newLocus$self5;
417
417
  _loggerProxy.default.logger.log("Meetings:index#isNeedHandleLocusDTO --> the first breakout session locusDTO active status: ".concat((_newLocus$fullState = newLocus.fullState) === null || _newLocus$fullState === void 0 ? void 0 : _newLocus$fullState.active));
418
- return ((_newLocus$self9 = newLocus.self) === null || _newLocus$self9 === void 0 ? void 0 : _newLocus$self9.state) === _constants._JOINED_;
418
+ return ((_newLocus$self5 = newLocus.self) === null || _newLocus$self5 === void 0 ? void 0 : _newLocus$self5.state) === _constants._JOINED_;
419
419
  }
420
420
  return this.isNeedHandleMainLocus(meeting, newLocus);
421
421
  }
@@ -451,9 +451,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
451
451
  }
452
452
  if (data.eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
453
453
  // need to check if maybe this event indicates a move to/from breakout
454
- var meetingForHashTreeMessage = (0, _locusInfo.findMeetingForHashTreeMessage)(data.stateElementsMessage, this.meetingCollection,
455
- // @ts-ignore
456
- this.webex.internal.device.url);
454
+ var meetingForHashTreeMessage = (0, _locusInfo.findMeetingForHashTreeMessage)(data === null || data === void 0 ? void 0 : data.stateElementsMessage, this.meetingCollection);
457
455
  if (meetingForHashTreeMessage) {
458
456
  return meetingForHashTreeMessage;
459
457
  }
@@ -493,7 +491,6 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
493
491
  var _this2 = this;
494
492
  var useRandomDelayForInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
495
493
  var meeting = this.getCorrespondingMeetingByLocus(data);
496
-
497
494
  // @ts-ignore
498
495
  if (this.config.experimental.storeLocusHashTreeEventsForDebugging) {
499
496
  (0, _meeting.storeEventForDebugging)('mercury', data);
@@ -1675,7 +1672,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1675
1672
  // For type LOCUS_ID we need to parse the locus object to get the information
1676
1673
  // about the caller and callee
1677
1674
  // Meeting Added event will be created in `handleLocusEvent`
1678
- if (type !== _constants.DESTINATION_TYPE.LOCUS_ID) {
1675
+ // Only emit MEETING_ADDED if the meeting still exists in the collection.
1676
+ // If fetchMeetingInfo failed and the meeting was destroyed in the catch block,
1677
+ // skip emitting to prevent orphaned meeting references on the consumer side.
1678
+ // @ts-ignore - getMeetingByType types value as object but accepts strings (same as handleLocusEvent)
1679
+ if (type !== _constants.DESTINATION_TYPE.LOCUS_ID && this.getMeetingByType(_constants._ID_, meeting.id)) {
1679
1680
  if (!meeting.sipUri) {
1680
1681
  meeting.setSipUri(destination);
1681
1682
  }
@@ -1741,51 +1742,135 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1741
1742
  */
1742
1743
  }, {
1743
1744
  key: "syncMeetings",
1744
- value: function syncMeetings() {
1745
- var _this11 = this;
1746
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1747
- _ref4$keepOnlyLocusMe = _ref4.keepOnlyLocusMeetings,
1748
- keepOnlyLocusMeetings = _ref4$keepOnlyLocusMe === void 0 ? true : _ref4$keepOnlyLocusMe;
1749
- // @ts-ignore
1750
- if (this.webex.credentials.isUnverifiedGuest) {
1751
- _loggerProxy.default.logger.info('Meetings:index#syncMeetings --> skipping meeting sync as unverified guest');
1752
- return _promise.default.resolve();
1753
- }
1754
- return this.request.getActiveMeetings().then(function (locusArray) {
1755
- var activeLocusUrl = [];
1756
- if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1757
- var lociToUpdate = _this11.sortLocusArrayToUpdate(locusArray.loci);
1758
- lociToUpdate.forEach(function (locus) {
1759
- activeLocusUrl.push(locus.url);
1760
- _this11.handleLocusEvent({
1761
- eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1762
- locus: locus,
1763
- locusUrl: locus.url
1764
- });
1765
- });
1766
- }
1767
- var meetingsCollection = _this11.meetingCollection.getAll();
1768
- if ((0, _keys.default)(meetingsCollection).length > 0) {
1769
- // Sometimes the mercury events are lost after mercury reconnect
1770
- // Remove any Locus meetings that are not returned by Locus
1771
- // (they had a locusUrl previously but are no longer active) in the sync
1772
- for (var _i = 0, _Object$values = (0, _values.default)(meetingsCollection); _i < _Object$values.length; _i++) {
1773
- var meeting = _Object$values[_i];
1774
- // @ts-ignore
1775
- var locusUrl = meeting.locusUrl;
1776
- if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1777
- // destroy function also uploads logs
1778
- // @ts-ignore
1779
- _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1780
- }
1745
+ value: (function () {
1746
+ var _syncMeetings = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
1747
+ var _this11 = this;
1748
+ var _ref4,
1749
+ _ref4$keepOnlyLocusMe,
1750
+ keepOnlyLocusMeetings,
1751
+ locusArray,
1752
+ activeLocusUrl,
1753
+ lociToUpdate,
1754
+ meetingsCollection,
1755
+ _loop,
1756
+ _i,
1757
+ _Object$values,
1758
+ remainingMeetings,
1759
+ syncPromises,
1760
+ _i2,
1761
+ _arr,
1762
+ meeting,
1763
+ _args6 = arguments,
1764
+ _t3;
1765
+ return _regenerator.default.wrap(function (_context6) {
1766
+ while (1) switch (_context6.prev = _context6.next) {
1767
+ case 0:
1768
+ _ref4 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref4$keepOnlyLocusMe = _ref4.keepOnlyLocusMeetings, keepOnlyLocusMeetings = _ref4$keepOnlyLocusMe === void 0 ? true : _ref4$keepOnlyLocusMe;
1769
+ if (!this.webex.credentials.isUnverifiedGuest) {
1770
+ _context6.next = 1;
1771
+ break;
1772
+ }
1773
+ _loggerProxy.default.logger.info('Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync');
1774
+ _context6.next = 7;
1775
+ break;
1776
+ case 1:
1777
+ _context6.prev = 1;
1778
+ _context6.next = 2;
1779
+ return this.request.getActiveMeetings();
1780
+ case 2:
1781
+ locusArray = _context6.sent;
1782
+ activeLocusUrl = [];
1783
+ if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1784
+ lociToUpdate = this.sortLocusArrayToUpdate(locusArray.loci);
1785
+ lociToUpdate.forEach(function (locus) {
1786
+ activeLocusUrl.push(locus.url);
1787
+ _this11.handleLocusEvent({
1788
+ eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1789
+ locus: locus,
1790
+ locusUrl: locus.url
1791
+ });
1792
+ });
1793
+ }
1794
+ meetingsCollection = this.meetingCollection.getAll();
1795
+ if (!((0, _keys.default)(meetingsCollection).length > 0)) {
1796
+ _context6.next = 5;
1797
+ break;
1798
+ }
1799
+ _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
1800
+ var meeting, locusUrl, locusInfo, _locusInfo$info, _locusArray$loci, globalMeetingId;
1801
+ return _regenerator.default.wrap(function (_context5) {
1802
+ while (1) switch (_context5.prev = _context5.next) {
1803
+ case 0:
1804
+ meeting = _Object$values[_i];
1805
+ // @ts-ignore
1806
+ locusUrl = meeting.locusUrl, locusInfo = meeting.locusInfo;
1807
+ if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1808
+ globalMeetingId = locusInfo === null || locusInfo === void 0 ? void 0 : (_locusInfo$info = locusInfo.info) === null || _locusInfo$info === void 0 ? void 0 : _locusInfo$info.globalMeetingId;
1809
+ if (globalMeetingId && locusArray !== null && locusArray !== void 0 && (_locusArray$loci = locusArray.loci) !== null && _locusArray$loci !== void 0 && _locusArray$loci.some(function (locus) {
1810
+ var _locus$info;
1811
+ return ((_locus$info = locus.info) === null || _locus$info === void 0 ? void 0 : _locus$info.globalMeetingId) === globalMeetingId;
1812
+ })) {
1813
+ // don't destroy the meeting as Locus API still returned some Locus that shares
1814
+ // the same globalMeetingId - that happens for example if a webinar user (who hasn't scheduled it)
1815
+ // is in a breakout and gets moved to a different breakout while we were offline
1816
+ } else {
1817
+ // destroy function also uploads logs
1818
+ // @ts-ignore
1819
+ _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1820
+ }
1821
+ }
1822
+ case 1:
1823
+ case "end":
1824
+ return _context5.stop();
1825
+ }
1826
+ }, _loop);
1827
+ });
1828
+ _i = 0, _Object$values = (0, _values.default)(meetingsCollection);
1829
+ case 3:
1830
+ if (!(_i < _Object$values.length)) {
1831
+ _context6.next = 5;
1832
+ break;
1833
+ }
1834
+ return _context6.delegateYield(_loop(), "t0", 4);
1835
+ case 4:
1836
+ _i++;
1837
+ _context6.next = 3;
1838
+ break;
1839
+ case 5:
1840
+ _context6.next = 7;
1841
+ break;
1842
+ case 6:
1843
+ _context6.prev = 6;
1844
+ _t3 = _context6["catch"](1);
1845
+ _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(_t3));
1846
+ throw _t3;
1847
+ case 7:
1848
+ // Trigger hash tree syncs for all remaining meetings
1849
+ remainingMeetings = this.meetingCollection.getAll();
1850
+ syncPromises = [];
1851
+ for (_i2 = 0, _arr = (0, _values.default)(remainingMeetings); _i2 < _arr.length; _i2++) {
1852
+ meeting = _arr[_i2];
1853
+ if (meeting.locusInfo) {
1854
+ syncPromises.push(meeting.locusInfo.syncAllHashTreeDatasets());
1855
+ }
1856
+ }
1857
+ if (!(syncPromises.length > 0)) {
1858
+ _context6.next = 8;
1859
+ break;
1860
+ }
1861
+ _context6.next = 8;
1862
+ return _promise.default.all(syncPromises);
1863
+ case 8:
1864
+ case "end":
1865
+ return _context6.stop();
1781
1866
  }
1782
- }
1783
- }).catch(function (error) {
1784
- _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(error));
1785
- throw new Error(error);
1786
- });
1787
- }
1788
-
1867
+ }, _callee5, this, [[1, 6]]);
1868
+ }));
1869
+ function syncMeetings() {
1870
+ return _syncMeetings.apply(this, arguments);
1871
+ }
1872
+ return syncMeetings;
1873
+ }()
1789
1874
  /**
1790
1875
  * sort out locus array for initial creating
1791
1876
  * @param {Array} loci original locus array
@@ -1793,6 +1878,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1793
1878
  * @public
1794
1879
  * @memberof Meetings
1795
1880
  */
1881
+ )
1796
1882
  }, {
1797
1883
  key: "sortLocusArrayToUpdate",
1798
1884
  value: function sortLocusArrayToUpdate(loci) {
@@ -1807,8 +1893,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1807
1893
  var lociToUpdate = (0, _toConsumableArray2.default)(mainLoci);
1808
1894
  breakoutLoci.forEach(function (breakoutLocus) {
1809
1895
  var associateMainLocus = mainLoci.find(function (mainLocus) {
1810
- var _mainLocus$controls, _mainLocus$controls$b, _breakoutLocus$contro, _breakoutLocus$contro2;
1811
- return ((_mainLocus$controls = mainLocus.controls) === null || _mainLocus$controls === void 0 ? void 0 : (_mainLocus$controls$b = _mainLocus$controls.breakout) === null || _mainLocus$controls$b === void 0 ? void 0 : _mainLocus$controls$b.url) === ((_breakoutLocus$contro = breakoutLocus.controls) === null || _breakoutLocus$contro === void 0 ? void 0 : (_breakoutLocus$contro2 = _breakoutLocus$contro.breakout) === null || _breakoutLocus$contro2 === void 0 ? void 0 : _breakoutLocus$contro2.url);
1896
+ return _util2.default.isMainAssociatedWithBreakout(mainLocus, breakoutLocus);
1812
1897
  });
1813
1898
  var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1814
1899
  eventType: _constants.LOCUSEVENT.SDK_NO_EVENT,
@@ -1844,8 +1929,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1844
1929
  return;
1845
1930
  }
1846
1931
  var existIndex = this.breakoutLocusForHandleLater.findIndex(function (breakoutLocus) {
1847
- var _breakoutLocus$contro3, _breakoutLocus$contro4, _newCreatedLocus$cont, _newCreatedLocus$cont2;
1848
- return ((_breakoutLocus$contro3 = breakoutLocus.controls) === null || _breakoutLocus$contro3 === void 0 ? void 0 : (_breakoutLocus$contro4 = _breakoutLocus$contro3.breakout) === null || _breakoutLocus$contro4 === void 0 ? void 0 : _breakoutLocus$contro4.url) === ((_newCreatedLocus$cont = newCreatedLocus.controls) === null || _newCreatedLocus$cont === void 0 ? void 0 : (_newCreatedLocus$cont2 = _newCreatedLocus$cont.breakout) === null || _newCreatedLocus$cont2 === void 0 ? void 0 : _newCreatedLocus$cont2.url);
1932
+ return _util2.default.isMainAssociatedWithBreakout(newCreatedLocus, breakoutLocus);
1849
1933
  });
1850
1934
  if (existIndex < 0) {
1851
1935
  return;