@webex/plugin-meetings 3.12.0-next.55 → 3.12.0-next.57

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.
@@ -191,7 +191,7 @@ var AIEnableRequest = _webexCore.WebexPlugin.extend({
191
191
  method: _constants.HTTP_VERBS.PUT
192
192
  });
193
193
  },
194
- version: "3.12.0-next.55"
194
+ version: "3.12.0-next.57"
195
195
  });
196
196
  var _default = exports.default = AIEnableRequest;
197
197
  //# sourceMappingURL=index.js.map
@@ -214,7 +214,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
214
214
  sessionId: this.sessionId
215
215
  });
216
216
  },
217
- version: "3.12.0-next.55"
217
+ version: "3.12.0-next.57"
218
218
  });
219
219
  var _default = exports.default = Breakout;
220
220
  //# sourceMappingURL=breakout.js.map
@@ -1110,7 +1110,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
1110
1110
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
1111
1111
  }
1112
1112
  },
1113
- version: "3.12.0-next.55"
1113
+ version: "3.12.0-next.57"
1114
1114
  });
1115
1115
  var _default = exports.default = Breakouts;
1116
1116
  //# sourceMappingURL=index.js.map
@@ -610,6 +610,21 @@ var HashTreeParser = /*#__PURE__*/function () {
610
610
  value: function handleRootHashHeartBeatMessage(message) {
611
611
  var _this4 = this;
612
612
  var dataSets = message.dataSets;
613
+ _loggerProxy.default.logger.info("HashTreeParser#handleRootHashMessage --> ".concat(this.debugId, " Received heartbeat root hash message with data sets: ").concat((0, _stringify.default)(dataSets.map(function (_ref2) {
614
+ var name = _ref2.name,
615
+ root = _ref2.root,
616
+ leafCount = _ref2.leafCount,
617
+ version = _ref2.version;
618
+ return {
619
+ name: name,
620
+ root: root,
621
+ leafCount: leafCount,
622
+ version: version
623
+ };
624
+ }))));
625
+ this.cancelPendingSyncsForDataSets(dataSets.map(function (ds) {
626
+ return ds.name;
627
+ }));
613
628
  dataSets.forEach(function (dataSet) {
614
629
  _this4.updateDataSetInfo(dataSet);
615
630
  _this4.runSyncAlgorithm(dataSet);
@@ -767,10 +782,10 @@ var HashTreeParser = /*#__PURE__*/function () {
767
782
  version: leaf.version
768
783
  };
769
784
  }));
770
- (0, _lodash.zip)(appliedChangesList, leafInfo[dataSetName]).forEach(function (_ref2) {
771
- var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
772
- changeApplied = _ref3[0],
773
- leaf = _ref3[1];
785
+ (0, _lodash.zip)(appliedChangesList, leafInfo[dataSetName]).forEach(function (_ref3) {
786
+ var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
787
+ changeApplied = _ref4[0],
788
+ leaf = _ref4[1];
774
789
  if (changeApplied) {
775
790
  updatedObjects.push({
776
791
  htMeta: {
@@ -899,7 +914,10 @@ var HashTreeParser = /*#__PURE__*/function () {
899
914
  }, {
900
915
  key: "deleteHashTree",
901
916
  value: function deleteHashTree(dataSetName) {
917
+ var _this$dataSets$dataSe;
902
918
  this.dataSets[dataSetName].hashTree = undefined;
919
+ (_this$dataSets$dataSe = this.dataSets[dataSetName].syncAbortController) === null || _this$dataSets$dataSe === void 0 ? void 0 : _this$dataSets$dataSe.abort();
920
+ this.dataSets[dataSetName].syncAbortController = undefined;
903
921
 
904
922
  // we also need to stop the timers as there is no hash tree anymore to sync
905
923
  if (this.dataSets[dataSetName].timer) {
@@ -1105,9 +1123,9 @@ var HashTreeParser = /*#__PURE__*/function () {
1105
1123
  }
1106
1124
  var dataSets = message.dataSets,
1107
1125
  visibleDataSetsUrl = message.visibleDataSetsUrl;
1108
- _loggerProxy.default.logger.info("HashTreeParser#parseMessage --> ".concat(this.debugId, " ").concat(debugText || '', " dataSets: ").concat((_message$dataSets = message.dataSets) === null || _message$dataSets === void 0 ? void 0 : _message$dataSets.map(function (_ref4) {
1109
- var name = _ref4.name,
1110
- version = _ref4.version;
1126
+ _loggerProxy.default.logger.info("HashTreeParser#parseMessage --> ".concat(this.debugId, " ").concat(debugText || '', " dataSets: ").concat((_message$dataSets = message.dataSets) === null || _message$dataSets === void 0 ? void 0 : _message$dataSets.map(function (_ref5) {
1127
+ var name = _ref5.name,
1128
+ version = _ref5.version;
1111
1129
  return "".concat(name, ":").concat(version);
1112
1130
  }).join(','), ", elements: ").concat((_message$locusStateEl = message.locusStateElements) === null || _message$locusStateEl === void 0 ? void 0 : _message$locusStateEl.map(function (el) {
1113
1131
  return "".concat(el.htMeta.elementId.type, ":").concat(el.htMeta.elementId.id, ":").concat(el.htMeta.elementId.version).concat(el.data ? '+' : '-');
@@ -1124,6 +1142,9 @@ var HashTreeParser = /*#__PURE__*/function () {
1124
1142
  dataSets.forEach(function (dataSet) {
1125
1143
  return _this0.updateDataSetInfo(dataSet);
1126
1144
  });
1145
+ this.cancelPendingSyncsForDataSets(dataSets.map(function (ds) {
1146
+ return ds.name;
1147
+ }));
1127
1148
  var updatedObjects = [];
1128
1149
 
1129
1150
  // when we detect new visible datasets, it may be that the metadata about them is not
@@ -1186,10 +1207,10 @@ var HashTreeParser = /*#__PURE__*/function () {
1186
1207
  item: object.htMeta.elementId
1187
1208
  };
1188
1209
  }));
1189
- (0, _lodash.zip)(appliedChangesList, locusStateElementsForThisSet).forEach(function (_ref5) {
1190
- var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
1191
- changeApplied = _ref6[0],
1192
- object = _ref6[1];
1210
+ (0, _lodash.zip)(appliedChangesList, locusStateElementsForThisSet).forEach(function (_ref6) {
1211
+ var _ref7 = (0, _slicedToArray2.default)(_ref6, 2),
1212
+ changeApplied = _ref7[0],
1213
+ object = _ref7[1];
1193
1214
  if (changeApplied) {
1194
1215
  // add to updatedObjects so that our locus DTO will get updated with the new object
1195
1216
  updatedObjects.push(object);
@@ -1336,7 +1357,8 @@ var HashTreeParser = /*#__PURE__*/function () {
1336
1357
  key: "performSync",
1337
1358
  value: (function () {
1338
1359
  var _performSync = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6(dataSet, reason, isInitialization) {
1339
- var hashTree, rootHash, leavesData, receivedHashes, hashesResult, mismatchedLeaveIndexes, syncResponse, _t3, _t4;
1360
+ var _dataSet$syncAbortCon;
1361
+ var abortController, hashTree, rootHash, leavesData, receivedHashes, hashesResult, mismatchedLeaveIndexes, syncResponse, _t3, _t4;
1340
1362
  return _regenerator.default.wrap(function (_context7) {
1341
1363
  while (1) switch (_context7.prev = _context7.next) {
1342
1364
  case 0:
@@ -1346,6 +1368,8 @@ var HashTreeParser = /*#__PURE__*/function () {
1346
1368
  }
1347
1369
  return _context7.abrupt("return");
1348
1370
  case 1:
1371
+ abortController = (_dataSet$syncAbortCon = dataSet.syncAbortController) !== null && _dataSet$syncAbortCon !== void 0 ? _dataSet$syncAbortCon : new AbortController();
1372
+ dataSet.syncAbortController = abortController;
1349
1373
  hashTree = dataSet.hashTree;
1350
1374
  rootHash = hashTree.getRootHash();
1351
1375
  _context7.prev = 2;
@@ -1399,59 +1423,110 @@ var HashTreeParser = /*#__PURE__*/function () {
1399
1423
  0: hashTree.getLeafData(0)
1400
1424
  };
1401
1425
  case 10:
1426
+ if (!abortController.signal.aborted) {
1427
+ _context7.next = 11;
1428
+ break;
1429
+ }
1430
+ _loggerProxy.default.logger.info("HashTreeParser#performSync --> ".concat(this.debugId, " abandoning sync for \"").concat(dataSet.name, "\" before /sync - message received during sync"));
1431
+ return _context7.abrupt("return");
1432
+ case 11:
1402
1433
  // request sync for mismatched leaves
1403
1434
  syncResponse = null;
1404
1435
  if (!isInitialization) {
1405
- _context7.next = 12;
1436
+ _context7.next = 13;
1406
1437
  break;
1407
1438
  }
1408
- _context7.next = 11;
1439
+ _context7.next = 12;
1409
1440
  return this.sendSyncRequestToLocus(dataSet, {
1410
1441
  isInitialization: true
1411
1442
  });
1412
- case 11:
1443
+ case 12:
1413
1444
  syncResponse = _context7.sent;
1414
- _context7.next = 14;
1445
+ _context7.next = 15;
1415
1446
  break;
1416
- case 12:
1447
+ case 13:
1417
1448
  if (!((0, _keys.default)(leavesData).length > 0)) {
1418
- _context7.next = 14;
1449
+ _context7.next = 15;
1419
1450
  break;
1420
1451
  }
1421
- _context7.next = 13;
1452
+ _context7.next = 14;
1422
1453
  return this.sendSyncRequestToLocus(dataSet, {
1423
1454
  mismatchedLeavesData: leavesData
1424
1455
  });
1425
- case 13:
1426
- syncResponse = _context7.sent;
1427
1456
  case 14:
1457
+ syncResponse = _context7.sent;
1458
+ case 15:
1428
1459
  // sync API may return nothing (in that case data will arrive via messages)
1429
1460
  // or it may return a response in the same format as messages
1430
1461
  // We still need to restart the sync timer as a safety net in case the messages don't arrive.
1431
1462
  this.runSyncAlgorithm(dataSet);
1432
1463
  if (syncResponse) {
1464
+ // clear the abort controller before processing the response so that
1465
+ // parseMessage() -> cancelPendingSyncsForDataSets() doesn't log a
1466
+ // misleading "aborting sync" message for this already-completed sync
1467
+ dataSet.syncAbortController = undefined;
1433
1468
  // the format of sync response is the same as messages, so we can reuse the same handler
1434
1469
  this.handleMessage(syncResponse, 'via sync API');
1435
1470
  }
1436
- _context7.next = 16;
1471
+ _context7.next = 17;
1437
1472
  break;
1438
- case 15:
1439
- _context7.prev = 15;
1473
+ case 16:
1474
+ _context7.prev = 16;
1440
1475
  _t4 = _context7["catch"](2);
1441
1476
  if (!this.handleSyncErrors(_t4)) {
1442
1477
  _loggerProxy.default.logger.warn("HashTreeParser#performSync --> ".concat(this.debugId, " error during sync for data set \"").concat(dataSet.name, "\":"), _t4);
1443
1478
  }
1444
- case 16:
1479
+ case 17:
1480
+ _context7.prev = 17;
1481
+ dataSet.syncAbortController = undefined;
1482
+ return _context7.finish(17);
1483
+ case 18:
1445
1484
  case "end":
1446
1485
  return _context7.stop();
1447
1486
  }
1448
- }, _callee6, this, [[2, 15], [3, 6]]);
1487
+ }, _callee6, this, [[2, 16, 17, 18], [3, 6]]);
1449
1488
  }));
1450
1489
  function performSync(_x8, _x9, _x0) {
1451
1490
  return _performSync.apply(this, arguments);
1452
1491
  }
1453
1492
  return performSync;
1454
1493
  }()
1494
+ /**
1495
+ * Cancels any pending or in-flight syncs for the specified data sets.
1496
+ * This removes matching entries from the sync queue and aborts any in-flight sync HTTP requests.
1497
+ *
1498
+ * @param {string[]} dataSetNames - The names of the data sets to cancel syncs for
1499
+ * @returns {void}
1500
+ */
1501
+ )
1502
+ }, {
1503
+ key: "cancelPendingSyncsForDataSets",
1504
+ value: function cancelPendingSyncsForDataSets(dataSetNames) {
1505
+ var previousLength = this.syncQueue.length;
1506
+ this.syncQueue = this.syncQueue.filter(function (entry) {
1507
+ return !dataSetNames.includes(entry.dataSetName);
1508
+ });
1509
+ if (previousLength !== this.syncQueue.length) {
1510
+ _loggerProxy.default.logger.info("HashTreeParser#cancelPendingSyncsForDataSets --> ".concat(this.debugId, " removed ").concat(previousLength - this.syncQueue.length, " entries from sync queue for data sets: ").concat(dataSetNames.join(', ')));
1511
+ }
1512
+ var _iterator9 = _createForOfIteratorHelper(dataSetNames),
1513
+ _step9;
1514
+ try {
1515
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
1516
+ var _this$dataSets$name;
1517
+ var name = _step9.value;
1518
+ if ((_this$dataSets$name = this.dataSets[name]) !== null && _this$dataSets$name !== void 0 && _this$dataSets$name.syncAbortController) {
1519
+ _loggerProxy.default.logger.info("HashTreeParser#cancelPendingSyncsForDataSets --> ".concat(this.debugId, " aborting in-flight sync for data set \"").concat(name, "\""));
1520
+ this.dataSets[name].syncAbortController.abort();
1521
+ }
1522
+ }
1523
+ } catch (err) {
1524
+ _iterator9.e(err);
1525
+ } finally {
1526
+ _iterator9.f();
1527
+ }
1528
+ }
1529
+
1455
1530
  /**
1456
1531
  * Enqueues a sync for the given data set. If the data set is already in the queue, the request is ignored.
1457
1532
  * This ensures that all syncs are executed sequentially and no more than 1 sync runs at a time.
@@ -1461,7 +1536,6 @@ var HashTreeParser = /*#__PURE__*/function () {
1461
1536
  * @param {boolean} [isInitialization=false] - Whether this is an initialization sync (uses empty leaves data instead of hash comparison)
1462
1537
  * @returns {void}
1463
1538
  */
1464
- )
1465
1539
  }, {
1466
1540
  key: "enqueueSyncForDataset",
1467
1541
  value: function enqueueSyncForDataset(dataSetName, reason) {
@@ -1496,7 +1570,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1496
1570
  key: "processSyncQueue",
1497
1571
  value: (function () {
1498
1572
  var _processSyncQueue = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
1499
- var _ref7, dataSetName, reason, isInitialization, dataSet;
1573
+ var _ref8, dataSetName, reason, isInitialization, dataSet;
1500
1574
  return _regenerator.default.wrap(function (_context8) {
1501
1575
  while (1) switch (_context8.prev = _context8.next) {
1502
1576
  case 0:
@@ -1514,7 +1588,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1514
1588
  break;
1515
1589
  }
1516
1590
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1517
- _ref7 = this.syncQueue.shift(), dataSetName = _ref7.dataSetName, reason = _ref7.reason, isInitialization = _ref7.isInitialization;
1591
+ _ref8 = this.syncQueue.shift(), dataSetName = _ref8.dataSetName, reason = _ref8.reason, isInitialization = _ref8.isInitialization;
1518
1592
  dataSet = this.dataSets[dataSetName];
1519
1593
  if (dataSet !== null && dataSet !== void 0 && dataSet.hashTree) {
1520
1594
  _context8.next = 4;
@@ -1554,7 +1628,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1554
1628
  key: "syncAllDatasets",
1555
1629
  value: (function () {
1556
1630
  var _syncAllDatasets = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
1557
- var dataSetsWithHashTrees, sorted, _iterator9, _step9, ds;
1631
+ var dataSetsWithHashTrees, sorted, _iterator0, _step0, ds;
1558
1632
  return _regenerator.default.wrap(function (_context9) {
1559
1633
  while (1) switch (_context9.prev = _context9.next) {
1560
1634
  case 0:
@@ -1583,16 +1657,16 @@ var HashTreeParser = /*#__PURE__*/function () {
1583
1657
  _loggerProxy.default.logger.info("HashTreeParser#syncAllDatasets --> ".concat(this.debugId, " syncing datasets: ").concat(sorted.map(function (ds) {
1584
1658
  return ds.name;
1585
1659
  }).join(', ')));
1586
- _iterator9 = _createForOfIteratorHelper(sorted);
1660
+ _iterator0 = _createForOfIteratorHelper(sorted);
1587
1661
  try {
1588
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
1589
- ds = _step9.value;
1662
+ for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
1663
+ ds = _step0.value;
1590
1664
  this.enqueueSyncForDataset(ds.name, 'syncAllDatasets');
1591
1665
  }
1592
1666
  } catch (err) {
1593
- _iterator9.e(err);
1667
+ _iterator0.e(err);
1594
1668
  } finally {
1595
- _iterator9.f();
1669
+ _iterator0.f();
1596
1670
  }
1597
1671
  _context9.next = 4;
1598
1672
  return this.syncQueueProcessingPromise;
@@ -1671,11 +1745,11 @@ var HashTreeParser = /*#__PURE__*/function () {
1671
1745
  if (!this.heartbeatIntervalMs) {
1672
1746
  return;
1673
1747
  }
1674
- var _iterator0 = _createForOfIteratorHelper(receivedDataSets),
1675
- _step0;
1748
+ var _iterator1 = _createForOfIteratorHelper(receivedDataSets),
1749
+ _step1;
1676
1750
  try {
1677
1751
  var _loop2 = function _loop2() {
1678
- var receivedDataSet = _step0.value;
1752
+ var receivedDataSet = _step1.value;
1679
1753
  var dataSet = _this11.dataSets[receivedDataSet.name];
1680
1754
  if (!(dataSet !== null && dataSet !== void 0 && dataSet.hashTree)) {
1681
1755
  // eslint-disable-next-line no-continue
@@ -1698,13 +1772,13 @@ var HashTreeParser = /*#__PURE__*/function () {
1698
1772
  _this11.resetHeartbeatWatchdogs([dataSet]);
1699
1773
  }, delay);
1700
1774
  };
1701
- for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
1775
+ for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
1702
1776
  if (_loop2()) continue;
1703
1777
  }
1704
1778
  } catch (err) {
1705
- _iterator0.e(err);
1779
+ _iterator1.e(err);
1706
1780
  } finally {
1707
- _iterator0.f();
1781
+ _iterator1.f();
1708
1782
  }
1709
1783
  }
1710
1784
 
@@ -1740,6 +1814,9 @@ var HashTreeParser = /*#__PURE__*/function () {
1740
1814
  this.stopAllTimers();
1741
1815
  this.syncQueue = [];
1742
1816
  (0, _values.default)(this.dataSets).forEach(function (dataSet) {
1817
+ var _dataSet$syncAbortCon2;
1818
+ (_dataSet$syncAbortCon2 = dataSet.syncAbortController) === null || _dataSet$syncAbortCon2 === void 0 ? void 0 : _dataSet$syncAbortCon2.abort();
1819
+ dataSet.syncAbortController = undefined;
1743
1820
  dataSet.hashTree = undefined;
1744
1821
  });
1745
1822
  this.visibleDataSets = [];
@@ -1777,11 +1854,11 @@ var HashTreeParser = /*#__PURE__*/function () {
1777
1854
  }
1778
1855
  this.setVisibleDataSets(metadataObject.data.visibleDataSets, message.dataSets);
1779
1856
  this.dataSets = {};
1780
- var _iterator1 = _createForOfIteratorHelper(message.dataSets),
1781
- _step1;
1857
+ var _iterator10 = _createForOfIteratorHelper(message.dataSets),
1858
+ _step10;
1782
1859
  try {
1783
- for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
1784
- var dataSet = _step1.value;
1860
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
1861
+ var dataSet = _step10.value;
1785
1862
  var name = dataSet.name,
1786
1863
  leafCount = dataSet.leafCount;
1787
1864
  this.dataSets[name] = _objectSpread(_objectSpread({}, dataSet), {}, {
@@ -1789,9 +1866,9 @@ var HashTreeParser = /*#__PURE__*/function () {
1789
1866
  });
1790
1867
  }
1791
1868
  } catch (err) {
1792
- _iterator1.e(err);
1869
+ _iterator10.e(err);
1793
1870
  } finally {
1794
- _iterator1.f();
1871
+ _iterator10.f();
1795
1872
  }
1796
1873
  _loggerProxy.default.logger.info("HashTreeParser#resumeFromMessage --> ".concat(this.debugId, " Resuming HashTreeParser with data sets: ").concat((0, _keys.default)(this.dataSets).join(', '), ", visible data sets: ").concat(this.visibleDataSets.map(function (ds) {
1797
1874
  return ds.name;