@webex/plugin-meetings 3.9.0-webinar5k.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/constants.js +16 -0
  4. package/dist/constants.js.map +1 -1
  5. package/dist/interpretation/index.js +1 -1
  6. package/dist/interpretation/siLanguage.js +1 -1
  7. package/dist/locus-info/index.js +40 -328
  8. package/dist/locus-info/index.js.map +1 -1
  9. package/dist/meeting/in-meeting-actions.js +6 -0
  10. package/dist/meeting/in-meeting-actions.js.map +1 -1
  11. package/dist/meeting/index.js +196 -160
  12. package/dist/meeting/index.js.map +1 -1
  13. package/dist/meeting/muteState.js +5 -2
  14. package/dist/meeting/muteState.js.map +1 -1
  15. package/dist/meeting/type.js +7 -0
  16. package/dist/meeting/type.js.map +1 -0
  17. package/dist/meeting/util.js +79 -10
  18. package/dist/meeting/util.js.map +1 -1
  19. package/dist/meetings/index.js +37 -39
  20. package/dist/meetings/index.js.map +1 -1
  21. package/dist/member/types.js.map +1 -1
  22. package/dist/members/collection.js +0 -13
  23. package/dist/members/collection.js.map +1 -1
  24. package/dist/members/index.js +21 -40
  25. package/dist/members/index.js.map +1 -1
  26. package/dist/members/util.js.map +1 -1
  27. package/dist/multistream/mediaRequestManager.js +1 -1
  28. package/dist/multistream/mediaRequestManager.js.map +1 -1
  29. package/dist/multistream/remoteMedia.js +34 -5
  30. package/dist/multistream/remoteMedia.js.map +1 -1
  31. package/dist/multistream/remoteMediaGroup.js +42 -2
  32. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  33. package/dist/types/constants.d.ts +16 -0
  34. package/dist/types/locus-info/index.d.ts +3 -102
  35. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  36. package/dist/types/meeting/index.d.ts +23 -28
  37. package/dist/types/meeting/type.d.ts +9 -0
  38. package/dist/types/meeting/util.d.ts +6 -3
  39. package/dist/types/member/types.d.ts +0 -1
  40. package/dist/types/members/collection.d.ts +0 -6
  41. package/dist/types/members/index.d.ts +7 -16
  42. package/dist/types/members/util.d.ts +2 -1
  43. package/dist/types/multistream/remoteMedia.d.ts +20 -1
  44. package/dist/types/multistream/remoteMediaGroup.d.ts +11 -0
  45. package/dist/webinar/index.js +1 -1
  46. package/package.json +22 -24
  47. package/src/constants.ts +16 -2
  48. package/src/locus-info/index.ts +39 -409
  49. package/src/meeting/in-meeting-actions.ts +13 -0
  50. package/src/meeting/index.ts +92 -63
  51. package/src/meeting/muteState.ts +6 -2
  52. package/src/meeting/type.ts +9 -0
  53. package/src/meeting/util.ts +93 -19
  54. package/src/meetings/index.ts +6 -19
  55. package/src/member/types.ts +0 -1
  56. package/src/members/collection.ts +0 -11
  57. package/src/members/index.ts +10 -33
  58. package/src/members/util.ts +2 -1
  59. package/src/multistream/mediaRequestManager.ts +7 -7
  60. package/src/multistream/remoteMedia.ts +34 -4
  61. package/src/multistream/remoteMediaGroup.ts +37 -2
  62. package/test/unit/spec/locus-info/index.js +8 -365
  63. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  64. package/test/unit/spec/meeting/index.js +254 -38
  65. package/test/unit/spec/meeting/utils.js +122 -1
  66. package/test/unit/spec/meetings/index.js +2 -0
  67. package/test/unit/spec/members/index.js +37 -1
  68. package/test/unit/spec/multistream/mediaRequestManager.ts +19 -6
  69. package/test/unit/spec/multistream/remoteMedia.ts +66 -2
  70. package/dist/hashTree/constants.js +0 -23
  71. package/dist/hashTree/constants.js.map +0 -1
  72. package/dist/hashTree/hashTree.js +0 -516
  73. package/dist/hashTree/hashTree.js.map +0 -1
  74. package/dist/hashTree/hashTreeParser.js +0 -521
  75. package/dist/hashTree/hashTreeParser.js.map +0 -1
  76. package/dist/types/hashTree/constants.d.ts +0 -8
  77. package/dist/types/hashTree/hashTree.d.ts +0 -128
  78. package/dist/types/hashTree/hashTreeParser.d.ts +0 -152
  79. package/src/hashTree/constants.ts +0 -12
  80. package/src/hashTree/hashTree.ts +0 -460
  81. package/src/hashTree/hashTreeParser.ts +0 -556
  82. package/test/unit/spec/hashTree/hashTree.ts +0 -394
  83. package/test/unit/spec/hashTree/hashTreeParser.ts +0 -156
