@webex/plugin-meetings 3.11.0-next.34 → 3.11.0-next.36
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 +180 -242
- 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 +3 -21
- package/dist/locus-info/index.js.map +1 -1
- package/dist/types/hashTree/hashTreeParser.d.ts +2 -2
- package/dist/webinar/index.js +1 -1
- package/package.json +13 -13
- package/src/hashTree/hashTreeParser.ts +18 -44
- package/src/locus-info/index.ts +2 -10
- package/test/unit/spec/hashTree/hashTreeParser.ts +78 -137
- package/test/unit/spec/locus-info/index.js +0 -31
|
@@ -178,7 +178,7 @@ var AIEnableRequest = _webexCore.WebexPlugin.extend({
|
|
|
178
178
|
method: _constants.HTTP_VERBS.PUT
|
|
179
179
|
});
|
|
180
180
|
},
|
|
181
|
-
version: "3.11.0-next.
|
|
181
|
+
version: "3.11.0-next.36"
|
|
182
182
|
});
|
|
183
183
|
var _default = exports.default = AIEnableRequest;
|
|
184
184
|
//# sourceMappingURL=index.js.map
|
package/dist/breakouts/index.js
CHANGED
|
@@ -1109,7 +1109,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1109
1109
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1110
1110
|
}
|
|
1111
1111
|
},
|
|
1112
|
-
version: "3.11.0-next.
|
|
1112
|
+
version: "3.11.0-next.36"
|
|
1113
1113
|
});
|
|
1114
1114
|
var _default = exports.default = Breakouts;
|
|
1115
1115
|
//# sourceMappingURL=index.js.map
|
|
@@ -233,7 +233,10 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
233
233
|
_loggerProxy.default.logger.info("HashTreeParser#sendInitializationSyncRequestToLocus --> ".concat(this.debugId, " Sending initial sync request to Locus for data set \"").concat(datasetName, "\" with empty leaf data"));
|
|
234
234
|
return this.sendSyncRequestToLocus(this.dataSets[datasetName], emptyLeavesData).then(function (syncResponse) {
|
|
235
235
|
if (syncResponse) {
|
|
236
|
-
return
|
|
236
|
+
return {
|
|
237
|
+
updateType: LocusInfoUpdateType.OBJECTS_UPDATED,
|
|
238
|
+
updatedObjects: _this2.parseMessage(syncResponse, "via empty leaves /sync API call for ".concat(debugText))
|
|
239
|
+
};
|
|
237
240
|
}
|
|
238
241
|
return {
|
|
239
242
|
updateType: LocusInfoUpdateType.OBJECTS_UPDATED,
|
|
@@ -366,7 +369,7 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
366
369
|
_iterator2.s();
|
|
367
370
|
case 2:
|
|
368
371
|
if ((_step2 = _iterator2.n()).done) {
|
|
369
|
-
_context3.next =
|
|
372
|
+
_context3.next = 6;
|
|
370
373
|
break;
|
|
371
374
|
}
|
|
372
375
|
dataSet = _step2.value;
|
|
@@ -388,10 +391,10 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
388
391
|
_context3.next = 3;
|
|
389
392
|
break;
|
|
390
393
|
}
|
|
391
|
-
return _context3.abrupt("continue",
|
|
394
|
+
return _context3.abrupt("continue", 5);
|
|
392
395
|
case 3:
|
|
393
396
|
if (this.dataSets[name].hashTree) {
|
|
394
|
-
_context3.next =
|
|
397
|
+
_context3.next = 5;
|
|
395
398
|
break;
|
|
396
399
|
}
|
|
397
400
|
_loggerProxy.default.logger.info("HashTreeParser#initializeDataSets --> ".concat(this.debugId, " creating hash tree for visible dataset \"").concat(name, "\" (").concat(debugText, ")"));
|
|
@@ -402,42 +405,33 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
402
405
|
return this.sendInitializationSyncRequestToLocus(name, debugText);
|
|
403
406
|
case 4:
|
|
404
407
|
_data = _context3.sent;
|
|
405
|
-
if (!(_data.updateType === LocusInfoUpdateType.MEETING_ENDED)) {
|
|
406
|
-
_context3.next = 5;
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
_loggerProxy.default.logger.warn("HashTreeParser#initializeDataSets --> ".concat(this.debugId, " meeting ended while initializing new visible data set \"").concat(name, "\""));
|
|
410
|
-
|
|
411
|
-
// throw an error, it will be caught higher up and the meeting will be destroyed
|
|
412
|
-
throw new MeetingEndedError();
|
|
413
|
-
case 5:
|
|
414
408
|
if (_data.updateType === LocusInfoUpdateType.OBJECTS_UPDATED) {
|
|
415
409
|
updatedObjects.push.apply(updatedObjects, (0, _toConsumableArray2.default)(_data.updatedObjects || []));
|
|
416
410
|
}
|
|
417
|
-
case
|
|
411
|
+
case 5:
|
|
418
412
|
_context3.next = 2;
|
|
419
413
|
break;
|
|
420
|
-
case
|
|
421
|
-
_context3.next =
|
|
414
|
+
case 6:
|
|
415
|
+
_context3.next = 8;
|
|
422
416
|
break;
|
|
423
|
-
case
|
|
424
|
-
_context3.prev =
|
|
417
|
+
case 7:
|
|
418
|
+
_context3.prev = 7;
|
|
425
419
|
_t = _context3["catch"](1);
|
|
426
420
|
_iterator2.e(_t);
|
|
427
|
-
case
|
|
428
|
-
_context3.prev =
|
|
421
|
+
case 8:
|
|
422
|
+
_context3.prev = 8;
|
|
429
423
|
_iterator2.f();
|
|
430
|
-
return _context3.finish(
|
|
431
|
-
case
|
|
424
|
+
return _context3.finish(8);
|
|
425
|
+
case 9:
|
|
432
426
|
this.callLocusInfoUpdateCallback({
|
|
433
427
|
updateType: LocusInfoUpdateType.OBJECTS_UPDATED,
|
|
434
428
|
updatedObjects: updatedObjects
|
|
435
429
|
});
|
|
436
|
-
case
|
|
430
|
+
case 10:
|
|
437
431
|
case "end":
|
|
438
432
|
return _context3.stop();
|
|
439
433
|
}
|
|
440
|
-
}, _callee3, this, [[1, 8, 9
|
|
434
|
+
}, _callee3, this, [[1, 7, 8, 9]]);
|
|
441
435
|
}));
|
|
442
436
|
function initializeDataSets(_x3, _x4) {
|
|
443
437
|
return _initializeDataSets.apply(this, arguments);
|
|
@@ -1027,143 +1021,116 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1027
1021
|
*
|
|
1028
1022
|
* @param {HashTreeMessage} message - The hash tree message containing data sets and objects to be processed
|
|
1029
1023
|
* @param {string} [debugText] - Optional debug text to include in logs
|
|
1030
|
-
* @returns {
|
|
1024
|
+
* @returns {HashTreeObject[]} list of hash tree objects that were updated as a result of processing the message
|
|
1031
1025
|
*/
|
|
1032
1026
|
)
|
|
1033
1027
|
}, {
|
|
1034
1028
|
key: "parseMessage",
|
|
1035
|
-
value:
|
|
1036
|
-
var
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
if (((_message$locusStateEl = message.locusStateElements) === null || _message$locusStateEl === void 0 ? void 0 : _message$locusStateEl.length) === 0) {
|
|
1047
|
-
_loggerProxy.default.logger.warn("HashTreeParser#parseMessage --> ".concat(this.debugId, " got empty locusStateElements!!!"));
|
|
1048
|
-
// todo: send a metric
|
|
1049
|
-
}
|
|
1029
|
+
value: function parseMessage(message, debugText) {
|
|
1030
|
+
var _message$locusStateEl,
|
|
1031
|
+
_this1 = this,
|
|
1032
|
+
_message$locusStateEl2;
|
|
1033
|
+
var dataSets = message.dataSets,
|
|
1034
|
+
visibleDataSetsUrl = message.visibleDataSetsUrl;
|
|
1035
|
+
_loggerProxy.default.logger.info("HashTreeParser#parseMessage --> ".concat(this.debugId, " received message ").concat(debugText || '', ":"), message);
|
|
1036
|
+
if (((_message$locusStateEl = message.locusStateElements) === null || _message$locusStateEl === void 0 ? void 0 : _message$locusStateEl.length) === 0) {
|
|
1037
|
+
_loggerProxy.default.logger.warn("HashTreeParser#parseMessage --> ".concat(this.debugId, " got empty locusStateElements!!!"));
|
|
1038
|
+
// todo: send a metric
|
|
1039
|
+
}
|
|
1050
1040
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
} catch (err) {
|
|
1081
|
-
_iterator8.e(err);
|
|
1082
|
-
} finally {
|
|
1083
|
-
_iterator8.f();
|
|
1084
|
-
}
|
|
1085
|
-
});
|
|
1086
|
-
updatedObjects.push.apply(updatedObjects, updatedMetadataObjects);
|
|
1087
|
-
_this$checkForVisible2 = this.checkForVisibleDataSetChanges(updatedMetadataObjects), changeDetected = _this$checkForVisible2.changeDetected, removedDataSets = _this$checkForVisible2.removedDataSets, addedDataSets = _this$checkForVisible2.addedDataSets;
|
|
1088
|
-
if (changeDetected) {
|
|
1089
|
-
dataSetsRequiringInitialization = this.processVisibleDataSetChanges(removedDataSets, addedDataSets, updatedObjects);
|
|
1041
|
+
// first, update our metadata about the datasets with info from the message
|
|
1042
|
+
this.visibleDataSetsUrl = visibleDataSetsUrl;
|
|
1043
|
+
dataSets.forEach(function (dataSet) {
|
|
1044
|
+
return _this1.updateDataSetInfo(dataSet);
|
|
1045
|
+
});
|
|
1046
|
+
var updatedObjects = [];
|
|
1047
|
+
|
|
1048
|
+
// when we detect new visible datasets, it may be that the metadata about them is not
|
|
1049
|
+
// available in the message, they will require separate async initialization
|
|
1050
|
+
var dataSetsRequiringInitialization = [];
|
|
1051
|
+
|
|
1052
|
+
// first find out if there are any visible data set changes - they're signalled in Metadata object updates
|
|
1053
|
+
var metadataUpdates = (message.locusStateElements || []).filter(function (object) {
|
|
1054
|
+
return (0, _utils.isMetadata)(object);
|
|
1055
|
+
});
|
|
1056
|
+
if (metadataUpdates.length > 0) {
|
|
1057
|
+
var updatedMetadataObjects = [];
|
|
1058
|
+
metadataUpdates.forEach(function (object) {
|
|
1059
|
+
// todo: once Locus supports it, we will use the "view" field here instead of dataSetNames
|
|
1060
|
+
var _iterator8 = _createForOfIteratorHelper(object.htMeta.dataSetNames),
|
|
1061
|
+
_step8;
|
|
1062
|
+
try {
|
|
1063
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1064
|
+
var _this1$dataSets$dataS;
|
|
1065
|
+
var dataSetName = _step8.value;
|
|
1066
|
+
var hashTree = (_this1$dataSets$dataS = _this1.dataSets[dataSetName]) === null || _this1$dataSets$dataS === void 0 ? void 0 : _this1$dataSets$dataS.hashTree;
|
|
1067
|
+
if (hashTree && object.data) {
|
|
1068
|
+
if (hashTree.putItem(object.htMeta.elementId)) {
|
|
1069
|
+
updatedMetadataObjects.push(object);
|
|
1090
1070
|
}
|
|
1091
1071
|
}
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
isRosterDropped = true;
|
|
1119
|
-
}
|
|
1120
|
-
// add to updatedObjects so that our locus DTO will get updated with the new object
|
|
1121
|
-
updatedObjects.push(object);
|
|
1122
|
-
}
|
|
1123
|
-
});
|
|
1124
|
-
} else {
|
|
1125
|
-
_loggerProxy.default.logger.info("Locus-info:index#parseMessage --> ".concat(_this1.debugId, " unexpected (not visible) dataSet ").concat(dataSet.name, " received in hash tree message"));
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
if (!isRosterDropped) {
|
|
1129
|
-
_this1.runSyncAlgorithm(dataSet);
|
|
1130
|
-
}
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
if (!isRosterDropped) {
|
|
1134
|
-
_context6.next = 1;
|
|
1135
|
-
break;
|
|
1136
|
-
}
|
|
1137
|
-
_loggerProxy.default.logger.info("HashTreeParser#parseMessage --> ".concat(this.debugId, " detected roster drop"));
|
|
1138
|
-
this.stopAllTimers();
|
|
1139
|
-
|
|
1140
|
-
// in case of roster drop we don't care about other updates
|
|
1141
|
-
return _context6.abrupt("return", {
|
|
1142
|
-
updateType: LocusInfoUpdateType.MEETING_ENDED
|
|
1072
|
+
}
|
|
1073
|
+
} catch (err) {
|
|
1074
|
+
_iterator8.e(err);
|
|
1075
|
+
} finally {
|
|
1076
|
+
_iterator8.f();
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
updatedObjects.push.apply(updatedObjects, updatedMetadataObjects);
|
|
1080
|
+
var _this$checkForVisible2 = this.checkForVisibleDataSetChanges(updatedMetadataObjects),
|
|
1081
|
+
changeDetected = _this$checkForVisible2.changeDetected,
|
|
1082
|
+
removedDataSets = _this$checkForVisible2.removedDataSets,
|
|
1083
|
+
addedDataSets = _this$checkForVisible2.addedDataSets;
|
|
1084
|
+
if (changeDetected) {
|
|
1085
|
+
dataSetsRequiringInitialization = this.processVisibleDataSetChanges(removedDataSets, addedDataSets, updatedObjects);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
if (((_message$locusStateEl2 = message.locusStateElements) === null || _message$locusStateEl2 === void 0 ? void 0 : _message$locusStateEl2.length) > 0) {
|
|
1089
|
+
// by this point we now have this.dataSets setup for data sets from this message
|
|
1090
|
+
// and hash trees created for the new visible data sets,
|
|
1091
|
+
// so we can now process all the updates from the message
|
|
1092
|
+
dataSets.forEach(function (dataSet) {
|
|
1093
|
+
if (_this1.dataSets[dataSet.name]) {
|
|
1094
|
+
var hashTree = _this1.dataSets[dataSet.name].hashTree;
|
|
1095
|
+
if (hashTree) {
|
|
1096
|
+
var locusStateElementsForThisSet = message.locusStateElements.filter(function (object) {
|
|
1097
|
+
return object.htMeta.dataSetNames.includes(dataSet.name);
|
|
1143
1098
|
});
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1099
|
+
var appliedChangesList = hashTree.updateItems(locusStateElementsForThisSet.map(function (object) {
|
|
1100
|
+
return object.data ? {
|
|
1101
|
+
operation: 'update',
|
|
1102
|
+
item: object.htMeta.elementId
|
|
1103
|
+
} : {
|
|
1104
|
+
operation: 'remove',
|
|
1105
|
+
item: object.htMeta.elementId
|
|
1106
|
+
};
|
|
1107
|
+
}));
|
|
1108
|
+
(0, _lodash.zip)(appliedChangesList, locusStateElementsForThisSet).forEach(function (_ref5) {
|
|
1109
|
+
var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
|
|
1110
|
+
changeApplied = _ref6[0],
|
|
1111
|
+
object = _ref6[1];
|
|
1112
|
+
if (changeApplied) {
|
|
1113
|
+
// add to updatedObjects so that our locus DTO will get updated with the new object
|
|
1114
|
+
updatedObjects.push(object);
|
|
1115
|
+
}
|
|
1155
1116
|
});
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1117
|
+
} else {
|
|
1118
|
+
_loggerProxy.default.logger.info("Locus-info:index#parseMessage --> ".concat(_this1.debugId, " unexpected (not visible) dataSet ").concat(dataSet.name, " received in hash tree message"));
|
|
1119
|
+
}
|
|
1159
1120
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
function parseMessage(_x6, _x7) {
|
|
1163
|
-
return _parseMessage.apply(this, arguments);
|
|
1121
|
+
_this1.runSyncAlgorithm(dataSet);
|
|
1122
|
+
});
|
|
1164
1123
|
}
|
|
1165
|
-
|
|
1166
|
-
|
|
1124
|
+
if (dataSetsRequiringInitialization.length > 0) {
|
|
1125
|
+
// there are some data sets that we need to initialize asynchronously
|
|
1126
|
+
this.queueInitForNewVisibleDataSets(dataSetsRequiringInitialization);
|
|
1127
|
+
}
|
|
1128
|
+
if (updatedObjects.length === 0) {
|
|
1129
|
+
_loggerProxy.default.logger.info("HashTreeParser#parseMessage --> ".concat(this.debugId, " No objects updated as a result of received message"));
|
|
1130
|
+
}
|
|
1131
|
+
return updatedObjects;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1167
1134
|
/**
|
|
1168
1135
|
* Handles incoming hash tree messages, updates the hash trees and calls locusInfoUpdateCallback
|
|
1169
1136
|
*
|
|
@@ -1171,66 +1138,37 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1171
1138
|
* @param {string} [debugText] - Optional debug text to include in logs
|
|
1172
1139
|
* @returns {void}
|
|
1173
1140
|
*/
|
|
1174
|
-
)
|
|
1175
1141
|
}, {
|
|
1176
1142
|
key: "handleMessage",
|
|
1177
|
-
value:
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
return _regenerator.default.wrap(function (_context7) {
|
|
1181
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
1182
|
-
case 0:
|
|
1183
|
-
if (message.heartbeatIntervalMs) {
|
|
1184
|
-
this.heartbeatIntervalMs = message.heartbeatIntervalMs;
|
|
1185
|
-
}
|
|
1186
|
-
if (!this.isEndMessage(message)) {
|
|
1187
|
-
_context7.next = 1;
|
|
1188
|
-
break;
|
|
1189
|
-
}
|
|
1190
|
-
_loggerProxy.default.logger.info("HashTreeParser#parseMessage --> ".concat(this.debugId, " received sentinel END MEETING message"));
|
|
1191
|
-
this.stopAllTimers();
|
|
1192
|
-
this.callLocusInfoUpdateCallback({
|
|
1193
|
-
updateType: LocusInfoUpdateType.MEETING_ENDED
|
|
1194
|
-
});
|
|
1195
|
-
_context7.next = 4;
|
|
1196
|
-
break;
|
|
1197
|
-
case 1:
|
|
1198
|
-
if (!(message.locusStateElements === undefined)) {
|
|
1199
|
-
_context7.next = 2;
|
|
1200
|
-
break;
|
|
1201
|
-
}
|
|
1202
|
-
this.handleRootHashHeartBeatMessage(message);
|
|
1203
|
-
this.resetHeartbeatWatchdogs(message.dataSets);
|
|
1204
|
-
_context7.next = 4;
|
|
1205
|
-
break;
|
|
1206
|
-
case 2:
|
|
1207
|
-
_context7.next = 3;
|
|
1208
|
-
return this.parseMessage(message, debugText);
|
|
1209
|
-
case 3:
|
|
1210
|
-
updates = _context7.sent;
|
|
1211
|
-
// Only reset watchdogs if the meeting hasn't ended
|
|
1212
|
-
if (updates.updateType !== LocusInfoUpdateType.MEETING_ENDED) {
|
|
1213
|
-
this.resetHeartbeatWatchdogs(message.dataSets);
|
|
1214
|
-
}
|
|
1215
|
-
this.callLocusInfoUpdateCallback(updates);
|
|
1216
|
-
case 4:
|
|
1217
|
-
case "end":
|
|
1218
|
-
return _context7.stop();
|
|
1219
|
-
}
|
|
1220
|
-
}, _callee6, this);
|
|
1221
|
-
}));
|
|
1222
|
-
function handleMessage(_x8, _x9) {
|
|
1223
|
-
return _handleMessage.apply(this, arguments);
|
|
1143
|
+
value: function handleMessage(message, debugText) {
|
|
1144
|
+
if (message.heartbeatIntervalMs) {
|
|
1145
|
+
this.heartbeatIntervalMs = message.heartbeatIntervalMs;
|
|
1224
1146
|
}
|
|
1225
|
-
|
|
1226
|
-
|
|
1147
|
+
if (this.isEndMessage(message)) {
|
|
1148
|
+
_loggerProxy.default.logger.info("HashTreeParser#parseMessage --> ".concat(this.debugId, " received sentinel END MEETING message"));
|
|
1149
|
+
this.stopAllTimers();
|
|
1150
|
+
this.callLocusInfoUpdateCallback({
|
|
1151
|
+
updateType: LocusInfoUpdateType.MEETING_ENDED
|
|
1152
|
+
});
|
|
1153
|
+
} else if (message.locusStateElements === undefined) {
|
|
1154
|
+
this.handleRootHashHeartBeatMessage(message);
|
|
1155
|
+
this.resetHeartbeatWatchdogs(message.dataSets);
|
|
1156
|
+
} else {
|
|
1157
|
+
var updatedObjects = this.parseMessage(message, debugText);
|
|
1158
|
+
this.resetHeartbeatWatchdogs(message.dataSets);
|
|
1159
|
+
this.callLocusInfoUpdateCallback({
|
|
1160
|
+
updateType: LocusInfoUpdateType.OBJECTS_UPDATED,
|
|
1161
|
+
updatedObjects: updatedObjects
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1227
1166
|
/**
|
|
1228
1167
|
* Calls the updateInfo callback if there are any updates to report
|
|
1229
1168
|
*
|
|
1230
1169
|
* @param {Object} updates parsed from a Locus message
|
|
1231
1170
|
* @returns {void}
|
|
1232
1171
|
*/
|
|
1233
|
-
)
|
|
1234
1172
|
}, {
|
|
1235
1173
|
key: "callLocusInfoUpdateCallback",
|
|
1236
1174
|
value: function callLocusInfoUpdateCallback(updates) {
|
|
@@ -1309,45 +1247,45 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1309
1247
|
}, {
|
|
1310
1248
|
key: "performSync",
|
|
1311
1249
|
value: (function () {
|
|
1312
|
-
var _performSync = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1250
|
+
var _performSync = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(dataSet, rootHash, reason) {
|
|
1313
1251
|
var mismatchedLeavesData, receivedHashes, _yield$this$getHashes, hashes, latestDataSetInfo, mismatchedLeaveIndexes, syncResponse, _t3, _t4;
|
|
1314
|
-
return _regenerator.default.wrap(function (
|
|
1315
|
-
while (1) switch (
|
|
1252
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
1253
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
1316
1254
|
case 0:
|
|
1317
1255
|
if (dataSet.hashTree) {
|
|
1318
|
-
|
|
1256
|
+
_context6.next = 1;
|
|
1319
1257
|
break;
|
|
1320
1258
|
}
|
|
1321
|
-
return
|
|
1259
|
+
return _context6.abrupt("return");
|
|
1322
1260
|
case 1:
|
|
1323
|
-
|
|
1261
|
+
_context6.prev = 1;
|
|
1324
1262
|
_loggerProxy.default.logger.info("HashTreeParser#performSync --> ".concat(this.debugId, " ").concat(reason, ", syncing data set \"").concat(dataSet.name, "\""));
|
|
1325
1263
|
mismatchedLeavesData = {};
|
|
1326
1264
|
if (!(dataSet.leafCount !== 1)) {
|
|
1327
|
-
|
|
1265
|
+
_context6.next = 7;
|
|
1328
1266
|
break;
|
|
1329
1267
|
}
|
|
1330
|
-
|
|
1331
|
-
|
|
1268
|
+
_context6.prev = 2;
|
|
1269
|
+
_context6.next = 3;
|
|
1332
1270
|
return this.getHashesFromLocus(dataSet.name, rootHash);
|
|
1333
1271
|
case 3:
|
|
1334
|
-
_yield$this$getHashes =
|
|
1272
|
+
_yield$this$getHashes = _context6.sent;
|
|
1335
1273
|
hashes = _yield$this$getHashes.hashes;
|
|
1336
1274
|
latestDataSetInfo = _yield$this$getHashes.dataSet;
|
|
1337
1275
|
receivedHashes = hashes;
|
|
1338
1276
|
dataSet.hashTree.resize(latestDataSetInfo.leafCount);
|
|
1339
|
-
|
|
1277
|
+
_context6.next = 6;
|
|
1340
1278
|
break;
|
|
1341
1279
|
case 4:
|
|
1342
|
-
|
|
1343
|
-
_t3 =
|
|
1280
|
+
_context6.prev = 4;
|
|
1281
|
+
_t3 = _context6["catch"](2);
|
|
1344
1282
|
if (!(_t3.statusCode === 409)) {
|
|
1345
|
-
|
|
1283
|
+
_context6.next = 5;
|
|
1346
1284
|
break;
|
|
1347
1285
|
}
|
|
1348
1286
|
// this is a leaf count mismatch, we should do nothing, just wait for another heartbeat message from Locus
|
|
1349
1287
|
_loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(this.debugId, " Got 409 when fetching hashes for data set \"").concat(dataSet.name, "\": ").concat(_t3.message));
|
|
1350
|
-
return
|
|
1288
|
+
return _context6.abrupt("return");
|
|
1351
1289
|
case 5:
|
|
1352
1290
|
throw _t3;
|
|
1353
1291
|
case 6:
|
|
@@ -1356,30 +1294,30 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1356
1294
|
mismatchedLeaveIndexes.forEach(function (index) {
|
|
1357
1295
|
mismatchedLeavesData[index] = dataSet.hashTree.getLeafData(index);
|
|
1358
1296
|
});
|
|
1359
|
-
|
|
1297
|
+
_context6.next = 8;
|
|
1360
1298
|
break;
|
|
1361
1299
|
case 7:
|
|
1362
1300
|
mismatchedLeavesData[0] = dataSet.hashTree.getLeafData(0);
|
|
1363
1301
|
case 8:
|
|
1364
1302
|
if (!((0, _keys.default)(mismatchedLeavesData).length > 0)) {
|
|
1365
|
-
|
|
1303
|
+
_context6.next = 10;
|
|
1366
1304
|
break;
|
|
1367
1305
|
}
|
|
1368
|
-
|
|
1306
|
+
_context6.next = 9;
|
|
1369
1307
|
return this.sendSyncRequestToLocus(dataSet, mismatchedLeavesData);
|
|
1370
1308
|
case 9:
|
|
1371
|
-
syncResponse =
|
|
1309
|
+
syncResponse = _context6.sent;
|
|
1372
1310
|
// sync API may return nothing (in that case data will arrive via messages)
|
|
1373
1311
|
// or it may return a response in the same format as messages
|
|
1374
1312
|
if (syncResponse) {
|
|
1375
1313
|
this.handleMessage(syncResponse, 'via sync API');
|
|
1376
1314
|
}
|
|
1377
1315
|
case 10:
|
|
1378
|
-
|
|
1316
|
+
_context6.next = 12;
|
|
1379
1317
|
break;
|
|
1380
1318
|
case 11:
|
|
1381
|
-
|
|
1382
|
-
_t4 =
|
|
1319
|
+
_context6.prev = 11;
|
|
1320
|
+
_t4 = _context6["catch"](1);
|
|
1383
1321
|
if (_t4 instanceof MeetingEndedError) {
|
|
1384
1322
|
this.callLocusInfoUpdateCallback({
|
|
1385
1323
|
updateType: LocusInfoUpdateType.MEETING_ENDED
|
|
@@ -1389,11 +1327,11 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1389
1327
|
}
|
|
1390
1328
|
case 12:
|
|
1391
1329
|
case "end":
|
|
1392
|
-
return
|
|
1330
|
+
return _context6.stop();
|
|
1393
1331
|
}
|
|
1394
|
-
},
|
|
1332
|
+
}, _callee5, this, [[1, 11], [2, 4]]);
|
|
1395
1333
|
}));
|
|
1396
|
-
function performSync(
|
|
1334
|
+
function performSync(_x6, _x7, _x8) {
|
|
1397
1335
|
return _performSync.apply(this, arguments);
|
|
1398
1336
|
}
|
|
1399
1337
|
return performSync;
|
|
@@ -1429,36 +1367,36 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1429
1367
|
clearTimeout(dataSet.timer);
|
|
1430
1368
|
}
|
|
1431
1369
|
_loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " setting \"").concat(dataSet.name, "\" sync timer for ").concat(delay));
|
|
1432
|
-
dataSet.timer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1370
|
+
dataSet.timer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1433
1371
|
var rootHash;
|
|
1434
|
-
return _regenerator.default.wrap(function (
|
|
1435
|
-
while (1) switch (
|
|
1372
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
1373
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1436
1374
|
case 0:
|
|
1437
1375
|
dataSet.timer = undefined;
|
|
1438
1376
|
if (dataSet.hashTree) {
|
|
1439
|
-
|
|
1377
|
+
_context7.next = 1;
|
|
1440
1378
|
break;
|
|
1441
1379
|
}
|
|
1442
1380
|
_loggerProxy.default.logger.warn("HashTreeParser#runSyncAlgorithm --> ".concat(_this11.debugId, " Data set \"").concat(dataSet.name, "\" no longer has a hash tree, cannot run sync algorithm"));
|
|
1443
|
-
return
|
|
1381
|
+
return _context7.abrupt("return");
|
|
1444
1382
|
case 1:
|
|
1445
1383
|
rootHash = dataSet.hashTree.getRootHash();
|
|
1446
1384
|
if (!(dataSet.root !== rootHash)) {
|
|
1447
|
-
|
|
1385
|
+
_context7.next = 3;
|
|
1448
1386
|
break;
|
|
1449
1387
|
}
|
|
1450
|
-
|
|
1388
|
+
_context7.next = 2;
|
|
1451
1389
|
return _this11.performSync(dataSet, rootHash, "Root hash mismatch: received=".concat(dataSet.root, ", ours=").concat(rootHash));
|
|
1452
1390
|
case 2:
|
|
1453
|
-
|
|
1391
|
+
_context7.next = 4;
|
|
1454
1392
|
break;
|
|
1455
1393
|
case 3:
|
|
1456
1394
|
_loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this11.debugId, " \"").concat(dataSet.name, "\" root hash matching: ").concat(rootHash, ", version=").concat(dataSet.version));
|
|
1457
1395
|
case 4:
|
|
1458
1396
|
case "end":
|
|
1459
|
-
return
|
|
1397
|
+
return _context7.stop();
|
|
1460
1398
|
}
|
|
1461
|
-
},
|
|
1399
|
+
}, _callee6);
|
|
1462
1400
|
})), delay);
|
|
1463
1401
|
} else {
|
|
1464
1402
|
_loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " No delay for \"").concat(dataSet.name, "\" data set, skipping sync timer reset/setup"));
|
|
@@ -1497,19 +1435,19 @@ var HashTreeParser = /*#__PURE__*/function () {
|
|
|
1497
1435
|
}
|
|
1498
1436
|
var backoffTime = _this12.getWeightedBackoffTime(dataSet.backoff);
|
|
1499
1437
|
var delay = _this12.heartbeatIntervalMs + backoffTime;
|
|
1500
|
-
dataSet.heartbeatWatchdogTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1501
|
-
return _regenerator.default.wrap(function (
|
|
1502
|
-
while (1) switch (
|
|
1438
|
+
dataSet.heartbeatWatchdogTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
1439
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
1440
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1503
1441
|
case 0:
|
|
1504
1442
|
dataSet.heartbeatWatchdogTimer = undefined;
|
|
1505
1443
|
_loggerProxy.default.logger.warn("HashTreeParser#resetHeartbeatWatchdogs --> ".concat(_this12.debugId, " Heartbeat watchdog fired for data set \"").concat(dataSet.name, "\" - no heartbeat received within expected interval, initiating sync"));
|
|
1506
|
-
|
|
1444
|
+
_context8.next = 1;
|
|
1507
1445
|
return _this12.performSync(dataSet, dataSet.hashTree.getRootHash(), "heartbeat watchdog expired");
|
|
1508
1446
|
case 1:
|
|
1509
1447
|
case "end":
|
|
1510
|
-
return
|
|
1448
|
+
return _context8.stop();
|
|
1511
1449
|
}
|
|
1512
|
-
},
|
|
1450
|
+
}, _callee7);
|
|
1513
1451
|
})), delay);
|
|
1514
1452
|
};
|
|
1515
1453
|
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|