@webex/plugin-meetings 3.12.0-next.60 → 3.12.0-next.62
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.
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/hashTree/constants.js +4 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +197 -49
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +20 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +11 -2
- package/dist/locus-info/index.js.map +1 -1
- package/dist/meeting/index.js +6 -0
- package/dist/meeting/index.js.map +1 -1
- package/dist/types/hashTree/constants.d.ts +1 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +55 -4
- package/dist/types/hashTree/utils.d.ts +7 -0
- package/dist/types/locus-info/index.d.ts +5 -1
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/hashTree/constants.ts +7 -0
- package/src/hashTree/hashTreeParser.ts +156 -23
- package/src/hashTree/utils.ts +19 -0
- package/src/locus-info/index.ts +4 -2
- package/src/meeting/index.ts +2 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +197 -2
- package/test/unit/spec/hashTree/utils.ts +37 -0
- package/test/unit/spec/locus-info/index.js +12 -0
- package/test/unit/spec/meeting/index.js +25 -5
|
@@ -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.
|
|
194
|
+
version: "3.12.0-next.62"
|
|
195
195
|
});
|
|
196
196
|
var _default = exports.default = AIEnableRequest;
|
|
197
197
|
//# sourceMappingURL=index.js.map
|
package/dist/breakouts/index.js
CHANGED
|
@@ -1133,7 +1133,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1133
1133
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1134
1134
|
}
|
|
1135
1135
|
},
|
|
1136
|
-
version: "3.12.0-next.
|
|
1136
|
+
version: "3.12.0-next.62"
|
|
1137
1137
|
});
|
|
1138
1138
|
var _default = exports.default = Breakouts;
|
|
1139
1139
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,7 +4,7 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
4
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.EMPTY_HASH = exports.DataSetNames = exports.DATA_SET_INIT_PRIORITY = void 0;
|
|
7
|
+
exports.LLM_DATASET_NAMES = exports.EMPTY_HASH = exports.DataSetNames = exports.DATA_SET_INIT_PRIORITY = void 0;
|
|
8
8
|
var EMPTY_HASH = exports.EMPTY_HASH = '99aa06d3014798d86001c324468d497f';
|
|
9
9
|
var DataSetNames = exports.DataSetNames = {
|
|
10
10
|
MAIN: 'main',
|
|
@@ -28,4 +28,7 @@ var DataSetNames = exports.DataSetNames = {
|
|
|
28
28
|
// participant object for webinar attendees. If SELF were initialized first, locus.info
|
|
29
29
|
// would not yet be populated and the attendee participant would be skipped.
|
|
30
30
|
var DATA_SET_INIT_PRIORITY = exports.DATA_SET_INIT_PRIORITY = [DataSetNames.MAIN, DataSetNames.SELF];
|
|
31
|
+
|
|
32
|
+
// Data sets for which we normally receive events over LLM connection
|
|
33
|
+
var LLM_DATASET_NAMES = exports.LLM_DATASET_NAMES = [DataSetNames.MAIN, DataSetNames.ATD_ACTIVE, DataSetNames.ATD_UNMUTED];
|
|
31
34
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EMPTY_HASH","exports","DataSetNames","MAIN","ATTENDEES","ATD_ACTIVE","ATD_UNMUTED","SELF","UNJOINED","DATA_SET_INIT_PRIORITY"],"sources":["constants.ts"],"sourcesContent":["export const EMPTY_HASH = '99aa06d3014798d86001c324468d497f';\n\nexport const DataSetNames = {\n MAIN: 'main', // sent to web client, contains also panelists, over LLM\n ATTENDEES: 'attendees', // NOT SENT to web client, all the attendees in the locus\n ATD_ACTIVE: 'atd-active', // only sent to panelists, over LLM; the attendees that have their hands raised or are allowed to unmute themselves\n ATD_UNMUTED: 'atd-unmuted', // sent to web client, over LLM, not sent to panelists; the attendees that are unmuted\n SELF: 'self', // sent to web client, over Mercury\n UNJOINED: 'unjoined', // sent when you are not joined, but can still see some stuff from the meeting (mutually exclusive with \"main\")\n};\n\n// Priority order for initializing data sets — higher priority names come first.\n// Data sets not listed here will be initialized after all prioritized ones.\n// MAIN must come before SELF because LocusInfo.updateFromHashTree processes the\n// batch of updatedObjects in order, and the SELF handler in updateLocusFromHashTreeObject\n// checks locus.info?.isWebinar (which comes from MAIN) to decide whether to create a\n// participant object for webinar attendees. If SELF were initialized first, locus.info\n// would not yet be populated and the attendee participant would be skipped.\nexport const DATA_SET_INIT_PRIORITY: string[] = [DataSetNames.MAIN, DataSetNames.SELF];\n"],"mappings":";;;;;;;AAAO,IAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,kCAAkC;AAErD,IAAME,YAAY,GAAAD,OAAA,CAAAC,YAAA,GAAG;EAC1BC,IAAI,EAAE,MAAM;EAAE;EACdC,SAAS,EAAE,WAAW;EAAE;EACxBC,UAAU,EAAE,YAAY;EAAE;EAC1BC,WAAW,EAAE,aAAa;EAAE;EAC5BC,IAAI,EAAE,MAAM;EAAE;EACdC,QAAQ,EAAE,UAAU,CAAE;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,sBAAgC,GAAAR,OAAA,CAAAQ,sBAAA,GAAG,CAACP,YAAY,CAACC,IAAI,EAAED,YAAY,CAACK,IAAI,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["EMPTY_HASH","exports","DataSetNames","MAIN","ATTENDEES","ATD_ACTIVE","ATD_UNMUTED","SELF","UNJOINED","DATA_SET_INIT_PRIORITY","LLM_DATASET_NAMES"],"sources":["constants.ts"],"sourcesContent":["export const EMPTY_HASH = '99aa06d3014798d86001c324468d497f';\n\nexport const DataSetNames = {\n MAIN: 'main', // sent to web client, contains also panelists, over LLM\n ATTENDEES: 'attendees', // NOT SENT to web client, all the attendees in the locus\n ATD_ACTIVE: 'atd-active', // only sent to panelists, over LLM; the attendees that have their hands raised or are allowed to unmute themselves\n ATD_UNMUTED: 'atd-unmuted', // sent to web client, over LLM, not sent to panelists; the attendees that are unmuted\n SELF: 'self', // sent to web client, over Mercury\n UNJOINED: 'unjoined', // sent when you are not joined, but can still see some stuff from the meeting (mutually exclusive with \"main\")\n};\n\n// Priority order for initializing data sets — higher priority names come first.\n// Data sets not listed here will be initialized after all prioritized ones.\n// MAIN must come before SELF because LocusInfo.updateFromHashTree processes the\n// batch of updatedObjects in order, and the SELF handler in updateLocusFromHashTreeObject\n// checks locus.info?.isWebinar (which comes from MAIN) to decide whether to create a\n// participant object for webinar attendees. If SELF were initialized first, locus.info\n// would not yet be populated and the attendee participant would be skipped.\nexport const DATA_SET_INIT_PRIORITY: string[] = [DataSetNames.MAIN, DataSetNames.SELF];\n\n// Data sets for which we normally receive events over LLM connection\nexport const LLM_DATASET_NAMES = [\n DataSetNames.MAIN,\n DataSetNames.ATD_ACTIVE,\n DataSetNames.ATD_UNMUTED,\n];\n"],"mappings":";;;;;;;AAAO,IAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,kCAAkC;AAErD,IAAME,YAAY,GAAAD,OAAA,CAAAC,YAAA,GAAG;EAC1BC,IAAI,EAAE,MAAM;EAAE;EACdC,SAAS,EAAE,WAAW;EAAE;EACxBC,UAAU,EAAE,YAAY;EAAE;EAC1BC,WAAW,EAAE,aAAa;EAAE;EAC5BC,IAAI,EAAE,MAAM;EAAE;EACdC,QAAQ,EAAE,UAAU,CAAE;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,sBAAgC,GAAAR,OAAA,CAAAQ,sBAAA,GAAG,CAACP,YAAY,CAACC,IAAI,EAAED,YAAY,CAACK,IAAI,CAAC;;AAEtF;AACO,IAAMG,iBAAiB,GAAAT,OAAA,CAAAS,iBAAA,GAAG,CAC/BR,YAAY,CAACC,IAAI,EACjBD,YAAY,CAACG,UAAU,EACvBH,YAAY,CAACI,WAAW,CACzB","ignoreList":[]}
|
|
@@ -15,8 +15,9 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ
|
|
|
15
15
|
_Object$defineProperty(exports, "__esModule", {
|
|
16
16
|
value: true
|
|
17
17
|
});
|
|
18
|
-
exports.default = exports.MeetingEndedError = exports.LocusNotFoundError = exports.LocusInfoUpdateType = void 0;
|
|
18
|
+
exports.default = exports.SyncAllBackoffType = exports.MeetingEndedError = exports.LocusNotFoundError = exports.LocusInfoUpdateType = void 0;
|
|
19
19
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
20
|
+
var _set = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/set"));
|
|
20
21
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
21
22
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
22
23
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
|
|
@@ -51,6 +52,12 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
51
52
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
52
53
|
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)); }
|
|
53
54
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
55
|
+
var SyncAllBackoffType = exports.SyncAllBackoffType = /*#__PURE__*/function (SyncAllBackoffType) {
|
|
56
|
+
SyncAllBackoffType["NONE"] = "none";
|
|
57
|
+
SyncAllBackoffType["ONLY_LLM"] = "onlyLLM";
|
|
58
|
+
SyncAllBackoffType["ALL"] = "all";
|
|
59
|
+
return SyncAllBackoffType;
|
|
60
|
+
}({});
|
|
54
61
|
var LocusInfoUpdateType = exports.LocusInfoUpdateType = {
|
|
55
62
|
OBJECTS_UPDATED: 'OBJECTS_UPDATED',
|
|
56
63
|
MEETING_ENDED: 'MEETING_ENDED',
|
|
@@ -111,7 +118,10 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
111
118
|
(0, _defineProperty2.default)(this, "state", void 0);
|
|
112
119
|
(0, _defineProperty2.default)(this, "syncQueue", []);
|
|
113
120
|
(0, _defineProperty2.default)(this, "isSyncInProgress", false);
|
|
114
|
-
|
|
121
|
+
// tracks whether syncAllDatasets is currently in its backoff delay phase and with what scope
|
|
122
|
+
(0, _defineProperty2.default)(this, "syncAllBackoffType", SyncAllBackoffType.NONE);
|
|
123
|
+
// datasets that received messages during the syncAllDatasets backoff sleep and should be skipped
|
|
124
|
+
(0, _defineProperty2.default)(this, "dataSetsSyncedDuringBackoff", new _set.default());
|
|
115
125
|
(0, _defineProperty2.default)(this, "syncQueueProcessingPromise", _promise.default.resolve());
|
|
116
126
|
var _options$initialLocus = options.initialLocus,
|
|
117
127
|
dataSets = _options$initialLocus.dataSets,
|
|
@@ -1465,8 +1475,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1465
1475
|
// parseMessage() -> cancelPendingSyncsForDataSets() doesn't log a
|
|
1466
1476
|
// misleading "aborting sync" message for this already-completed sync
|
|
1467
1477
|
dataSet.syncAbortController = undefined;
|
|
1478
|
+
|
|
1468
1479
|
// the format of sync response is the same as messages, so we can reuse the same handler
|
|
1469
|
-
this.handleMessage(syncResponse,
|
|
1480
|
+
this.handleMessage(syncResponse, "via sync API (".concat(isInitialization ? 'init' : "".concat((0, _keys.default)(leavesData).length, " mismatched leaves"), ")"));
|
|
1470
1481
|
}
|
|
1471
1482
|
_context7.next = 17;
|
|
1472
1483
|
break;
|
|
@@ -1509,21 +1520,60 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1509
1520
|
if (previousLength !== this.syncQueue.length) {
|
|
1510
1521
|
_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
1522
|
}
|
|
1512
|
-
|
|
1513
|
-
|
|
1523
|
+
this.markDataSetsForSyncAllBackoffSkip(dataSetNames);
|
|
1524
|
+
this.abortInFlightSyncs(dataSetNames);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
/**
|
|
1528
|
+
* If a syncAllDatasets backoff sleep is in progress, marks the given data sets to be skipped
|
|
1529
|
+
* after the sleep completes.
|
|
1530
|
+
*
|
|
1531
|
+
* @param {string[]} dataSetNames - The names of the data sets to mark
|
|
1532
|
+
* @returns {void}
|
|
1533
|
+
*/
|
|
1534
|
+
}, {
|
|
1535
|
+
key: "markDataSetsForSyncAllBackoffSkip",
|
|
1536
|
+
value: function markDataSetsForSyncAllBackoffSkip(dataSetNames) {
|
|
1537
|
+
if (this.syncAllBackoffType !== SyncAllBackoffType.NONE) {
|
|
1538
|
+
var _iterator9 = _createForOfIteratorHelper(dataSetNames),
|
|
1539
|
+
_step9;
|
|
1540
|
+
try {
|
|
1541
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
1542
|
+
var name = _step9.value;
|
|
1543
|
+
this.dataSetsSyncedDuringBackoff.add(name);
|
|
1544
|
+
}
|
|
1545
|
+
} catch (err) {
|
|
1546
|
+
_iterator9.e(err);
|
|
1547
|
+
} finally {
|
|
1548
|
+
_iterator9.f();
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
/**
|
|
1554
|
+
* Aborts any in-flight sync HTTP requests for the specified data sets.
|
|
1555
|
+
*
|
|
1556
|
+
* @param {string[]} dataSetNames - The names of the data sets whose syncs should be aborted
|
|
1557
|
+
* @returns {void}
|
|
1558
|
+
*/
|
|
1559
|
+
}, {
|
|
1560
|
+
key: "abortInFlightSyncs",
|
|
1561
|
+
value: function abortInFlightSyncs(dataSetNames) {
|
|
1562
|
+
var _iterator0 = _createForOfIteratorHelper(dataSetNames),
|
|
1563
|
+
_step0;
|
|
1514
1564
|
try {
|
|
1515
|
-
for (
|
|
1565
|
+
for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
|
|
1516
1566
|
var _this$dataSets$name;
|
|
1517
|
-
var name =
|
|
1567
|
+
var name = _step0.value;
|
|
1518
1568
|
if ((_this$dataSets$name = this.dataSets[name]) !== null && _this$dataSets$name !== void 0 && _this$dataSets$name.syncAbortController) {
|
|
1519
1569
|
_loggerProxy.default.logger.info("HashTreeParser#cancelPendingSyncsForDataSets --> ".concat(this.debugId, " aborting in-flight sync for data set \"").concat(name, "\""));
|
|
1520
1570
|
this.dataSets[name].syncAbortController.abort();
|
|
1521
1571
|
}
|
|
1522
1572
|
}
|
|
1523
1573
|
} catch (err) {
|
|
1524
|
-
|
|
1574
|
+
_iterator0.e(err);
|
|
1525
1575
|
} finally {
|
|
1526
|
-
|
|
1576
|
+
_iterator0.f();
|
|
1527
1577
|
}
|
|
1528
1578
|
}
|
|
1529
1579
|
|
|
@@ -1616,82 +1666,178 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1616
1666
|
}
|
|
1617
1667
|
return processSyncQueue;
|
|
1618
1668
|
}()
|
|
1669
|
+
/**
|
|
1670
|
+
* sets the backoff type for syncAllDatasets calls, which determines the scope of datasets that will be synced after the backoff delay.
|
|
1671
|
+
*
|
|
1672
|
+
* @param {boolean} onlyLLM - Whether the backoff is for a syncAllDatasets call that is syncing only LLM datasets
|
|
1673
|
+
* @returns {void}
|
|
1674
|
+
*/
|
|
1675
|
+
)
|
|
1676
|
+
}, {
|
|
1677
|
+
key: "setSyncAllBackoffType",
|
|
1678
|
+
value: function setSyncAllBackoffType(onlyLLM) {
|
|
1679
|
+
this.syncAllBackoffType = onlyLLM ? SyncAllBackoffType.ONLY_LLM : SyncAllBackoffType.ALL;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* Checks if a syncAll backoff is already in progress. If so, upgrades the scope from
|
|
1684
|
+
* onlyLLM to all datasets when the new call has a broader scope.
|
|
1685
|
+
*
|
|
1686
|
+
* @param {boolean} onlyLLM - Whether the current call is for LLM datasets only
|
|
1687
|
+
* @returns {boolean} true if a backoff is already pending (caller should return early)
|
|
1688
|
+
*/
|
|
1689
|
+
}, {
|
|
1690
|
+
key: "tryUpgradePendingBackoff",
|
|
1691
|
+
value: function tryUpgradePendingBackoff(onlyLLM) {
|
|
1692
|
+
if (this.syncAllBackoffType !== SyncAllBackoffType.NONE) {
|
|
1693
|
+
if (!onlyLLM && this.syncAllBackoffType === SyncAllBackoffType.ONLY_LLM) {
|
|
1694
|
+
this.setSyncAllBackoffType(false);
|
|
1695
|
+
_loggerProxy.default.logger.info("HashTreeParser#syncAllDatasets --> ".concat(this.debugId, " upgraded pending syncAll from onlyLLM to all datasets"));
|
|
1696
|
+
}
|
|
1697
|
+
return true;
|
|
1698
|
+
}
|
|
1699
|
+
return false;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1619
1702
|
/**
|
|
1620
1703
|
* Syncs all data sets that have hash trees, one by one in sequence, using the priority order
|
|
1621
|
-
* provided by sortByInitPriority().
|
|
1622
|
-
*
|
|
1704
|
+
* provided by sortByInitPriority().
|
|
1705
|
+
*
|
|
1706
|
+
* If a call is already waiting in the backoff delay phase, a new call with a broader scope
|
|
1707
|
+
* (onlyLLM=false) will upgrade the pending scope, and the dataset list will be computed after
|
|
1708
|
+
* the backoff using the upgraded scope. After the backoff, the sync queue handles deduplication
|
|
1709
|
+
* so no guard is needed.
|
|
1623
1710
|
*
|
|
1711
|
+
* @param {Object} [options={}] - Options for syncing
|
|
1712
|
+
* @param {boolean} [options.onlyLLM=false] - Whether to sync only LLM based data sets
|
|
1624
1713
|
* @returns {Promise<void>}
|
|
1625
1714
|
*/
|
|
1626
|
-
)
|
|
1627
1715
|
}, {
|
|
1628
1716
|
key: "syncAllDatasets",
|
|
1629
1717
|
value: (function () {
|
|
1630
1718
|
var _syncAllDatasets = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1631
|
-
var
|
|
1719
|
+
var options,
|
|
1720
|
+
_options$onlyLLM,
|
|
1721
|
+
onlyLLM,
|
|
1722
|
+
dataSetsToSync,
|
|
1723
|
+
delay,
|
|
1724
|
+
effectiveBackoffType,
|
|
1725
|
+
skippedDataSets,
|
|
1726
|
+
effectiveDataSetsToSync,
|
|
1727
|
+
_iterator1,
|
|
1728
|
+
_step1,
|
|
1729
|
+
ds,
|
|
1730
|
+
_args9 = arguments;
|
|
1632
1731
|
return _regenerator.default.wrap(function (_context9) {
|
|
1633
1732
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1634
1733
|
case 0:
|
|
1734
|
+
options = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
|
|
1735
|
+
_options$onlyLLM = options.onlyLLM, onlyLLM = _options$onlyLLM === void 0 ? false : _options$onlyLLM;
|
|
1635
1736
|
if (!(this.state === 'stopped')) {
|
|
1636
1737
|
_context9.next = 1;
|
|
1637
1738
|
break;
|
|
1638
1739
|
}
|
|
1639
1740
|
return _context9.abrupt("return");
|
|
1640
1741
|
case 1:
|
|
1641
|
-
if (!this.
|
|
1742
|
+
if (!this.tryUpgradePendingBackoff(onlyLLM)) {
|
|
1642
1743
|
_context9.next = 2;
|
|
1643
1744
|
break;
|
|
1644
1745
|
}
|
|
1645
1746
|
return _context9.abrupt("return");
|
|
1646
1747
|
case 2:
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1748
|
+
dataSetsToSync = this.getSortedDataSetsWithHashTrees(onlyLLM);
|
|
1749
|
+
if (!(dataSetsToSync.length === 0)) {
|
|
1750
|
+
_context9.next = 3;
|
|
1751
|
+
break;
|
|
1752
|
+
}
|
|
1753
|
+
return _context9.abrupt("return");
|
|
1754
|
+
case 3:
|
|
1755
|
+
this.setSyncAllBackoffType(onlyLLM);
|
|
1756
|
+
delay = this.getWeightedBackoffTime(dataSetsToSync[0].backoff);
|
|
1757
|
+
_loggerProxy.default.logger.info("HashTreeParser#syncAllDatasets --> ".concat(this.debugId, " starting backoff delay of ").concat(delay, "ms (onlyLLM=").concat(onlyLLM, ")"));
|
|
1758
|
+
|
|
1759
|
+
// delay the start of the syncs - this is a Locus requirement to avoid thundering herd issues
|
|
1760
|
+
_context9.next = 4;
|
|
1761
|
+
return (0, _utils.sleep)(delay);
|
|
1762
|
+
case 4:
|
|
1763
|
+
// read the (possibly upgraded) scope and clear the backoff flag
|
|
1764
|
+
effectiveBackoffType = this.syncAllBackoffType;
|
|
1765
|
+
skippedDataSets = this.dataSetsSyncedDuringBackoff;
|
|
1766
|
+
this.syncAllBackoffType = SyncAllBackoffType.NONE;
|
|
1767
|
+
this.dataSetsSyncedDuringBackoff = new _set.default();
|
|
1768
|
+
if (!(this.state === 'stopped')) {
|
|
1769
|
+
_context9.next = 5;
|
|
1770
|
+
break;
|
|
1771
|
+
}
|
|
1772
|
+
return _context9.abrupt("return");
|
|
1773
|
+
case 5:
|
|
1774
|
+
// re-evaluate the dataset list after the sleep, since the scope may have been upgraded
|
|
1775
|
+
// and exclude datasets that received messages during the backoff sleep
|
|
1776
|
+
effectiveDataSetsToSync = this.getSortedDataSetsWithHashTrees(effectiveBackoffType === SyncAllBackoffType.ONLY_LLM).filter(function (ds) {
|
|
1777
|
+
return !skippedDataSets.has(ds.name);
|
|
1655
1778
|
});
|
|
1656
|
-
|
|
1657
|
-
|
|
1779
|
+
if (skippedDataSets.size > 0) {
|
|
1780
|
+
_loggerProxy.default.logger.info("HashTreeParser#syncAllDatasets --> ".concat(this.debugId, " skipping datasets that received messages during backoff: ").concat((0, _toConsumableArray2.default)(skippedDataSets).join(', ')));
|
|
1781
|
+
}
|
|
1782
|
+
_loggerProxy.default.logger.info("HashTreeParser#syncAllDatasets --> ".concat(this.debugId, " syncing ").concat(effectiveBackoffType === SyncAllBackoffType.ONLY_LLM ? 'only LLM' : 'all', " datasets: ").concat(effectiveDataSetsToSync.map(function (ds) {
|
|
1658
1783
|
return ds.name;
|
|
1659
1784
|
}).join(', ')));
|
|
1660
|
-
|
|
1785
|
+
_iterator1 = _createForOfIteratorHelper(effectiveDataSetsToSync);
|
|
1661
1786
|
try {
|
|
1662
|
-
for (
|
|
1663
|
-
ds =
|
|
1787
|
+
for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
|
|
1788
|
+
ds = _step1.value;
|
|
1664
1789
|
this.enqueueSyncForDataset(ds.name, 'syncAllDatasets');
|
|
1665
1790
|
}
|
|
1666
1791
|
} catch (err) {
|
|
1667
|
-
|
|
1792
|
+
_iterator1.e(err);
|
|
1668
1793
|
} finally {
|
|
1669
|
-
|
|
1794
|
+
_iterator1.f();
|
|
1670
1795
|
}
|
|
1671
|
-
_context9.next =
|
|
1796
|
+
_context9.next = 6;
|
|
1672
1797
|
return this.syncQueueProcessingPromise;
|
|
1673
|
-
case
|
|
1674
|
-
_context9.prev = 4;
|
|
1675
|
-
this.isSyncAllInProgress = false;
|
|
1676
|
-
return _context9.finish(4);
|
|
1677
|
-
case 5:
|
|
1798
|
+
case 6:
|
|
1678
1799
|
case "end":
|
|
1679
1800
|
return _context9.stop();
|
|
1680
1801
|
}
|
|
1681
|
-
}, _callee8, this
|
|
1802
|
+
}, _callee8, this);
|
|
1682
1803
|
}));
|
|
1683
1804
|
function syncAllDatasets() {
|
|
1684
1805
|
return _syncAllDatasets.apply(this, arguments);
|
|
1685
1806
|
}
|
|
1686
1807
|
return syncAllDatasets;
|
|
1687
1808
|
}()
|
|
1809
|
+
/**
|
|
1810
|
+
* Returns the list of data sets that have hash trees, sorted by the priority order provided by sortByInitPriority().
|
|
1811
|
+
*
|
|
1812
|
+
* @param {boolean} onlyLLM - Whether to include only LLM based data sets
|
|
1813
|
+
* @returns {Array<{name: string, backoff: {maxMs: number, exponent: number}}>} The sorted list of data sets with their backoff configurations
|
|
1814
|
+
*/
|
|
1815
|
+
)
|
|
1816
|
+
}, {
|
|
1817
|
+
key: "getSortedDataSetsWithHashTrees",
|
|
1818
|
+
value: function getSortedDataSetsWithHashTrees(onlyLLM) {
|
|
1819
|
+
var dataSets = (0, _values.default)(this.dataSets).filter(function (dataSet) {
|
|
1820
|
+
return dataSet === null || dataSet === void 0 ? void 0 : dataSet.hashTree;
|
|
1821
|
+
}).map(function (dataSet) {
|
|
1822
|
+
return {
|
|
1823
|
+
name: dataSet.name,
|
|
1824
|
+
backoff: dataSet.backoff
|
|
1825
|
+
};
|
|
1826
|
+
});
|
|
1827
|
+
if (onlyLLM) {
|
|
1828
|
+
dataSets = dataSets.filter(function (ds) {
|
|
1829
|
+
return _constants3.LLM_DATASET_NAMES.includes(ds.name);
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
return (0, _utils.sortByInitPriority)(dataSets, _constants3.DATA_SET_INIT_PRIORITY);
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1688
1835
|
/**
|
|
1689
1836
|
* Runs the sync algorithm for the given data set.
|
|
1690
1837
|
*
|
|
1691
1838
|
* @param {DataSet} receivedDataSet - The data set to run the sync algorithm for.
|
|
1692
1839
|
* @returns {void}
|
|
1693
1840
|
*/
|
|
1694
|
-
)
|
|
1695
1841
|
}, {
|
|
1696
1842
|
key: "runSyncAlgorithm",
|
|
1697
1843
|
value: function runSyncAlgorithm(receivedDataSet) {
|
|
@@ -1745,11 +1891,11 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1745
1891
|
if (!this.heartbeatIntervalMs) {
|
|
1746
1892
|
return;
|
|
1747
1893
|
}
|
|
1748
|
-
var
|
|
1749
|
-
|
|
1894
|
+
var _iterator10 = _createForOfIteratorHelper(receivedDataSets),
|
|
1895
|
+
_step10;
|
|
1750
1896
|
try {
|
|
1751
1897
|
var _loop2 = function _loop2() {
|
|
1752
|
-
var receivedDataSet =
|
|
1898
|
+
var receivedDataSet = _step10.value;
|
|
1753
1899
|
var dataSet = _this11.dataSets[receivedDataSet.name];
|
|
1754
1900
|
if (!(dataSet !== null && dataSet !== void 0 && dataSet.hashTree)) {
|
|
1755
1901
|
// eslint-disable-next-line no-continue
|
|
@@ -1772,13 +1918,13 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1772
1918
|
_this11.resetHeartbeatWatchdogs([dataSet]);
|
|
1773
1919
|
}, delay);
|
|
1774
1920
|
};
|
|
1775
|
-
for (
|
|
1921
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
1776
1922
|
if (_loop2()) continue;
|
|
1777
1923
|
}
|
|
1778
1924
|
} catch (err) {
|
|
1779
|
-
|
|
1925
|
+
_iterator10.e(err);
|
|
1780
1926
|
} finally {
|
|
1781
|
-
|
|
1927
|
+
_iterator10.f();
|
|
1782
1928
|
}
|
|
1783
1929
|
}
|
|
1784
1930
|
|
|
@@ -1813,6 +1959,8 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1813
1959
|
_loggerProxy.default.logger.info("HashTreeParser#stop --> ".concat(this.debugId, " Stopping HashTreeParser, clearing timers and hash trees"));
|
|
1814
1960
|
this.stopAllTimers();
|
|
1815
1961
|
this.syncQueue = [];
|
|
1962
|
+
this.syncAllBackoffType = SyncAllBackoffType.NONE;
|
|
1963
|
+
this.dataSetsSyncedDuringBackoff = new _set.default();
|
|
1816
1964
|
(0, _values.default)(this.dataSets).forEach(function (dataSet) {
|
|
1817
1965
|
var _dataSet$syncAbortCon2;
|
|
1818
1966
|
(_dataSet$syncAbortCon2 = dataSet.syncAbortController) === null || _dataSet$syncAbortCon2 === void 0 ? void 0 : _dataSet$syncAbortCon2.abort();
|
|
@@ -1854,11 +2002,11 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1854
2002
|
}
|
|
1855
2003
|
this.setVisibleDataSets(metadataObject.data.visibleDataSets, message.dataSets);
|
|
1856
2004
|
this.dataSets = {};
|
|
1857
|
-
var
|
|
1858
|
-
|
|
2005
|
+
var _iterator11 = _createForOfIteratorHelper(message.dataSets),
|
|
2006
|
+
_step11;
|
|
1859
2007
|
try {
|
|
1860
|
-
for (
|
|
1861
|
-
var dataSet =
|
|
2008
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
2009
|
+
var dataSet = _step11.value;
|
|
1862
2010
|
var name = dataSet.name,
|
|
1863
2011
|
leafCount = dataSet.leafCount;
|
|
1864
2012
|
this.dataSets[name] = _objectSpread(_objectSpread({}, dataSet), {}, {
|
|
@@ -1866,9 +2014,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1866
2014
|
});
|
|
1867
2015
|
}
|
|
1868
2016
|
} catch (err) {
|
|
1869
|
-
|
|
2017
|
+
_iterator11.e(err);
|
|
1870
2018
|
} finally {
|
|
1871
|
-
|
|
2019
|
+
_iterator11.f();
|
|
1872
2020
|
}
|
|
1873
2021
|
_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) {
|
|
1874
2022
|
return ds.name;
|