@@ -1,521 +0,0 @@
1
- "use strict";
2
-
3
- var _Array$from = require("@babel/runtime-corejs2/core-js/array/from");
4
- var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
5
- var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
6
- var _Array$isArray2 = require("@babel/runtime-corejs2/core-js/array/is-array");
7
- var _Object$keys3 = require("@babel/runtime-corejs2/core-js/object/keys");
8
- var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
9
- var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
10
- var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
11
- var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
12
- var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
13
- var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
14
- _Object$defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- exports.default = exports.ObjectType = exports.LocusInfoUpdateType = void 0;
18
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
19
- var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
20
- var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
21
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
22
- var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
23
- var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/parse-int"));
24
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
25
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
26
- var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/typeof"));
27
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
28
- var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
29
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
30
- var _lodash = require("lodash");
31
- var _hashTree = _interopRequireDefault(require("./hashTree"));
32
- var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
33
- var _constants = require("../constants");
34
- var _constants2 = require("./constants");
35
- function ownKeys(e, r) { var t = _Object$keys3(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
37
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
38
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
39
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
40
- // todo: Locus docs have now more types like CONTROL_ENTRY, EMBEDDED_APP, FULL_STATE, INFO, MEDIA_SHARE - need to add support for them once Locus implements them
41
- var ObjectType = exports.ObjectType = {
42
- participant: 'participant',
43
- self: 'self',
44
- locus: 'locus'
45
- };
46
- var LocusInfoUpdateType = exports.LocusInfoUpdateType = {
47
- OBJECTS_UPDATED: 'OBJECTS_UPDATED',
48
- MEETING_ENDED: 'MEETING_ENDED'
49
- };
50
- /**
51
- * Parses hash tree eventing locus data
52
- */
53
- var HashTreeParser = /*#__PURE__*/function () {
54
- /**
55
- * Constructor for HashTreeParser
56
- * @param {Object} options
57
- * @param {Object} options.initialLocus The initial locus data containing the hash tree information
58
- */
59
- function HashTreeParser(options) {
60
- (0, _classCallCheck2.default)(this, HashTreeParser);
61
- (0, _defineProperty2.default)(this, "dataSets", {});
62
- (0, _defineProperty2.default)(this, "webexRequest", void 0);
63
- (0, _defineProperty2.default)(this, "locusInfoUpdateCallback", void 0);
64
- (0, _defineProperty2.default)(this, "debugId", void 0);
65
- var _options$initialLocus = options.initialLocus,
66
- dataSets = _options$initialLocus.dataSets,
67
- locus = _options$initialLocus.locus; // extract dataSets from initialLocus
68
-
69
- this.debugId = options.debugId;
70
- this.webexRequest = options.webexRequest;
71
- this.locusInfoUpdateCallback = options.locusInfoUpdateCallback;
72
-
73
- // object mapping dataset names to arrays of leaf data
74
- var leafData = this.analyzeLocusHtMeta(locus);
75
- var _iterator = _createForOfIteratorHelper(dataSets),
76
- _step;
77
- try {
78
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
79
- var dataSet = _step.value;
80
- var name = dataSet.name,
81
- leafCount = dataSet.leafCount;
82
- var hashTree = new _hashTree.default(leafData[name] || [], leafCount);
83
- this.dataSets[name] = _objectSpread(_objectSpread({}, dataSet), {}, {
84
- hashTree: hashTree
85
- });
86
- }
87
- } catch (err) {
88
- _iterator.e(err);
89
- } finally {
90
- _iterator.f();
91
- }
92
- }
93
-
94
- /**
95
- * Each dataset exists at a different place in the dto
96
- * iterate recursively over the locus and if it has a htMeta key,
97
- * create an object with the type, id and version and add it to the appropriate leafData array
98
- *
99
- * @param {any} locus - The current part of the locus being processed
100
- * @returns {any} - An object mapping dataset names to arrays of leaf data
101
- */
102
- (0, _createClass2.default)(HashTreeParser, [{
103
- key: "analyzeLocusHtMeta",
104
- value: function analyzeLocusHtMeta(locus) {
105
- // object mapping dataset names to arrays of leaf data
106
- var leafData = {};
107
- var findAndStoreMetaData = function findAndStoreMetaData(currentLocusPart) {
108
- if ((0, _typeof2.default)(currentLocusPart) !== 'object' || currentLocusPart === null) {
109
- return;
110
- }
111
- if (currentLocusPart.htMeta && currentLocusPart.htMeta.dataSetNames) {
112
- var _currentLocusPart$htM = currentLocusPart.htMeta.elementId,
113
- type = _currentLocusPart$htM.type,
114
- id = _currentLocusPart$htM.id,
115
- version = _currentLocusPart$htM.version;
116
- var dataSetNames = currentLocusPart.htMeta.dataSetNames;
117
- var leafInfo = {
118
- type: type,
119
- id: id,
120
- version: version
121
- };
122
- var _iterator2 = _createForOfIteratorHelper(dataSetNames),
123
- _step2;
124
- try {
125
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
126
- var dataSetName = _step2.value;
127
- if (!leafData[dataSetName]) {
128
- leafData[dataSetName] = [];
129
- }
130
- leafData[dataSetName].push(leafInfo);
131
- }
132
- } catch (err) {
133
- _iterator2.e(err);
134
- } finally {
135
- _iterator2.f();
136
- }
137
- }
138
- if ((0, _isArray.default)(currentLocusPart)) {
139
- var _iterator3 = _createForOfIteratorHelper(currentLocusPart),
140
- _step3;
141
- try {
142
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
143
- var item = _step3.value;
144
- findAndStoreMetaData(item);
145
- }
146
- } catch (err) {
147
- _iterator3.e(err);
148
- } finally {
149
- _iterator3.f();
150
- }
151
- } else {
152
- for (var _i = 0, _Object$keys = (0, _keys.default)(currentLocusPart); _i < _Object$keys.length; _i++) {
153
- var key = _Object$keys[_i];
154
- if (Object.prototype.hasOwnProperty.call(currentLocusPart, key)) {
155
- findAndStoreMetaData(currentLocusPart[key]);
156
- }
157
- }
158
- }
159
- };
160
- findAndStoreMetaData(locus);
161
- return leafData;
162
- }
163
-
164
- /**
165
- * Checks if the provided hash tree message indicates the end of the meeting and that there won't be any more updates.
166
- *
167
- * @param {HashTreeMessage} message - The hash tree message to check
168
- * @returns {boolean} - Returns true if the message indicates the end of the meeting, false otherwise
169
- */
170
- }, {
171
- key: "isEndMessage",
172
- value: function isEndMessage(message) {
173
- var mainDataSet = message.dataSets.find(function (dataSet) {
174
- return dataSet.name.toLowerCase() === _constants2.DataSetNames.MAIN;
175
- });
176
- if (mainDataSet && mainDataSet.leafCount === 1 && mainDataSet.root === _constants2.EMPTY_HASH && this.dataSets[_constants2.DataSetNames.MAIN].version < mainDataSet.version) {
177
- // this is a special way for Locus to indicate that this meeting has ended
178
- return true;
179
- }
180
- return false;
181
- }
182
-
183
- /**
184
- * Handles the root hash heartbeat message
185
- *
186
- * @param {RootHashMessage} message - The root hash heartbeat message
187
- * @returns {void}
188
- */
189
- }, {
190
- key: "handleRootHashHeartBeatMessage",
191
- value: function handleRootHashHeartBeatMessage(message) {
192
- var _this = this;
193
- var dataSets = message.dataSets;
194
- _loggerProxy.default.logger.info("HashTreeParser#handleRootHashMessage --> ".concat(this.debugId, " Received heartbeat root hash message with data sets: ").concat((0, _stringify.default)(dataSets.map(function (_ref) {
195
- var name = _ref.name,
196
- root = _ref.root,
197
- leafCount = _ref.leafCount,
198
- version = _ref.version;
199
- return {
200
- name: name,
201
- root: root,
202
- leafCount: leafCount,
203
- version: version
204
- };
205
- }))));
206
- dataSets.forEach(function (dataSet) {
207
- _this.runSyncAlgorithm(dataSet);
208
- });
209
- }
210
-
211
- /**
212
- * This method should be called when we receive a partial locus DTO that contains dataSets and htMeta information
213
- * It updates the hash trees with the new leaf data based on the received Locus
214
- *
215
- * @param {Object} update - The locus update containing data sets and locus information
216
- * @returns {void}
217
- */
218
- }, {
219
- key: "handleLocusUpdate",
220
- value: function handleLocusUpdate(update) {
221
- var _this2 = this;
222
- var dataSets = update.dataSets,
223
- locus = update.locus;
224
- if (!dataSets) {
225
- _loggerProxy.default.logger.warn("HashTreeParser#handleLocusUpdate --> ".concat(this.debugId, " received hash tree update without dataSets, ignoring"));
226
- }
227
- var leafData = this.analyzeLocusHtMeta(locus);
228
- (0, _keys.default)(leafData).forEach(function (dataSetName) {
229
- _this2.dataSets[dataSetName].hashTree.putItems(leafData[dataSetName]);
230
- });
231
- }
232
-
233
- /**
234
- * Handles incoming hash tree messages, updates the hash trees and calls locusInfoUpdateCallback
235
- *
236
- * @param {HashTreeMessage} message - The hash tree message containing data sets and objects to be processed
237
- * @returns {void}
238
- */
239
- }, {
240
- key: "handleMessage",
241
- value: function handleMessage(message) {
242
- var _this3 = this;
243
- var dataSets = message.dataSets;
244
- _loggerProxy.default.logger.info("HashTreeParser#handleMessage --> ".concat(this.debugId, " received message:"), message);
245
- if (this.isEndMessage(message)) {
246
- _loggerProxy.default.logger.info("HashTreeParser#handleMessage --> ".concat(this.debugId, " received END message"));
247
- this.stopAllTimers();
248
- this.locusInfoUpdateCallback(LocusInfoUpdateType.MEETING_ENDED);
249
- } else {
250
- var updatedObjects = [];
251
- dataSets.forEach(function (dataSet) {
252
- if (_this3.dataSets[dataSet.name]) {
253
- var hashTree = _this3.dataSets[dataSet.name].hashTree;
254
- if (hashTree) {
255
- var locusStateElementsForThisSet = message.locusStateElements.filter(function (object) {
256
- return object.htMeta.dataSetNames.includes(dataSet.name);
257
- });
258
- var appliedChangesList = hashTree.updateItems(locusStateElementsForThisSet.map(function (object) {
259
- return object.data ? {
260
- operation: 'update',
261
- item: object.htMeta.elementId
262
- } : {
263
- operation: 'remove',
264
- item: object.htMeta.elementId
265
- };
266
- }));
267
- (0, _lodash.zip)(appliedChangesList, locusStateElementsForThisSet).forEach(function (_ref2) {
268
- var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
269
- changeApplied = _ref3[0],
270
- object = _ref3[1];
271
- if (changeApplied) {
272
- // update the locus with the new object
273
- updatedObjects.push(object);
274
- }
275
- });
276
- } else {
277
- _loggerProxy.default.logger.warn("Locus-info:index#handleHashTreeMessage --> ".concat(_this3.debugId, " unsupported dataSet ").concat(dataSet.name, " received in hash tree message"));
278
- }
279
-
280
- // update our version of the dataSet
281
- if (_this3.dataSets[dataSet.name].version < dataSet.version) {
282
- _this3.dataSets[dataSet.name].version = dataSet.version;
283
- _this3.dataSets[dataSet.name].root = dataSet.root;
284
- _this3.dataSets[dataSet.name].idleMs = dataSet.idleMs;
285
- _this3.dataSets[dataSet.name].backoff = {
286
- maxMs: dataSet.backoff.maxMs,
287
- exponent: dataSet.backoff.exponent
288
- };
289
- _loggerProxy.default.logger.info("HashTreeParser#handleMessage --> ".concat(_this3.debugId, " updated \"").concat(dataSet.name, "\" to version=").concat(dataSet.version, ", root=").concat(dataSet.root));
290
- }
291
- _this3.runSyncAlgorithm(dataSet);
292
- }
293
- });
294
- if (updatedObjects.length > 0) {
295
- this.locusInfoUpdateCallback(LocusInfoUpdateType.OBJECTS_UPDATED, {
296
- updatedObjects: updatedObjects
297
- });
298
- } else {
299
- _loggerProxy.default.logger.info("HashTreeParser#handleMessage --> ".concat(this.debugId, " No objects updated as a result of received message"));
300
- }
301
- }
302
- }
303
-
304
- /**
305
- * Calculates a weighted backoff time that should be used for syncs
306
- *
307
- * @param {Object} backoff - The backoff configuration containing maxMs and exponent
308
- * @returns {number} - A weighted backoff time based on the provided configuration, using algorithm supplied by Locus team
309
- */
310
- }, {
311
- key: "getWeightedBackoffTime",
312
- value: function getWeightedBackoffTime(backoff) {
313
- var maxMs = backoff.maxMs,
314
- exponent = backoff.exponent;
315
- var randomValue = Math.random();
316
- return Math.round(Math.pow(randomValue, exponent) * maxMs);
317
- }
318
-
319
- /**
320
- * Runs the sync algorithm for the given data set.
321
- *
322
- * @param {DataSet} receivedDataSet - The data set to run the sync algorithm for.
323
- * @returns {void}
324
- */
325
- }, {
326
- key: "runSyncAlgorithm",
327
- value: function runSyncAlgorithm(receivedDataSet) {
328
- var _this4 = this;
329
- var dataSet = this.dataSets[receivedDataSet.name];
330
- if (!dataSet) {
331
- _loggerProxy.default.logger.warn("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " No data set found for ").concat(receivedDataSet.name, ", skipping sync algorithm"));
332
- return;
333
- }
334
- dataSet.hashTree.resize(receivedDataSet.leafCount);
335
-
336
- // temporary log for the workshop // todo: remove
337
- var ourCurrentRootHash = dataSet.hashTree.getRootHash();
338
- _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " dataSet=\"").concat(dataSet.name, "\" version=").concat(dataSet.version, " hashes before starting timer: ours=").concat(ourCurrentRootHash, " Locus=").concat(dataSet.root));
339
- var delay = dataSet.idleMs + this.getWeightedBackoffTime(dataSet.backoff);
340
- if (delay > 0) {
341
- if (dataSet.timer) {
342
- clearTimeout(dataSet.timer);
343
- }
344
- _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " setting \"").concat(dataSet.name, "\" sync timer for ").concat(delay));
345
- dataSet.timer = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
346
- var rootHash, mismatchedLeavesData, receivedHashes, mismatchedLeaveIndexes, updatedObjects;
347
- return _regenerator.default.wrap(function _callee$(_context) {
348
- while (1) switch (_context.prev = _context.next) {
349
- case 0:
350
- _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this4.debugId, " Sync timer fired for \"").concat(dataSet.name, "\" data set"));
351
- dataSet.timer = undefined;
352
- rootHash = dataSet.hashTree.getRootHash();
353
- if (!(dataSet.root !== rootHash)) {
354
- _context.next = 31;
355
- break;
356
- }
357
- _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this4.debugId, " Root hash mismatch: received=").concat(dataSet.root, ", ours=").concat(rootHash, ", syncing data set \"").concat(dataSet.name, "\""));
358
- mismatchedLeavesData = {};
359
- if (!(dataSet.leafCount !== 1)) {
360
- _context.next = 23;
361
- break;
362
- }
363
- _context.prev = 7;
364
- _context.next = 10;
365
- return _this4.getHashesFromLocus(dataSet.name);
366
- case 10:
367
- receivedHashes = _context.sent;
368
- _context.next = 19;
369
- break;
370
- case 13:
371
- _context.prev = 13;
372
- _context.t0 = _context["catch"](7);
373
- if (!(_context.t0.statusCode === 409)) {
374
- _context.next = 18;
375
- break;
376
- }
377
- // this is a leaf count mismatch, we should do nothing, just wait for another heartbeat message from Locus
378
- _loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(_this4.debugId, " Got 409 when fetching hashes for data set \"").concat(dataSet.name, "\": ").concat(_context.t0.message));
379
- return _context.abrupt("return");
380
- case 18:
381
- throw _context.t0;
382
- case 19:
383
- // identify mismatched leaves
384
- mismatchedLeaveIndexes = dataSet.hashTree.diffHashes(receivedHashes);
385
- mismatchedLeaveIndexes.forEach(function (index) {
386
- mismatchedLeavesData[index] = dataSet.hashTree.getLeafData(index);
387
- });
388
- _context.next = 24;
389
- break;
390
- case 23:
391
- mismatchedLeavesData[0] = dataSet.hashTree.getLeafData(0);
392
- case 24:
393
- if (!((0, _keys.default)(mismatchedLeavesData).length > 0)) {
394
- _context.next = 29;
395
- break;
396
- }
397
- _context.next = 27;
398
- return _this4.sendSyncRequestToLocus(dataSet, mismatchedLeavesData);
399
- case 27:
400
- updatedObjects = _context.sent;
401
- if (updatedObjects.length > 0) {
402
- _this4.locusInfoUpdateCallback(LocusInfoUpdateType.OBJECTS_UPDATED, {
403
- updatedObjects: updatedObjects
404
- });
405
- }
406
- case 29:
407
- _context.next = 32;
408
- break;
409
- case 31:
410
- _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this4.debugId, " \"").concat(dataSet.name, "\" root hash matching: ").concat(rootHash, ", version=").concat(dataSet.version));
411
- case 32:
412
- case "end":
413
- return _context.stop();
414
- }
415
- }, _callee, null, [[7, 13]]);
416
- })), delay);
417
- } else {
418
- _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " No delay for \"").concat(dataSet.name, "\" data set, skipping sync timer reset/setup"));
419
- }
420
- }
421
-
422
- /**
423
- * Stops all timers for the data sets to prevent any further sync attempts.
424
- * @returns {void}
425
- */
426
- }, {
427
- key: "stopAllTimers",
428
- value: function stopAllTimers() {
429
- (0, _values.default)(this.dataSets).forEach(function (dataSet) {
430
- if (dataSet.timer) {
431
- clearTimeout(dataSet.timer);
432
- dataSet.timer = undefined;
433
- }
434
- });
435
- }
436
-
437
- /**
438
- * Gets the current hashes from the locus for a specific data set.
439
- * @param {string} dataSetName
440
- * @returns {string[]}
441
- */
442
- }, {
443
- key: "getHashesFromLocus",
444
- value: function getHashesFromLocus(dataSetName) {
445
- var _this5 = this;
446
- _loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(this.debugId, " Requesting hashes for data set \"").concat(dataSetName, "\""));
447
- var dataSet = this.dataSets[dataSetName];
448
- var url = "".concat(dataSet.url, "/hashtree");
449
- return this.webexRequest({
450
- method: _constants.HTTP_VERBS.GET,
451
- uri: url
452
- }).then(function (response) {
453
- var _response$body;
454
- var hashes = (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.hashes;
455
- if (!hashes || !(0, _isArray.default)(hashes)) {
456
- _loggerProxy.default.logger.warn("HashTreeParser#getHashesFromLocus --> ".concat(_this5.debugId, " Locus returned invalid hashes, response body="), response.body);
457
- throw new Error("Locus returned invalid hashes: ".concat(hashes));
458
- }
459
- _loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(_this5.debugId, " Received hashes for data set \"").concat(dataSetName, "\": ").concat((0, _stringify.default)(hashes)));
460
- return hashes;
461
- }).catch(function (error) {
462
- _loggerProxy.default.logger.error("HashTreeParser#getHashesFromLocus --> ".concat(_this5.debugId, " Error ").concat(error.statusCode, " fetching hashes for data set \"").concat(dataSetName, "\":"), error);
463
- throw error;
464
- });
465
- }
466
-
467
- /**
468
- * Sends a sync request to Locus for the specified data set.
469
- *
470
- * @param {InternalDataSet} dataSet The data set to sync.
471
- * @param {Record<number, LeafDataItem[]>} mismatchedLeavesData The mismatched leaves data to include in the sync request.
472
- * @returns {Promise<HashTreeObject[]>}
473
- */
474
- }, {
475
- key: "sendSyncRequestToLocus",
476
- value: function sendSyncRequestToLocus(dataSet, mismatchedLeavesData) {
477
- var _this6 = this;
478
- _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(this.debugId, " Sending sync request for data set \"").concat(dataSet.name, "\""));
479
- var url = "".concat(dataSet.url, "/sync");
480
- var body = {
481
- dataSet: {
482
- name: dataSet.name,
483
- leafCount: dataSet.leafCount,
484
- root: dataSet.hashTree.getRootHash() // todo: avoid recalculation
485
- },
486
-
487
- leafDataEntries: []
488
- };
489
- (0, _keys.default)(mismatchedLeavesData).forEach(function (index) {
490
- body.leafDataEntries.push({
491
- leafIndex: (0, _parseInt2.default)(index, 10),
492
- elementIds: mismatchedLeavesData[index]
493
- });
494
- });
495
- return this.webexRequest({
496
- method: _constants.HTTP_VERBS.POST,
497
- uri: url,
498
- body: body
499
- }).then(function (resp) {
500
- var _resp$body;
501
- _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this6.debugId, " Sync request succeeded for \"").concat(dataSet.name, "\""));
502
-
503
- // todo: handle response body (it may be there or not)
504
- if (resp.statusCode === 202) {
505
- _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this6.debugId, " Got 202 for sync request for data set \"").concat(dataSet.name, "\", data should arrive via messages"));
506
- }
507
- var updatedObjects = ((_resp$body = resp.body) === null || _resp$body === void 0 ? void 0 : _resp$body.objects) || [];
508
- if (updatedObjects.length !== body.leafDataEntries.length) {
509
- _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this6.debugId, " Sync request sent for \"").concat(dataSet.name, "\" with ").concat(body.leafDataEntries.length, " entries, but got ").concat(updatedObjects.length, " objects in response (statusCode=").concat(resp.statusCode, ")"));
510
- }
511
- return updatedObjects;
512
- }).catch(function (error) {
513
- _loggerProxy.default.logger.error("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this6.debugId, " Error ").concat(error.statusCode, " sending sync request for data set \"").concat(dataSet.name, "\":"), error);
514
- throw error;
515
- });
516
- }
517
- }]);
518
- return HashTreeParser;
519
- }();
520
- var _default = exports.default = HashTreeParser;
521
- //# sourceMappingURL=hashTreeParser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_lodash","require","_hashTree","_interopRequireDefault","_loggerProxy","_constants","_constants2","ownKeys","e","r","t","_Object$keys3","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","_createForOfIteratorHelper","allowArrayLike","it","_Symbol","_Symbol$iterator","_Array$isArray2","_unsupportedIterableToArray","i","F","s","n","done","value","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","prototype","toString","slice","constructor","name","_Array$from","test","arr","len","arr2","Array","ObjectType","exports","participant","self","locus","LocusInfoUpdateType","OBJECTS_UPDATED","MEETING_ENDED","HashTreeParser","options","_classCallCheck2","_options$initialLocus","initialLocus","dataSets","debugId","webexRequest","locusInfoUpdateCallback","leafData","analyzeLocusHtMeta","_iterator","_step","dataSet","leafCount","hashTree","HashTree","_createClass2","key","findAndStoreMetaData","currentLocusPart","_typeof2","htMeta","dataSetNames","_currentLocusPart$htM","elementId","type","id","version","leafInfo","_iterator2","_step2","dataSetName","_isArray","_iterator3","_step3","item","_i","_Object$keys","_keys","hasOwnProperty","isEndMessage","message","mainDataSet","find","toLowerCase","DataSetNames","MAIN","root","EMPTY_HASH","handleRootHashHeartBeatMessage","_this","LoggerProxy","logger","info","concat","_stringify","map","_ref","runSyncAlgorithm","handleLocusUpdate","update","_this2","warn","putItems","handleMessage","_this3","stopAllTimers","updatedObjects","locusStateElementsForThisSet","locusStateElements","object","includes","appliedChangesList","updateItems","data","operation","zip","_ref2","_ref3","_slicedToArray2","changeApplied","idleMs","backoff","maxMs","exponent","getWeightedBackoffTime","randomValue","Math","random","round","pow","receivedDataSet","_this4","resize","ourCurrentRootHash","getRootHash","delay","timer","clearTimeout","setTimeout","_asyncToGenerator2","_regenerator","mark","_callee","rootHash","mismatchedLeavesData","receivedHashes","mismatchedLeaveIndexes","wrap","_callee$","_context","prev","undefined","getHashesFromLocus","sent","t0","statusCode","abrupt","diffHashes","index","getLeafData","sendSyncRequestToLocus","stop","_values","_this5","url","method","HTTP_VERBS","GET","uri","then","response","_response$body","hashes","body","Error","catch","error","_this6","leafDataEntries","leafIndex","_parseInt2","elementIds","POST","resp","_resp$body","objects","_default"],"sources":["hashTreeParser.ts"],"sourcesContent":["import {zip} from 'lodash';\nimport HashTree, {LeafDataItem} from './hashTree';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {Enum, HTTP_VERBS} from '../constants';\nimport {DataSetNames, EMPTY_HASH} from './constants';\n\nexport interface DataSet {\n url: string;\n root: string;\n version: number;\n leafCount: number;\n name: string;\n idleMs: number;\n backoff: {\n maxMs: number;\n exponent: number;\n };\n}\n\n// todo: Locus docs have now more types like CONTROL_ENTRY, EMBEDDED_APP, FULL_STATE, INFO, MEDIA_SHARE - need to add support for them once Locus implements them\nexport const ObjectType = {\n participant: 'participant',\n self: 'self',\n locus: 'locus',\n} as const;\n\nexport type ObjectType = Enum<typeof ObjectType>;\n\nexport interface HtMeta {\n elementId: {\n type: ObjectType;\n id: number;\n version: number;\n };\n dataSetNames: string[];\n}\nexport interface HashTreeObject {\n htMeta: HtMeta;\n data: Record<string, any>;\n}\n\nexport interface RootHashMessage {\n dataSets: Array<DataSet>;\n}\nexport interface HashTreeMessage {\n dataSets: Array<DataSet>;\n locusStateElements?: Array<HashTreeObject>;\n locusSessionId?: string;\n locusUrl?: string;\n}\n\ninterface InternalDataSet extends DataSet {\n hashTree: HashTree;\n timer?: ReturnType<typeof setTimeout>;\n}\n\ntype WebexRequestMethod = (options: Record<string, any>) => Promise<any>;\n\nexport const LocusInfoUpdateType = {\n OBJECTS_UPDATED: 'OBJECTS_UPDATED',\n MEETING_ENDED: 'MEETING_ENDED',\n} as const;\n\nexport type LocusInfoUpdateType = Enum<typeof LocusInfoUpdateType>;\nexport type LocusInfoUpdateCallback = (\n updateType: LocusInfoUpdateType,\n data?: {updatedObjects: HashTreeObject[]}\n) => void;\n/**\n * Parses hash tree eventing locus data\n */\nclass HashTreeParser {\n dataSets: Record<string, InternalDataSet> = {};\n webexRequest: WebexRequestMethod;\n locusInfoUpdateCallback: LocusInfoUpdateCallback;\n debugId: string;\n\n /**\n * Constructor for HashTreeParser\n * @param {Object} options\n * @param {Object} options.initialLocus The initial locus data containing the hash tree information\n */\n constructor(options: {\n initialLocus: {\n dataSets: Array<DataSet>;\n locus: any;\n };\n webexRequest: WebexRequestMethod;\n locusInfoUpdateCallback: LocusInfoUpdateCallback;\n debugId: string;\n }) {\n const {dataSets, locus} = options.initialLocus; // extract dataSets from initialLocus\n\n this.debugId = options.debugId;\n this.webexRequest = options.webexRequest;\n this.locusInfoUpdateCallback = options.locusInfoUpdateCallback;\n\n // object mapping dataset names to arrays of leaf data\n const leafData = this.analyzeLocusHtMeta(locus);\n\n for (const dataSet of dataSets) {\n const {name, leafCount} = dataSet;\n\n const hashTree = new HashTree(leafData[name] || [], leafCount);\n\n this.dataSets[name] = {\n ...dataSet,\n hashTree,\n };\n }\n }\n\n /**\n * Each dataset exists at a different place in the dto\n * iterate recursively over the locus and if it has a htMeta key,\n * create an object with the type, id and version and add it to the appropriate leafData array\n *\n * @param {any} locus - The current part of the locus being processed\n * @returns {any} - An object mapping dataset names to arrays of leaf data\n */\n private analyzeLocusHtMeta(locus: any) {\n // object mapping dataset names to arrays of leaf data\n const leafData: Record<string, Array<{type: string; id: number; version: number}>> = {};\n\n const findAndStoreMetaData = (currentLocusPart: any) => {\n if (typeof currentLocusPart !== 'object' || currentLocusPart === null) {\n return;\n }\n\n if (currentLocusPart.htMeta && currentLocusPart.htMeta.dataSetNames) {\n const {type, id, version} = currentLocusPart.htMeta.elementId;\n const {dataSetNames} = currentLocusPart.htMeta;\n const leafInfo = {type, id, version};\n\n for (const dataSetName of dataSetNames) {\n if (!leafData[dataSetName]) {\n leafData[dataSetName] = [];\n }\n leafData[dataSetName].push(leafInfo);\n }\n }\n\n if (Array.isArray(currentLocusPart)) {\n for (const item of currentLocusPart) {\n findAndStoreMetaData(item);\n }\n } else {\n for (const key of Object.keys(currentLocusPart)) {\n if (Object.prototype.hasOwnProperty.call(currentLocusPart, key)) {\n findAndStoreMetaData(currentLocusPart[key]);\n }\n }\n }\n };\n\n findAndStoreMetaData(locus);\n\n return leafData;\n }\n\n /**\n * Checks if the provided hash tree message indicates the end of the meeting and that there won't be any more updates.\n *\n * @param {HashTreeMessage} message - The hash tree message to check\n * @returns {boolean} - Returns true if the message indicates the end of the meeting, false otherwise\n */\n private isEndMessage(message: HashTreeMessage) {\n const mainDataSet = message.dataSets.find(\n (dataSet) => dataSet.name.toLowerCase() === DataSetNames.MAIN\n );\n\n if (\n mainDataSet &&\n mainDataSet.leafCount === 1 &&\n mainDataSet.root === EMPTY_HASH &&\n this.dataSets[DataSetNames.MAIN].version < mainDataSet.version\n ) {\n // this is a special way for Locus to indicate that this meeting has ended\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles the root hash heartbeat message\n *\n * @param {RootHashMessage} message - The root hash heartbeat message\n * @returns {void}\n */\n handleRootHashHeartBeatMessage(message: RootHashMessage): void {\n const {dataSets} = message;\n\n LoggerProxy.logger.info(\n `HashTreeParser#handleRootHashMessage --> ${\n this.debugId\n } Received heartbeat root hash message with data sets: ${JSON.stringify(\n dataSets.map(({name, root, leafCount, version}) => ({\n name,\n root,\n leafCount,\n version,\n }))\n )}`\n );\n dataSets.forEach((dataSet) => {\n this.runSyncAlgorithm(dataSet);\n });\n }\n\n /**\n * This method should be called when we receive a partial locus DTO that contains dataSets and htMeta information\n * It updates the hash trees with the new leaf data based on the received Locus\n *\n * @param {Object} update - The locus update containing data sets and locus information\n * @returns {void}\n */\n handleLocusUpdate(update: {dataSets?: Array<DataSet>; locus: any}): void {\n const {dataSets, locus} = update;\n\n if (!dataSets) {\n LoggerProxy.logger.warn(\n `HashTreeParser#handleLocusUpdate --> ${this.debugId} received hash tree update without dataSets, ignoring`\n );\n }\n\n const leafData = this.analyzeLocusHtMeta(locus);\n\n Object.keys(leafData).forEach((dataSetName) => {\n this.dataSets[dataSetName].hashTree.putItems(leafData[dataSetName]);\n });\n }\n\n /**\n * Handles incoming hash tree messages, updates the hash trees and calls locusInfoUpdateCallback\n *\n * @param {HashTreeMessage} message - The hash tree message containing data sets and objects to be processed\n * @returns {void}\n */\n handleMessage(message: HashTreeMessage): void {\n const {dataSets} = message;\n\n LoggerProxy.logger.info(\n `HashTreeParser#handleMessage --> ${this.debugId} received message:`,\n message\n );\n if (this.isEndMessage(message)) {\n LoggerProxy.logger.info(\n `HashTreeParser#handleMessage --> ${this.debugId} received END message`\n );\n this.stopAllTimers();\n this.locusInfoUpdateCallback(LocusInfoUpdateType.MEETING_ENDED);\n } else {\n const updatedObjects: HashTreeObject[] = [];\n\n dataSets.forEach((dataSet) => {\n if (this.dataSets[dataSet.name]) {\n const {hashTree} = this.dataSets[dataSet.name];\n\n if (hashTree) {\n const locusStateElementsForThisSet = message.locusStateElements.filter((object) =>\n object.htMeta.dataSetNames.includes(dataSet.name)\n );\n\n const appliedChangesList = hashTree.updateItems(\n locusStateElementsForThisSet.map((object) =>\n object.data\n ? {operation: 'update', item: object.htMeta.elementId}\n : {operation: 'remove', item: object.htMeta.elementId}\n )\n );\n\n zip(appliedChangesList, locusStateElementsForThisSet).forEach(\n ([changeApplied, object]) => {\n if (changeApplied) {\n // update the locus with the new object\n updatedObjects.push(object);\n }\n }\n );\n } else {\n LoggerProxy.logger.warn(\n `Locus-info:index#handleHashTreeMessage --> ${this.debugId} unsupported dataSet ${dataSet.name} received in hash tree message`\n );\n }\n\n // update our version of the dataSet\n if (this.dataSets[dataSet.name].version < dataSet.version) {\n this.dataSets[dataSet.name].version = dataSet.version;\n this.dataSets[dataSet.name].root = dataSet.root;\n this.dataSets[dataSet.name].idleMs = dataSet.idleMs;\n this.dataSets[dataSet.name].backoff = {\n maxMs: dataSet.backoff.maxMs,\n exponent: dataSet.backoff.exponent,\n };\n LoggerProxy.logger.info(\n `HashTreeParser#handleMessage --> ${this.debugId} updated \"${dataSet.name}\" to version=${dataSet.version}, root=${dataSet.root}`\n );\n }\n\n this.runSyncAlgorithm(dataSet);\n }\n });\n\n if (updatedObjects.length > 0) {\n this.locusInfoUpdateCallback(LocusInfoUpdateType.OBJECTS_UPDATED, {updatedObjects});\n } else {\n LoggerProxy.logger.info(\n `HashTreeParser#handleMessage --> ${this.debugId} No objects updated as a result of received message`\n );\n }\n }\n }\n\n /**\n * Calculates a weighted backoff time that should be used for syncs\n *\n * @param {Object} backoff - The backoff configuration containing maxMs and exponent\n * @returns {number} - A weighted backoff time based on the provided configuration, using algorithm supplied by Locus team\n */\n private getWeightedBackoffTime(backoff: {maxMs: number; exponent: number}): number {\n const {maxMs, exponent} = backoff;\n\n const randomValue = Math.random();\n\n return Math.round(randomValue ** exponent * maxMs);\n }\n\n /**\n * Runs the sync algorithm for the given data set.\n *\n * @param {DataSet} receivedDataSet - The data set to run the sync algorithm for.\n * @returns {void}\n */\n private runSyncAlgorithm(receivedDataSet: DataSet) {\n const dataSet = this.dataSets[receivedDataSet.name];\n\n if (!dataSet) {\n LoggerProxy.logger.warn(\n `HashTreeParser#runSyncAlgorithm --> ${this.debugId} No data set found for ${receivedDataSet.name}, skipping sync algorithm`\n );\n\n return;\n }\n\n dataSet.hashTree.resize(receivedDataSet.leafCount);\n\n // temporary log for the workshop // todo: remove\n const ourCurrentRootHash = dataSet.hashTree.getRootHash();\n LoggerProxy.logger.info(\n `HashTreeParser#runSyncAlgorithm --> ${this.debugId} dataSet=\"${dataSet.name}\" version=${dataSet.version} hashes before starting timer: ours=${ourCurrentRootHash} Locus=${dataSet.root}`\n );\n\n const delay = dataSet.idleMs + this.getWeightedBackoffTime(dataSet.backoff);\n\n if (delay > 0) {\n if (dataSet.timer) {\n clearTimeout(dataSet.timer);\n }\n\n LoggerProxy.logger.info(\n `HashTreeParser#runSyncAlgorithm --> ${this.debugId} setting \"${dataSet.name}\" sync timer for ${delay}`\n );\n\n dataSet.timer = setTimeout(async () => {\n LoggerProxy.logger.info(\n `HashTreeParser#runSyncAlgorithm --> ${this.debugId} Sync timer fired for \"${dataSet.name}\" data set`\n );\n\n dataSet.timer = undefined;\n\n const rootHash = dataSet.hashTree.getRootHash();\n\n if (dataSet.root !== rootHash) {\n LoggerProxy.logger.info(\n `HashTreeParser#runSyncAlgorithm --> ${this.debugId} Root hash mismatch: received=${dataSet.root}, ours=${rootHash}, syncing data set \"${dataSet.name}\"`\n );\n\n const mismatchedLeavesData: Record<number, LeafDataItem[]> = {};\n\n if (dataSet.leafCount !== 1) {\n let receivedHashes;\n\n try {\n // request hashes from sender\n receivedHashes = await this.getHashesFromLocus(dataSet.name);\n } catch (error) {\n if (error.statusCode === 409) {\n // this is a leaf count mismatch, we should do nothing, just wait for another heartbeat message from Locus\n LoggerProxy.logger.info(\n `HashTreeParser#getHashesFromLocus --> ${this.debugId} Got 409 when fetching hashes for data set \"${dataSet.name}\": ${error.message}`\n );\n\n return;\n }\n throw error;\n }\n\n // identify mismatched leaves\n const mismatchedLeaveIndexes = dataSet.hashTree.diffHashes(receivedHashes);\n\n mismatchedLeaveIndexes.forEach((index) => {\n mismatchedLeavesData[index] = dataSet.hashTree.getLeafData(index);\n });\n } else {\n mismatchedLeavesData[0] = dataSet.hashTree.getLeafData(0);\n }\n // request sync for mismatched leaves\n if (Object.keys(mismatchedLeavesData).length > 0) {\n const updatedObjects = await this.sendSyncRequestToLocus(dataSet, mismatchedLeavesData);\n\n if (updatedObjects.length > 0) {\n this.locusInfoUpdateCallback(LocusInfoUpdateType.OBJECTS_UPDATED, {updatedObjects});\n }\n }\n } else {\n LoggerProxy.logger.info(\n `HashTreeParser#runSyncAlgorithm --> ${this.debugId} \"${dataSet.name}\" root hash matching: ${rootHash}, version=${dataSet.version}`\n );\n }\n }, delay);\n } else {\n LoggerProxy.logger.info(\n `HashTreeParser#runSyncAlgorithm --> ${this.debugId} No delay for \"${dataSet.name}\" data set, skipping sync timer reset/setup`\n );\n }\n }\n\n /**\n * Stops all timers for the data sets to prevent any further sync attempts.\n * @returns {void}\n */\n stopAllTimers() {\n Object.values(this.dataSets).forEach((dataSet) => {\n if (dataSet.timer) {\n clearTimeout(dataSet.timer);\n dataSet.timer = undefined;\n }\n });\n }\n\n /**\n * Gets the current hashes from the locus for a specific data set.\n * @param {string} dataSetName\n * @returns {string[]}\n */\n private getHashesFromLocus(dataSetName: string) {\n LoggerProxy.logger.info(\n `HashTreeParser#getHashesFromLocus --> ${this.debugId} Requesting hashes for data set \"${dataSetName}\"`\n );\n\n const dataSet = this.dataSets[dataSetName];\n\n const url = `${dataSet.url}/hashtree`;\n\n return this.webexRequest({\n method: HTTP_VERBS.GET,\n uri: url,\n })\n .then((response) => {\n const hashes = response.body?.hashes;\n\n if (!hashes || !Array.isArray(hashes)) {\n LoggerProxy.logger.warn(\n `HashTreeParser#getHashesFromLocus --> ${this.debugId} Locus returned invalid hashes, response body=`,\n response.body\n );\n throw new Error(`Locus returned invalid hashes: ${hashes}`);\n }\n\n LoggerProxy.logger.info(\n `HashTreeParser#getHashesFromLocus --> ${\n this.debugId\n } Received hashes for data set \"${dataSetName}\": ${JSON.stringify(hashes)}`\n );\n\n return hashes;\n })\n .catch((error) => {\n LoggerProxy.logger.error(\n `HashTreeParser#getHashesFromLocus --> ${this.debugId} Error ${error.statusCode} fetching hashes for data set \"${dataSetName}\":`,\n error\n );\n throw error;\n });\n }\n\n /**\n * Sends a sync request to Locus for the specified data set.\n *\n * @param {InternalDataSet} dataSet The data set to sync.\n * @param {Record<number, LeafDataItem[]>} mismatchedLeavesData The mismatched leaves data to include in the sync request.\n * @returns {Promise<HashTreeObject[]>}\n */\n private sendSyncRequestToLocus(\n dataSet: InternalDataSet,\n mismatchedLeavesData: Record<number, LeafDataItem[]>\n ): Promise<HashTreeObject[]> {\n LoggerProxy.logger.info(\n `HashTreeParser#sendSyncRequestToLocus --> ${this.debugId} Sending sync request for data set \"${dataSet.name}\"`\n );\n\n const url = `${dataSet.url}/sync`;\n const body = {\n dataSet: {\n name: dataSet.name,\n leafCount: dataSet.leafCount,\n root: dataSet.hashTree.getRootHash(), // todo: avoid recalculation\n },\n leafDataEntries: [],\n };\n\n Object.keys(mismatchedLeavesData).forEach((index) => {\n body.leafDataEntries.push({\n leafIndex: parseInt(index, 10),\n elementIds: mismatchedLeavesData[index],\n });\n });\n\n return this.webexRequest({\n method: HTTP_VERBS.POST,\n uri: url,\n body,\n })\n .then((resp) => {\n LoggerProxy.logger.info(\n `HashTreeParser#sendSyncRequestToLocus --> ${this.debugId} Sync request succeeded for \"${dataSet.name}\"`\n );\n\n // todo: handle response body (it may be there or not)\n if (resp.statusCode === 202) {\n LoggerProxy.logger.info(\n `HashTreeParser#sendSyncRequestToLocus --> ${this.debugId} Got 202 for sync request for data set \"${dataSet.name}\", data should arrive via messages`\n );\n }\n const updatedObjects = resp.body?.objects || [];\n\n if (updatedObjects.length !== body.leafDataEntries.length) {\n LoggerProxy.logger.info(\n `HashTreeParser#sendSyncRequestToLocus --> ${this.debugId} Sync request sent for \"${dataSet.name}\" with ${body.leafDataEntries.length} entries, but got ${updatedObjects.length} objects in response (statusCode=${resp.statusCode})`\n );\n }\n\n return updatedObjects;\n })\n .catch((error) => {\n LoggerProxy.logger.error(\n `HashTreeParser#sendSyncRequestToLocus --> ${this.debugId} Error ${error.statusCode} sending sync request for data set \"${dataSet.name}\":`,\n error\n );\n throw error;\n });\n }\n}\n\nexport default HashTreeParser;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAAqD,SAAAM,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,aAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MA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,CAAUmF,KAAK,CAACrB,UAAU,2CAAA9D,MAAA,CAAuC1C,OAAO,CAAC5B,IAAI,UACtIyJ,KACF,CAAC;QACD,MAAMA,KAAK;MACb,CAAC,CAAC;IACN;EAAC;EAAA,OAAA1I,cAAA;AAAA;AAAA,IAAAoJ,QAAA,GAAA3J,OAAA,CAAA1C,OAAA,GAGYiD,cAAc"}
@@ -1,8 +0,0 @@
1
- export declare const EMPTY_HASH = "99aa06d3014798d86001c324468d497f";
2
- export declare const DataSetNames: {
3
- MAIN: string;
4
- ATTENDEES: string;
5
- ATD_ACTIVE: string;
6
- ATD_UNMUTED: string;
7
- SELF: string;
8
- };