@webex/plugin-meetings 3.12.0-next.54 → 3.12.0-next.56
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/hashTreeParser.js +131 -51
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +0 -1
- package/dist/locus-info/index.js.map +1 -1
- package/dist/metrics/constants.js +3 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/types/hashTree/hashTreeParser.d.ts +9 -0
- package/dist/types/metrics/constants.d.ts +2 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +1 -1
- package/src/hashTree/hashTreeParser.ts +84 -18
- package/src/locus-info/index.ts +0 -4
- package/src/metrics/constants.ts +2 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +268 -0
|
@@ -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.56"
|
|
195
195
|
});
|
|
196
196
|
var _default = exports.default = AIEnableRequest;
|
|
197
197
|
//# sourceMappingURL=index.js.map
|
package/dist/breakouts/index.js
CHANGED
|
@@ -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.
|
|
1113
|
+
version: "3.12.0-next.56"
|
|
1114
1114
|
});
|
|
1115
1115
|
var _default = exports.default = Breakouts;
|
|
1116
1116
|
//# sourceMappingURL=index.js.map
|
|
@@ -622,6 +622,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
622
622
|
version: version
|
|
623
623
|
};
|
|
624
624
|
}))));
|
|
625
|
+
this.cancelPendingSyncsForDataSets(dataSets.map(function (ds) {
|
|
626
|
+
return ds.name;
|
|
627
|
+
}));
|
|
625
628
|
dataSets.forEach(function (dataSet) {
|
|
626
629
|
_this4.updateDataSetInfo(dataSet);
|
|
627
630
|
_this4.runSyncAlgorithm(dataSet);
|
|
@@ -736,6 +739,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
736
739
|
var dataSets = update.dataSets,
|
|
737
740
|
locus = update.locus,
|
|
738
741
|
metadata = update.metadata;
|
|
742
|
+
_loggerProxy.default.logger.info("HashTreeParser#handleLocusUpdate --> ".concat(this.debugId, " received update with dataSets=").concat(dataSets === null || dataSets === void 0 ? void 0 : dataSets.map(function (ds) {
|
|
743
|
+
return ds.name;
|
|
744
|
+
}).join(','), " metadata=").concat(metadata ? 'yes' : 'no'));
|
|
739
745
|
if (!dataSets) {
|
|
740
746
|
// this happens for example when we handle GET /loci response
|
|
741
747
|
_loggerProxy.default.logger.info("HashTreeParser#handleLocusUpdate --> ".concat(this.debugId, " received hash tree update without dataSets"));
|
|
@@ -908,7 +914,10 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
908
914
|
}, {
|
|
909
915
|
key: "deleteHashTree",
|
|
910
916
|
value: function deleteHashTree(dataSetName) {
|
|
917
|
+
var _this$dataSets$dataSe;
|
|
911
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;
|
|
912
921
|
|
|
913
922
|
// we also need to stop the timers as there is no hash tree anymore to sync
|
|
914
923
|
if (this.dataSets[dataSetName].timer) {
|
|
@@ -1105,17 +1114,27 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1105
1114
|
}, {
|
|
1106
1115
|
key: "parseMessage",
|
|
1107
1116
|
value: function parseMessage(message, debugText) {
|
|
1108
|
-
var _message$
|
|
1117
|
+
var _message$dataSets,
|
|
1118
|
+
_message$locusStateEl,
|
|
1119
|
+
_message$locusStateEl2,
|
|
1109
1120
|
_this0 = this;
|
|
1110
1121
|
if (this.state === 'stopped') {
|
|
1111
1122
|
return [];
|
|
1112
1123
|
}
|
|
1113
1124
|
var dataSets = message.dataSets,
|
|
1114
1125
|
visibleDataSetsUrl = message.visibleDataSetsUrl;
|
|
1115
|
-
_loggerProxy.default.logger.info("HashTreeParser#parseMessage --> ".concat(this.debugId, "
|
|
1116
|
-
|
|
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;
|
|
1129
|
+
return "".concat(name, ":").concat(version);
|
|
1130
|
+
}).join(','), ", elements: ").concat((_message$locusStateEl = message.locusStateElements) === null || _message$locusStateEl === void 0 ? void 0 : _message$locusStateEl.map(function (el) {
|
|
1131
|
+
return "".concat(el.htMeta.elementId.type, ":").concat(el.htMeta.elementId.id, ":").concat(el.htMeta.elementId.version).concat(el.data ? '+' : '-');
|
|
1132
|
+
}).join(',')));
|
|
1133
|
+
if (((_message$locusStateEl2 = message.locusStateElements) === null || _message$locusStateEl2 === void 0 ? void 0 : _message$locusStateEl2.length) === 0) {
|
|
1117
1134
|
_loggerProxy.default.logger.warn("HashTreeParser#parseMessage --> ".concat(this.debugId, " got empty locusStateElements!!!"));
|
|
1118
|
-
|
|
1135
|
+
_metrics.default.sendBehavioralMetric(_constants.default.HASH_TREE_EMPTY_LOCUS_STATE_ELEMENTS, {
|
|
1136
|
+
debugId: this.debugId
|
|
1137
|
+
});
|
|
1119
1138
|
}
|
|
1120
1139
|
|
|
1121
1140
|
// first, update our metadata about the datasets with info from the message
|
|
@@ -1123,6 +1142,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1123
1142
|
dataSets.forEach(function (dataSet) {
|
|
1124
1143
|
return _this0.updateDataSetInfo(dataSet);
|
|
1125
1144
|
});
|
|
1145
|
+
this.cancelPendingSyncsForDataSets(dataSets.map(function (ds) {
|
|
1146
|
+
return ds.name;
|
|
1147
|
+
}));
|
|
1126
1148
|
var updatedObjects = [];
|
|
1127
1149
|
|
|
1128
1150
|
// when we detect new visible datasets, it may be that the metadata about them is not
|
|
@@ -1185,10 +1207,10 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1185
1207
|
item: object.htMeta.elementId
|
|
1186
1208
|
};
|
|
1187
1209
|
}));
|
|
1188
|
-
(0, _lodash.zip)(appliedChangesList, locusStateElementsForThisSet).forEach(function (
|
|
1189
|
-
var
|
|
1190
|
-
changeApplied =
|
|
1191
|
-
object =
|
|
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];
|
|
1192
1214
|
if (changeApplied) {
|
|
1193
1215
|
// add to updatedObjects so that our locus DTO will get updated with the new object
|
|
1194
1216
|
updatedObjects.push(object);
|
|
@@ -1335,7 +1357,8 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1335
1357
|
key: "performSync",
|
|
1336
1358
|
value: (function () {
|
|
1337
1359
|
var _performSync = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6(dataSet, reason, isInitialization) {
|
|
1338
|
-
var
|
|
1360
|
+
var _dataSet$syncAbortCon;
|
|
1361
|
+
var abortController, hashTree, rootHash, leavesData, receivedHashes, hashesResult, mismatchedLeaveIndexes, syncResponse, _t3, _t4;
|
|
1339
1362
|
return _regenerator.default.wrap(function (_context7) {
|
|
1340
1363
|
while (1) switch (_context7.prev = _context7.next) {
|
|
1341
1364
|
case 0:
|
|
@@ -1345,6 +1368,8 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1345
1368
|
}
|
|
1346
1369
|
return _context7.abrupt("return");
|
|
1347
1370
|
case 1:
|
|
1371
|
+
abortController = (_dataSet$syncAbortCon = dataSet.syncAbortController) !== null && _dataSet$syncAbortCon !== void 0 ? _dataSet$syncAbortCon : new AbortController();
|
|
1372
|
+
dataSet.syncAbortController = abortController;
|
|
1348
1373
|
hashTree = dataSet.hashTree;
|
|
1349
1374
|
rootHash = hashTree.getRootHash();
|
|
1350
1375
|
_context7.prev = 2;
|
|
@@ -1398,59 +1423,110 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1398
1423
|
0: hashTree.getLeafData(0)
|
|
1399
1424
|
};
|
|
1400
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:
|
|
1401
1433
|
// request sync for mismatched leaves
|
|
1402
1434
|
syncResponse = null;
|
|
1403
1435
|
if (!isInitialization) {
|
|
1404
|
-
_context7.next =
|
|
1436
|
+
_context7.next = 13;
|
|
1405
1437
|
break;
|
|
1406
1438
|
}
|
|
1407
|
-
_context7.next =
|
|
1439
|
+
_context7.next = 12;
|
|
1408
1440
|
return this.sendSyncRequestToLocus(dataSet, {
|
|
1409
1441
|
isInitialization: true
|
|
1410
1442
|
});
|
|
1411
|
-
case
|
|
1443
|
+
case 12:
|
|
1412
1444
|
syncResponse = _context7.sent;
|
|
1413
|
-
_context7.next =
|
|
1445
|
+
_context7.next = 15;
|
|
1414
1446
|
break;
|
|
1415
|
-
case
|
|
1447
|
+
case 13:
|
|
1416
1448
|
if (!((0, _keys.default)(leavesData).length > 0)) {
|
|
1417
|
-
_context7.next =
|
|
1449
|
+
_context7.next = 15;
|
|
1418
1450
|
break;
|
|
1419
1451
|
}
|
|
1420
|
-
_context7.next =
|
|
1452
|
+
_context7.next = 14;
|
|
1421
1453
|
return this.sendSyncRequestToLocus(dataSet, {
|
|
1422
1454
|
mismatchedLeavesData: leavesData
|
|
1423
1455
|
});
|
|
1424
|
-
case 13:
|
|
1425
|
-
syncResponse = _context7.sent;
|
|
1426
1456
|
case 14:
|
|
1457
|
+
syncResponse = _context7.sent;
|
|
1458
|
+
case 15:
|
|
1427
1459
|
// sync API may return nothing (in that case data will arrive via messages)
|
|
1428
1460
|
// or it may return a response in the same format as messages
|
|
1429
1461
|
// We still need to restart the sync timer as a safety net in case the messages don't arrive.
|
|
1430
1462
|
this.runSyncAlgorithm(dataSet);
|
|
1431
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;
|
|
1432
1468
|
// the format of sync response is the same as messages, so we can reuse the same handler
|
|
1433
1469
|
this.handleMessage(syncResponse, 'via sync API');
|
|
1434
1470
|
}
|
|
1435
|
-
_context7.next =
|
|
1471
|
+
_context7.next = 17;
|
|
1436
1472
|
break;
|
|
1437
|
-
case
|
|
1438
|
-
_context7.prev =
|
|
1473
|
+
case 16:
|
|
1474
|
+
_context7.prev = 16;
|
|
1439
1475
|
_t4 = _context7["catch"](2);
|
|
1440
1476
|
if (!this.handleSyncErrors(_t4)) {
|
|
1441
1477
|
_loggerProxy.default.logger.warn("HashTreeParser#performSync --> ".concat(this.debugId, " error during sync for data set \"").concat(dataSet.name, "\":"), _t4);
|
|
1442
1478
|
}
|
|
1443
|
-
case
|
|
1479
|
+
case 17:
|
|
1480
|
+
_context7.prev = 17;
|
|
1481
|
+
dataSet.syncAbortController = undefined;
|
|
1482
|
+
return _context7.finish(17);
|
|
1483
|
+
case 18:
|
|
1444
1484
|
case "end":
|
|
1445
1485
|
return _context7.stop();
|
|
1446
1486
|
}
|
|
1447
|
-
}, _callee6, this, [[2,
|
|
1487
|
+
}, _callee6, this, [[2, 16, 17, 18], [3, 6]]);
|
|
1448
1488
|
}));
|
|
1449
1489
|
function performSync(_x8, _x9, _x0) {
|
|
1450
1490
|
return _performSync.apply(this, arguments);
|
|
1451
1491
|
}
|
|
1452
1492
|
return performSync;
|
|
1453
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
|
+
|
|
1454
1530
|
/**
|
|
1455
1531
|
* Enqueues a sync for the given data set. If the data set is already in the queue, the request is ignored.
|
|
1456
1532
|
* This ensures that all syncs are executed sequentially and no more than 1 sync runs at a time.
|
|
@@ -1460,7 +1536,6 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1460
1536
|
* @param {boolean} [isInitialization=false] - Whether this is an initialization sync (uses empty leaves data instead of hash comparison)
|
|
1461
1537
|
* @returns {void}
|
|
1462
1538
|
*/
|
|
1463
|
-
)
|
|
1464
1539
|
}, {
|
|
1465
1540
|
key: "enqueueSyncForDataset",
|
|
1466
1541
|
value: function enqueueSyncForDataset(dataSetName, reason) {
|
|
@@ -1495,7 +1570,7 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1495
1570
|
key: "processSyncQueue",
|
|
1496
1571
|
value: (function () {
|
|
1497
1572
|
var _processSyncQueue = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
1498
|
-
var
|
|
1573
|
+
var _ref8, dataSetName, reason, isInitialization, dataSet;
|
|
1499
1574
|
return _regenerator.default.wrap(function (_context8) {
|
|
1500
1575
|
while (1) switch (_context8.prev = _context8.next) {
|
|
1501
1576
|
case 0:
|
|
@@ -1513,7 +1588,7 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1513
1588
|
break;
|
|
1514
1589
|
}
|
|
1515
1590
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1516
|
-
|
|
1591
|
+
_ref8 = this.syncQueue.shift(), dataSetName = _ref8.dataSetName, reason = _ref8.reason, isInitialization = _ref8.isInitialization;
|
|
1517
1592
|
dataSet = this.dataSets[dataSetName];
|
|
1518
1593
|
if (dataSet !== null && dataSet !== void 0 && dataSet.hashTree) {
|
|
1519
1594
|
_context8.next = 4;
|
|
@@ -1553,7 +1628,7 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1553
1628
|
key: "syncAllDatasets",
|
|
1554
1629
|
value: (function () {
|
|
1555
1630
|
var _syncAllDatasets = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1556
|
-
var dataSetsWithHashTrees, sorted,
|
|
1631
|
+
var dataSetsWithHashTrees, sorted, _iterator0, _step0, ds;
|
|
1557
1632
|
return _regenerator.default.wrap(function (_context9) {
|
|
1558
1633
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1559
1634
|
case 0:
|
|
@@ -1582,16 +1657,16 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1582
1657
|
_loggerProxy.default.logger.info("HashTreeParser#syncAllDatasets --> ".concat(this.debugId, " syncing datasets: ").concat(sorted.map(function (ds) {
|
|
1583
1658
|
return ds.name;
|
|
1584
1659
|
}).join(', ')));
|
|
1585
|
-
|
|
1660
|
+
_iterator0 = _createForOfIteratorHelper(sorted);
|
|
1586
1661
|
try {
|
|
1587
|
-
for (
|
|
1588
|
-
ds =
|
|
1662
|
+
for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
|
|
1663
|
+
ds = _step0.value;
|
|
1589
1664
|
this.enqueueSyncForDataset(ds.name, 'syncAllDatasets');
|
|
1590
1665
|
}
|
|
1591
1666
|
} catch (err) {
|
|
1592
|
-
|
|
1667
|
+
_iterator0.e(err);
|
|
1593
1668
|
} finally {
|
|
1594
|
-
|
|
1669
|
+
_iterator0.f();
|
|
1595
1670
|
}
|
|
1596
1671
|
_context9.next = 4;
|
|
1597
1672
|
return this.syncQueueProcessingPromise;
|
|
@@ -1627,7 +1702,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1627
1702
|
return;
|
|
1628
1703
|
}
|
|
1629
1704
|
if (!dataSet.hashTree) {
|
|
1630
|
-
|
|
1705
|
+
// no hash tree, so no need to do any syncing
|
|
1706
|
+
// we fall into this branch often, because Locus sends dataSets in messages that are not visible to us
|
|
1707
|
+
|
|
1631
1708
|
return;
|
|
1632
1709
|
}
|
|
1633
1710
|
dataSet.hashTree.resize(receivedDataSet.leafCount);
|
|
@@ -1636,7 +1713,6 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1636
1713
|
if (dataSet.timer) {
|
|
1637
1714
|
clearTimeout(dataSet.timer);
|
|
1638
1715
|
}
|
|
1639
|
-
_loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " setting \"").concat(dataSet.name, "\" sync timer for ").concat(delay));
|
|
1640
1716
|
dataSet.timer = setTimeout(function () {
|
|
1641
1717
|
dataSet.timer = undefined;
|
|
1642
1718
|
if (!dataSet.hashTree) {
|
|
@@ -1646,8 +1722,6 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1646
1722
|
var rootHash = dataSet.hashTree.getRootHash();
|
|
1647
1723
|
if (dataSet.root !== rootHash) {
|
|
1648
1724
|
_this10.enqueueSyncForDataset(dataSet.name, "Root hash mismatch: received=".concat(dataSet.root, ", ours=").concat(rootHash));
|
|
1649
|
-
} else {
|
|
1650
|
-
_loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this10.debugId, " \"").concat(dataSet.name, "\" root hash matching: ").concat(rootHash, ", version=").concat(dataSet.version));
|
|
1651
1725
|
}
|
|
1652
1726
|
}, delay);
|
|
1653
1727
|
} else {
|
|
@@ -1671,11 +1745,11 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1671
1745
|
if (!this.heartbeatIntervalMs) {
|
|
1672
1746
|
return;
|
|
1673
1747
|
}
|
|
1674
|
-
var
|
|
1675
|
-
|
|
1748
|
+
var _iterator1 = _createForOfIteratorHelper(receivedDataSets),
|
|
1749
|
+
_step1;
|
|
1676
1750
|
try {
|
|
1677
1751
|
var _loop2 = function _loop2() {
|
|
1678
|
-
var receivedDataSet =
|
|
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
|
|
@@ -1690,17 +1764,21 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1690
1764
|
dataSet.heartbeatWatchdogTimer = setTimeout(function () {
|
|
1691
1765
|
dataSet.heartbeatWatchdogTimer = undefined;
|
|
1692
1766
|
_loggerProxy.default.logger.warn("HashTreeParser#resetHeartbeatWatchdogs --> ".concat(_this11.debugId, " Heartbeat watchdog fired for data set \"").concat(dataSet.name, "\" - no heartbeat received within expected interval, initiating sync"));
|
|
1767
|
+
_metrics.default.sendBehavioralMetric(_constants.default.HASH_TREE_HEARTBEAT_WATCHDOG_EXPIRED, {
|
|
1768
|
+
debugId: _this11.debugId,
|
|
1769
|
+
dataSetName: dataSet.name
|
|
1770
|
+
});
|
|
1693
1771
|
_this11.enqueueSyncForDataset(dataSet.name, "heartbeat watchdog expired");
|
|
1694
1772
|
_this11.resetHeartbeatWatchdogs([dataSet]);
|
|
1695
1773
|
}, delay);
|
|
1696
1774
|
};
|
|
1697
|
-
for (
|
|
1775
|
+
for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
|
|
1698
1776
|
if (_loop2()) continue;
|
|
1699
1777
|
}
|
|
1700
1778
|
} catch (err) {
|
|
1701
|
-
|
|
1779
|
+
_iterator1.e(err);
|
|
1702
1780
|
} finally {
|
|
1703
|
-
|
|
1781
|
+
_iterator1.f();
|
|
1704
1782
|
}
|
|
1705
1783
|
}
|
|
1706
1784
|
|
|
@@ -1736,6 +1814,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1736
1814
|
this.stopAllTimers();
|
|
1737
1815
|
this.syncQueue = [];
|
|
1738
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;
|
|
1739
1820
|
dataSet.hashTree = undefined;
|
|
1740
1821
|
});
|
|
1741
1822
|
this.visibleDataSets = [];
|
|
@@ -1762,9 +1843,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1762
1843
|
}, {
|
|
1763
1844
|
key: "resumeFromMessage",
|
|
1764
1845
|
value: function resumeFromMessage(message) {
|
|
1765
|
-
var _message$
|
|
1846
|
+
var _message$locusStateEl3, _metadataObject$data;
|
|
1766
1847
|
// check that message contains metadata with visible data sets - this is essential to be able to resume
|
|
1767
|
-
var metadataObject = (_message$
|
|
1848
|
+
var metadataObject = (_message$locusStateEl3 = message.locusStateElements) === null || _message$locusStateEl3 === void 0 ? void 0 : _message$locusStateEl3.find(function (el) {
|
|
1768
1849
|
return (0, _utils.isMetadata)(el);
|
|
1769
1850
|
});
|
|
1770
1851
|
if (!(metadataObject !== null && metadataObject !== void 0 && (_metadataObject$data = metadataObject.data) !== null && _metadataObject$data !== void 0 && _metadataObject$data.visibleDataSets)) {
|
|
@@ -1773,11 +1854,11 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1773
1854
|
}
|
|
1774
1855
|
this.setVisibleDataSets(metadataObject.data.visibleDataSets, message.dataSets);
|
|
1775
1856
|
this.dataSets = {};
|
|
1776
|
-
var
|
|
1777
|
-
|
|
1857
|
+
var _iterator10 = _createForOfIteratorHelper(message.dataSets),
|
|
1858
|
+
_step10;
|
|
1778
1859
|
try {
|
|
1779
|
-
for (
|
|
1780
|
-
var dataSet =
|
|
1860
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
1861
|
+
var dataSet = _step10.value;
|
|
1781
1862
|
var name = dataSet.name,
|
|
1782
1863
|
leafCount = dataSet.leafCount;
|
|
1783
1864
|
this.dataSets[name] = _objectSpread(_objectSpread({}, dataSet), {}, {
|
|
@@ -1785,9 +1866,9 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1785
1866
|
});
|
|
1786
1867
|
}
|
|
1787
1868
|
} catch (err) {
|
|
1788
|
-
|
|
1869
|
+
_iterator10.e(err);
|
|
1789
1870
|
} finally {
|
|
1790
|
-
|
|
1871
|
+
_iterator10.f();
|
|
1791
1872
|
}
|
|
1792
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) {
|
|
1793
1874
|
return ds.name;
|
|
@@ -1940,7 +2021,6 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1940
2021
|
},
|
|
1941
2022
|
body: body
|
|
1942
2023
|
}).then(function (resp) {
|
|
1943
|
-
_loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this13.debugId, " Sync request succeeded for \"").concat(dataSet.name, "\""));
|
|
1944
2024
|
if (!resp.body || (0, _lodash.isEmpty)(resp.body)) {
|
|
1945
2025
|
_loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this13.debugId, " Got ").concat(resp.statusCode, " with empty body for sync request for data set \"").concat(dataSet.name, "\", data should arrive via messages"));
|
|
1946
2026
|
return null;
|