@webex/plugin-meetings 3.11.0-next.13 → 3.11.0-next.14

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.
@@ -209,7 +209,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
209
209
  sessionId: this.sessionId
210
210
  });
211
211
  },
212
- version: "3.11.0-next.13"
212
+ version: "3.11.0-next.14"
213
213
  });
214
214
  var _default = exports.default = Breakout;
215
215
  //# sourceMappingURL=breakout.js.map
@@ -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.13"
1112
+ version: "3.11.0-next.14"
1113
1113
  });
1114
1114
  var _default = exports.default = Breakouts;
1115
1115
  //# sourceMappingURL=index.js.map
@@ -413,6 +413,24 @@ var HashTree = /*#__PURE__*/function () {
413
413
  return items;
414
414
  }
415
415
 
416
+ /**
417
+ * Retrieves the version of a specific item by its id and type.
418
+ * @param {number} id The ID of the item.
419
+ * @param {ObjectType} type The type of the item.
420
+ * @returns {number | undefined} The version of the item if found, undefined otherwise.
421
+ */
422
+ }, {
423
+ key: "getItemVersion",
424
+ value: function getItemVersion(id, type) {
425
+ var _this$leaves$index, _this$leaves$index$ty;
426
+ if (this.numLeaves === 0) {
427
+ return undefined;
428
+ }
429
+ var index = id % this.numLeaves;
430
+ var item = (_this$leaves$index = this.leaves[index]) === null || _this$leaves$index === void 0 ? void 0 : (_this$leaves$index$ty = _this$leaves$index[type]) === null || _this$leaves$index$ty === void 0 ? void 0 : _this$leaves$index$ty[id];
431
+ return item === null || item === void 0 ? void 0 : item.version;
432
+ }
433
+
416
434
  /**
417
435
  * Resizes the HashTree to have a new number of leaf nodes, redistributing all existing items.
418
436
  * @param {number} newNumLeaves The new number of leaf nodes (must be 0 or a power of 2).
@@ -1 +1 @@
1
- {"version":3,"names":["_xxh","require","_constants","_createForOfIteratorHelper","r","e","t","_Symbol","_Symbol$iterator","_Array$isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","_Array$from","test","Array","HashTree","leafData","numLeaves","_classCallCheck2","default","_defineProperty2","Error","concat","leafHashes","fill","EMPTY_HASH","leaves","map","putItems","_createClass2","key","_putItemInternal","item","put","index","id","type","existingItem","version","putItem","_this$_putItemInterna","computeLeafHash","items","_this","results","changedLeafIndexes","_set","forEach","_this$_putItemInterna2","push","add","_removeItemInternal","removed","_keys","removeItem","_this$_removeItemInte","removeItems","_this2","_this2$_removeItemInt","updateItems","itemUpdates","_this3","_ref","operation","_this3$_removeItemInt","_this3$_putItemIntern","leafContent","totalItemsCount","reduce","count","buffer","Buffer","alloc","offset","itemTypes","sort","_values","b","writeBigInt64LE","BigInt","XXH3_128","padStart","computeTreeHashes","currentLevelHashes","_toConsumableArray2","allHashes","nextLevelHashes","i","leftHash","rightHash","input","from","subarray","reverse","unshift","apply","getHashes","getRootHash","getLeafCount","getTotalItemCount","_iterator","_step","leaf","_i","_Object$keys2","err","getLeafData","leafIndex","_i2","_Object$keys3","resize","newNumLeaves","allItems","_iterator2","_step2","_i3","_Object$keys4","diffHashes","externalHashes","differingLeafIndexes","externalLeafHashesStart","ownLeafHash","externalLeafHash","_default","exports"],"sources":["hashTree.ts"],"sourcesContent":["import {XXH3_128} from 'xxh3-ts/xxh3';\nimport {EMPTY_HASH} from './constants';\nimport {ObjectType} from './types';\n\nexport type LeafDataItem = {\n type: ObjectType;\n id: number;\n version: number;\n};\n\n/**\n * HashTree is a data structure that organizes items into leaves based on their IDs,\n */\nclass HashTree {\n leaves: Array<Record<string, Record<number, LeafDataItem>>>;\n\n leafHashes: Array<string>;\n readonly numLeaves: number;\n\n /**\n * Constructs a new HashTree.\n * @param {LeafDataItem[]} leafData Initial data to populate the tree.\n * @param {number} numLeaves The number of leaf nodes in the tree. Must be 0 or a power of 2.\n * @throws {Error} If numLeaves is not 0 or a power of 2.\n */\n constructor(leafData: LeafDataItem[], numLeaves: number) {\n // eslint-disable-next-line no-bitwise\n if ((numLeaves & (numLeaves - 1)) !== 0) {\n throw new Error(`Number of leaves must be a power of 2, saw ${numLeaves}`);\n }\n\n this.numLeaves = numLeaves;\n this.leafHashes = new Array(numLeaves).fill(EMPTY_HASH);\n\n this.leaves = new Array(numLeaves).fill(null).map(() => {\n return {};\n });\n\n if (leafData) {\n this.putItems(leafData);\n }\n }\n\n /**\n * Internal logic for adding or updating an item, without computing the leaf hash.\n * @param {LeafDataItem} item The item to add or update.\n * @returns {{put: boolean, index: (number|null)}} Object indicating if put and the leaf index.\n * @private\n */\n private _putItemInternal(item: LeafDataItem): {put: boolean; index: number | null} {\n if (this.numLeaves === 0) {\n return {put: false, index: null}; // Cannot add to a tree with 0 leaves\n }\n\n const index = item.id % this.numLeaves;\n\n if (!this.leaves[index][item.type]) {\n this.leaves[index][item.type] = {};\n }\n\n const existingItem = this.leaves[index][item.type][item.id];\n\n if (!existingItem || existingItem.version < item.version) {\n this.leaves[index][item.type][item.id] = item;\n\n return {put: true, index};\n }\n\n return {put: false, index: null};\n }\n\n /**\n * Adds or updates a single item in the hash tree.\n * @param {LeafDataItem} item The item to add or update.\n * @returns {boolean} True if the item was added or updated, false otherwise (e.g., older version or tree has 0 leaves).\n */\n putItem(item: LeafDataItem): boolean {\n const {put, index} = this._putItemInternal(item);\n\n if (put && index !== null) {\n this.computeLeafHash(index);\n }\n\n return put;\n }\n\n /**\n * Adds or updates multiple items in the hash tree.\n * @param {LeafDataItem[]} items The array of items to add or update.\n * @returns {boolean[]} An array of booleans indicating success for each item.\n */\n putItems(items: LeafDataItem[]): boolean[] {\n if (this.numLeaves === 0 && items.length > 0) {\n // Cannot add items to a tree with 0 leaves.\n return items.map(() => false);\n }\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n items.forEach((item) => {\n const {put, index} = this._putItemInternal(item);\n results.push(put);\n if (put && index !== null) {\n changedLeafIndexes.add(index);\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Internal logic for removing an item, without computing the leaf hash.\n * @param {LeafDataItem} item The item to remove.\n * @returns {{removed: boolean, index: (number|null)}} Object indicating if removed and the leaf index.\n * @private\n */\n private _removeItemInternal(item: LeafDataItem): {removed: boolean; index: number | null} {\n if (this.numLeaves === 0) {\n return {removed: false, index: null};\n }\n\n const index = item.id % this.numLeaves;\n\n if (\n this.leaves[index] &&\n this.leaves[index][item.type] &&\n this.leaves[index][item.type][item.id]\n ) {\n const existingItem = this.leaves[index][item.type][item.id];\n if (\n existingItem.id === item.id &&\n existingItem.type === item.type &&\n existingItem.version <= item.version\n ) {\n delete this.leaves[index][item.type][item.id];\n if (Object.keys(this.leaves[index][item.type]).length === 0) {\n delete this.leaves[index][item.type];\n }\n\n return {removed: true, index};\n }\n }\n\n return {removed: false, index: null};\n }\n\n /**\n * Removes a single item from the hash tree.\n * The removal is based on matching type, id, and the provided item's version\n * being greater than or equal to the existing item's version.\n * @param {LeafDataItem} item The item to remove.\n * @returns {boolean} True if the item was removed, false otherwise.\n */\n removeItem(item: LeafDataItem): boolean {\n const {removed, index} = this._removeItemInternal(item);\n\n if (removed && index !== null) {\n this.computeLeafHash(index);\n }\n\n return removed;\n }\n\n /**\n * Removes multiple items from the hash tree.\n * @param {LeafDataItem[]} items The array of items to remove.\n * @returns {boolean[]} An array of booleans indicating success for each item.\n */\n removeItems(items: LeafDataItem[]): boolean[] {\n if (this.numLeaves === 0 && items.length > 0) {\n return items.map(() => false);\n }\n\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n items.forEach((item) => {\n const {removed, index} = this._removeItemInternal(item);\n results.push(removed);\n if (removed && index !== null) {\n changedLeafIndexes.add(index);\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Updates multiple items in the hash tree.\n * This method can handle both updating and removing items based on the `operation` flag.\n *\n * @param {object[]} itemUpdates An array of objects containing `operation` flag and the `item` to update.\n * @returns {boolean[]} An array of booleans indicating success for each operation.\n */\n updateItems(itemUpdates: {operation: 'update' | 'remove'; item: LeafDataItem}[]): boolean[] {\n if (this.numLeaves === 0 && itemUpdates.length > 0) {\n return itemUpdates.map(() => false);\n }\n\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n itemUpdates.forEach(({operation, item}) => {\n if (operation === 'remove') {\n const {removed, index} = this._removeItemInternal(item);\n results.push(removed);\n if (removed && index !== null) {\n changedLeafIndexes.add(index);\n }\n } else {\n const {put, index} = this._putItemInternal(item);\n results.push(put);\n if (put && index !== null) {\n changedLeafIndexes.add(index);\n }\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Computes the hash for a specific leaf.\n * The hash is based on the sorted items within the leaf.\n * @param {number} index The index of the leaf to compute the hash for.\n * @returns {void}\n */\n computeLeafHash(index: number) {\n if (index < 0 || index >= this.numLeaves) {\n // nothing to do\n return;\n }\n const leafContent = this.leaves[index];\n\n const totalItemsCount = Object.keys(leafContent).reduce((count, type) => {\n return count + Object.keys(leafContent[type]).length;\n }, 0);\n const buffer = Buffer.alloc(totalItemsCount * 16);\n\n let offset = 0;\n\n // iterate through the item types lexicographically\n const itemTypes = Object.keys(leafContent).sort();\n itemTypes.forEach((type) => {\n // iterate through the items of this type in ascending order of ID\n const items = Object.values(leafContent[type]).sort(\n (a: LeafDataItem, b: LeafDataItem) => a.id - b.id\n );\n\n // add all the items id and version to the hasher\n items.forEach((item: LeafDataItem) => {\n buffer.writeBigInt64LE(BigInt(item.id), offset);\n buffer.writeBigInt64LE(BigInt(item.version), offset + 8);\n\n offset += 16;\n });\n });\n\n this.leafHashes[index] = XXH3_128(buffer, BigInt(0)).toString(16).padStart(32, '0');\n }\n\n /**\n * Computes all internal and leaf node hashes of the tree.\n * Internal node hashes are computed bottom-up from the leaf hashes.\n * @returns {string[]} An array of hash strings, with internal node hashes first, followed by leaf hashes.\n * Returns `[EMPTY_HASH]` if the tree has 0 leaves.\n */\n computeTreeHashes(): string[] {\n if (this.numLeaves === 0) {\n return [EMPTY_HASH];\n }\n\n let currentLevelHashes = [...this.leafHashes];\n const allHashes = [];\n\n while (currentLevelHashes.length > 1) {\n const nextLevelHashes: string[] = [];\n for (let i = 0; i < currentLevelHashes.length; i += 2) {\n const leftHash = currentLevelHashes[i];\n const rightHash = i + 1 < currentLevelHashes.length ? currentLevelHashes[i + 1] : leftHash;\n\n const input = Buffer.concat([\n Buffer.from(leftHash, 'hex').subarray(0, 8).reverse(),\n Buffer.from(leftHash, 'hex').subarray(8, 16).reverse(),\n Buffer.from(rightHash, 'hex').subarray(0, 8).reverse(),\n Buffer.from(rightHash, 'hex').subarray(8, 16).reverse(),\n ]);\n\n nextLevelHashes.push(XXH3_128(input, BigInt(0)).toString(16).padStart(32, '0'));\n }\n currentLevelHashes = nextLevelHashes;\n allHashes.unshift(...currentLevelHashes);\n }\n\n return [...allHashes, ...this.leafHashes];\n }\n\n /**\n * Returns all hashes in the tree (internal nodes then leaf nodes).\n * @returns {string[]} An array of hash strings.\n */\n getHashes(): string[] {\n return this.computeTreeHashes();\n }\n\n /**\n * Computes and returns the hash value of the root node.\n * @returns {string} The root hash of the entire tree. Returns `EMPTY_HASH` if the tree has 0 leaves.\n */\n getRootHash(): string {\n if (this.numLeaves === 0) {\n return EMPTY_HASH;\n }\n\n return this.computeTreeHashes()[0];\n }\n\n /**\n * Gets the number of leaves in the tree.\n * @returns {number} The number of leaves.\n */\n getLeafCount(): number {\n return this.numLeaves;\n }\n\n /**\n * Calculates the total number of items stored in the tree.\n * @returns {number} The total number of items.\n */\n getTotalItemCount(): number {\n let count = 0;\n for (const leaf of this.leaves) {\n for (const type of Object.keys(leaf)) {\n count += Object.keys(leaf[type]).length;\n }\n }\n\n return count;\n }\n\n /**\n * Retrieves all data items from a specific leaf.\n * @param {number} leafIndex The index of the leaf.\n * @returns {LeafDataItem[]} An array of LeafDataItem in the specified leaf, sorted by ID,\n * or an empty array if the index is invalid or leaf is empty.\n */\n getLeafData(leafIndex: number): LeafDataItem[] {\n if (leafIndex < 0 || leafIndex >= this.numLeaves) {\n return [];\n }\n const leafContent = this.leaves[leafIndex];\n const items: LeafDataItem[] = [];\n for (const type of Object.keys(leafContent)) {\n items.push(...Object.values(leafContent[type]));\n }\n // Optionally sort them if a specific order is required, e.g., by ID\n items.sort((a, b) => a.id - b.id);\n\n return items;\n }\n\n /**\n * Resizes the HashTree to have a new number of leaf nodes, redistributing all existing items.\n * @param {number} newNumLeaves The new number of leaf nodes (must be 0 or a power of 2).\n * @returns {boolean} true if the tree was resized, false if the size didn't change.\n * @throws {Error} if newNumLeaves is not 0 or a power of 2.\n */\n resize(newNumLeaves: number): boolean {\n // eslint-disable-next-line no-bitwise\n if (newNumLeaves < 0 || (newNumLeaves !== 0 && (newNumLeaves & (newNumLeaves - 1)) !== 0)) {\n throw new Error('New number of leaves must be 0 or a power of 2');\n }\n\n if (newNumLeaves === this.numLeaves) {\n return false;\n }\n\n const allItems: LeafDataItem[] = [];\n for (const leaf of this.leaves) {\n for (const type of Object.keys(leaf)) {\n allItems.push(...Object.values(leaf[type]));\n }\n }\n\n // Re-initialize\n // eslint-disable-next-line no-extra-semi\n (this as any).numLeaves = newNumLeaves; // Type assertion to update readonly property\n this.leafHashes = new Array(newNumLeaves).fill(EMPTY_HASH);\n this.leaves = new Array(newNumLeaves).fill(null).map(() => ({}));\n\n if (newNumLeaves > 0) {\n this.putItems(allItems); // Re-add items which will be re-assigned to leaves and re-hashed\n }\n\n return true;\n }\n\n /**\n * Compares the tree's leaf hashes with an external set of hashes and returns the indices of differing leaf nodes.\n * The externalHashes array is expected to contain all node hashes (internal followed by leaves),\n * similar to the output of getHashes().\n * @param {string[]} externalHashes An array of hash strings (internal node hashes then leaf hashes).\n * @returns {number[]} An array of indices of the leaf nodes that have different hashes.\n */\n diffHashes(externalHashes: string[]): number[] {\n if (this.numLeaves === 0) {\n // If this tree is empty, its hash is EMPTY_HASH.\n // It differs if externalHashes is not a single EMPTY_HASH.\n if (externalHashes && externalHashes.length === 1 && externalHashes[0] === EMPTY_HASH) {\n return []; // No differences\n }\n // An empty tree has no leaves to differ, so return an empty array\n // as no specific leaf indexes are different.\n\n return [];\n }\n\n // We are interested in comparing the leaf hashes part.\n // The externalHashes array should also have its leaf hashes at the end.\n const differingLeafIndexes: number[] = [];\n // Calculate where the leaf hashes would start in the externalHashes array,\n // assuming it has the same number of leaves as this tree.\n const externalLeafHashesStart = externalHashes.length - this.numLeaves;\n\n if (externalLeafHashesStart < 0) {\n // externalHashes is too short to contain a complete set of leaf hashes\n // corresponding to this tree's numLeaves.\n // In this case, consider all of this tree's leaves as \"different\".\n for (let i = 0; i < this.numLeaves; i += 1) {\n differingLeafIndexes.push(i);\n }\n\n return differingLeafIndexes;\n }\n\n // Compare each leaf hash\n for (let i = 0; i < this.numLeaves; i += 1) {\n const ownLeafHash = this.leafHashes[i];\n // externalLeafHash might be undefined if externalHashes is shorter than expected\n // but externalLeafHashesStart was non-negative, implying a structural mismatch.\n const externalLeafHash = externalHashes[externalLeafHashesStart + i];\n if (ownLeafHash !== externalLeafHash) {\n differingLeafIndexes.push(i);\n }\n }\n\n return differingLeafIndexes;\n }\n}\n\nexport default HashTree;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAuC,SAAAE,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,OAAA,IAAAH,CAAA,CAAAI,gBAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,cAAA,CAAAL,CAAA,MAAAE,CAAA,GAAAI,2BAAA,CAAAN,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAO,MAAA,IAAA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AC/B;QACA;QACA;QACA,KAAK,IAAIjC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,IAAI,CAACtE,SAAS,EAAEsE,CAAC,IAAI,CAAC,EAAE;UAC1CgC,oBAAoB,CAACtE,IAAI,CAACsC,CAAC,CAAC;QAC9B;QAEA,OAAOgC,oBAAoB;MAC7B;;MAEA;MACA,KAAK,IAAIhC,GAAC,GAAG,CAAC,EAAEA,GAAC,GAAG,IAAI,CAACtE,SAAS,EAAEsE,GAAC,IAAI,CAAC,EAAE;QAC1C,IAAMkC,WAAW,GAAG,IAAI,CAAClG,UAAU,CAACgE,GAAC,CAAC;QACtC;QACA;QACA,IAAMmC,gBAAgB,GAAGJ,cAAc,CAACE,uBAAuB,GAAGjC,GAAC,CAAC;QACpE,IAAIkC,WAAW,KAAKC,gBAAgB,EAAE;UACpCH,oBAAoB,CAACtE,IAAI,CAACsC,GAAC,CAAC;QAC9B;MACF;MAEA,OAAOgC,oBAAoB;IAC7B;EAAC;AAAA;AAAA,IAAAI,QAAA,GAAAC,OAAA,CAAAzG,OAAA,GAGYJ,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["_xxh","require","_constants","_createForOfIteratorHelper","r","e","t","_Symbol","_Symbol$iterator","_Array$isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","_Array$from","test","Array","HashTree","leafData","numLeaves","_classCallCheck2","default","_defineProperty2","Error","concat","leafHashes","fill","EMPTY_HASH","leaves","map","putItems","_createClass2","key","_putItemInternal","item","put","index","id","type","existingItem","version","putItem","_this$_putItemInterna","computeLeafHash","items","_this","results","changedLeafIndexes","_set","forEach","_this$_putItemInterna2","push","add","_removeItemInternal","removed","_keys","removeItem","_this$_removeItemInte","removeItems","_this2","_this2$_removeItemInt","updateItems","itemUpdates","_this3","_ref","operation","_this3$_removeItemInt","_this3$_putItemIntern","leafContent","totalItemsCount","reduce","count","buffer","Buffer","alloc","offset","itemTypes","sort","_values","b","writeBigInt64LE","BigInt","XXH3_128","padStart","computeTreeHashes","currentLevelHashes","_toConsumableArray2","allHashes","nextLevelHashes","i","leftHash","rightHash","input","from","subarray","reverse","unshift","apply","getHashes","getRootHash","getLeafCount","getTotalItemCount","_iterator","_step","leaf","_i","_Object$keys2","err","getLeafData","leafIndex","_i2","_Object$keys3","getItemVersion","_this$leaves$index","_this$leaves$index$ty","undefined","resize","newNumLeaves","allItems","_iterator2","_step2","_i3","_Object$keys4","diffHashes","externalHashes","differingLeafIndexes","externalLeafHashesStart","ownLeafHash","externalLeafHash","_default","exports"],"sources":["hashTree.ts"],"sourcesContent":["import {XXH3_128} from 'xxh3-ts/xxh3';\nimport {EMPTY_HASH} from './constants';\nimport {ObjectType} from './types';\n\nexport type LeafDataItem = {\n type: ObjectType;\n id: number;\n version: number;\n};\n\n/**\n * HashTree is a data structure that organizes items into leaves based on their IDs,\n */\nclass HashTree {\n leaves: Array<Record<string, Record<number, LeafDataItem>>>;\n\n leafHashes: Array<string>;\n readonly numLeaves: number;\n\n /**\n * Constructs a new HashTree.\n * @param {LeafDataItem[]} leafData Initial data to populate the tree.\n * @param {number} numLeaves The number of leaf nodes in the tree. Must be 0 or a power of 2.\n * @throws {Error} If numLeaves is not 0 or a power of 2.\n */\n constructor(leafData: LeafDataItem[], numLeaves: number) {\n // eslint-disable-next-line no-bitwise\n if ((numLeaves & (numLeaves - 1)) !== 0) {\n throw new Error(`Number of leaves must be a power of 2, saw ${numLeaves}`);\n }\n\n this.numLeaves = numLeaves;\n this.leafHashes = new Array(numLeaves).fill(EMPTY_HASH);\n\n this.leaves = new Array(numLeaves).fill(null).map(() => {\n return {};\n });\n\n if (leafData) {\n this.putItems(leafData);\n }\n }\n\n /**\n * Internal logic for adding or updating an item, without computing the leaf hash.\n * @param {LeafDataItem} item The item to add or update.\n * @returns {{put: boolean, index: (number|null)}} Object indicating if put and the leaf index.\n * @private\n */\n private _putItemInternal(item: LeafDataItem): {put: boolean; index: number | null} {\n if (this.numLeaves === 0) {\n return {put: false, index: null}; // Cannot add to a tree with 0 leaves\n }\n\n const index = item.id % this.numLeaves;\n\n if (!this.leaves[index][item.type]) {\n this.leaves[index][item.type] = {};\n }\n\n const existingItem = this.leaves[index][item.type][item.id];\n\n if (!existingItem || existingItem.version < item.version) {\n this.leaves[index][item.type][item.id] = item;\n\n return {put: true, index};\n }\n\n return {put: false, index: null};\n }\n\n /**\n * Adds or updates a single item in the hash tree.\n * @param {LeafDataItem} item The item to add or update.\n * @returns {boolean} True if the item was added or updated, false otherwise (e.g., older version or tree has 0 leaves).\n */\n putItem(item: LeafDataItem): boolean {\n const {put, index} = this._putItemInternal(item);\n\n if (put && index !== null) {\n this.computeLeafHash(index);\n }\n\n return put;\n }\n\n /**\n * Adds or updates multiple items in the hash tree.\n * @param {LeafDataItem[]} items The array of items to add or update.\n * @returns {boolean[]} An array of booleans indicating success for each item.\n */\n putItems(items: LeafDataItem[]): boolean[] {\n if (this.numLeaves === 0 && items.length > 0) {\n // Cannot add items to a tree with 0 leaves.\n return items.map(() => false);\n }\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n items.forEach((item) => {\n const {put, index} = this._putItemInternal(item);\n results.push(put);\n if (put && index !== null) {\n changedLeafIndexes.add(index);\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Internal logic for removing an item, without computing the leaf hash.\n * @param {LeafDataItem} item The item to remove.\n * @returns {{removed: boolean, index: (number|null)}} Object indicating if removed and the leaf index.\n * @private\n */\n private _removeItemInternal(item: LeafDataItem): {removed: boolean; index: number | null} {\n if (this.numLeaves === 0) {\n return {removed: false, index: null};\n }\n\n const index = item.id % this.numLeaves;\n\n if (\n this.leaves[index] &&\n this.leaves[index][item.type] &&\n this.leaves[index][item.type][item.id]\n ) {\n const existingItem = this.leaves[index][item.type][item.id];\n if (\n existingItem.id === item.id &&\n existingItem.type === item.type &&\n existingItem.version <= item.version\n ) {\n delete this.leaves[index][item.type][item.id];\n if (Object.keys(this.leaves[index][item.type]).length === 0) {\n delete this.leaves[index][item.type];\n }\n\n return {removed: true, index};\n }\n }\n\n return {removed: false, index: null};\n }\n\n /**\n * Removes a single item from the hash tree.\n * The removal is based on matching type, id, and the provided item's version\n * being greater than or equal to the existing item's version.\n * @param {LeafDataItem} item The item to remove.\n * @returns {boolean} True if the item was removed, false otherwise.\n */\n removeItem(item: LeafDataItem): boolean {\n const {removed, index} = this._removeItemInternal(item);\n\n if (removed && index !== null) {\n this.computeLeafHash(index);\n }\n\n return removed;\n }\n\n /**\n * Removes multiple items from the hash tree.\n * @param {LeafDataItem[]} items The array of items to remove.\n * @returns {boolean[]} An array of booleans indicating success for each item.\n */\n removeItems(items: LeafDataItem[]): boolean[] {\n if (this.numLeaves === 0 && items.length > 0) {\n return items.map(() => false);\n }\n\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n items.forEach((item) => {\n const {removed, index} = this._removeItemInternal(item);\n results.push(removed);\n if (removed && index !== null) {\n changedLeafIndexes.add(index);\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Updates multiple items in the hash tree.\n * This method can handle both updating and removing items based on the `operation` flag.\n *\n * @param {object[]} itemUpdates An array of objects containing `operation` flag and the `item` to update.\n * @returns {boolean[]} An array of booleans indicating success for each operation.\n */\n updateItems(itemUpdates: {operation: 'update' | 'remove'; item: LeafDataItem}[]): boolean[] {\n if (this.numLeaves === 0 && itemUpdates.length > 0) {\n return itemUpdates.map(() => false);\n }\n\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n itemUpdates.forEach(({operation, item}) => {\n if (operation === 'remove') {\n const {removed, index} = this._removeItemInternal(item);\n results.push(removed);\n if (removed && index !== null) {\n changedLeafIndexes.add(index);\n }\n } else {\n const {put, index} = this._putItemInternal(item);\n results.push(put);\n if (put && index !== null) {\n changedLeafIndexes.add(index);\n }\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Computes the hash for a specific leaf.\n * The hash is based on the sorted items within the leaf.\n * @param {number} index The index of the leaf to compute the hash for.\n * @returns {void}\n */\n computeLeafHash(index: number) {\n if (index < 0 || index >= this.numLeaves) {\n // nothing to do\n return;\n }\n const leafContent = this.leaves[index];\n\n const totalItemsCount = Object.keys(leafContent).reduce((count, type) => {\n return count + Object.keys(leafContent[type]).length;\n }, 0);\n const buffer = Buffer.alloc(totalItemsCount * 16);\n\n let offset = 0;\n\n // iterate through the item types lexicographically\n const itemTypes = Object.keys(leafContent).sort();\n itemTypes.forEach((type) => {\n // iterate through the items of this type in ascending order of ID\n const items = Object.values(leafContent[type]).sort(\n (a: LeafDataItem, b: LeafDataItem) => a.id - b.id\n );\n\n // add all the items id and version to the hasher\n items.forEach((item: LeafDataItem) => {\n buffer.writeBigInt64LE(BigInt(item.id), offset);\n buffer.writeBigInt64LE(BigInt(item.version), offset + 8);\n\n offset += 16;\n });\n });\n\n this.leafHashes[index] = XXH3_128(buffer, BigInt(0)).toString(16).padStart(32, '0');\n }\n\n /**\n * Computes all internal and leaf node hashes of the tree.\n * Internal node hashes are computed bottom-up from the leaf hashes.\n * @returns {string[]} An array of hash strings, with internal node hashes first, followed by leaf hashes.\n * Returns `[EMPTY_HASH]` if the tree has 0 leaves.\n */\n computeTreeHashes(): string[] {\n if (this.numLeaves === 0) {\n return [EMPTY_HASH];\n }\n\n let currentLevelHashes = [...this.leafHashes];\n const allHashes = [];\n\n while (currentLevelHashes.length > 1) {\n const nextLevelHashes: string[] = [];\n for (let i = 0; i < currentLevelHashes.length; i += 2) {\n const leftHash = currentLevelHashes[i];\n const rightHash = i + 1 < currentLevelHashes.length ? currentLevelHashes[i + 1] : leftHash;\n\n const input = Buffer.concat([\n Buffer.from(leftHash, 'hex').subarray(0, 8).reverse(),\n Buffer.from(leftHash, 'hex').subarray(8, 16).reverse(),\n Buffer.from(rightHash, 'hex').subarray(0, 8).reverse(),\n Buffer.from(rightHash, 'hex').subarray(8, 16).reverse(),\n ]);\n\n nextLevelHashes.push(XXH3_128(input, BigInt(0)).toString(16).padStart(32, '0'));\n }\n currentLevelHashes = nextLevelHashes;\n allHashes.unshift(...currentLevelHashes);\n }\n\n return [...allHashes, ...this.leafHashes];\n }\n\n /**\n * Returns all hashes in the tree (internal nodes then leaf nodes).\n * @returns {string[]} An array of hash strings.\n */\n getHashes(): string[] {\n return this.computeTreeHashes();\n }\n\n /**\n * Computes and returns the hash value of the root node.\n * @returns {string} The root hash of the entire tree. Returns `EMPTY_HASH` if the tree has 0 leaves.\n */\n getRootHash(): string {\n if (this.numLeaves === 0) {\n return EMPTY_HASH;\n }\n\n return this.computeTreeHashes()[0];\n }\n\n /**\n * Gets the number of leaves in the tree.\n * @returns {number} The number of leaves.\n */\n getLeafCount(): number {\n return this.numLeaves;\n }\n\n /**\n * Calculates the total number of items stored in the tree.\n * @returns {number} The total number of items.\n */\n getTotalItemCount(): number {\n let count = 0;\n for (const leaf of this.leaves) {\n for (const type of Object.keys(leaf)) {\n count += Object.keys(leaf[type]).length;\n }\n }\n\n return count;\n }\n\n /**\n * Retrieves all data items from a specific leaf.\n * @param {number} leafIndex The index of the leaf.\n * @returns {LeafDataItem[]} An array of LeafDataItem in the specified leaf, sorted by ID,\n * or an empty array if the index is invalid or leaf is empty.\n */\n getLeafData(leafIndex: number): LeafDataItem[] {\n if (leafIndex < 0 || leafIndex >= this.numLeaves) {\n return [];\n }\n const leafContent = this.leaves[leafIndex];\n const items: LeafDataItem[] = [];\n for (const type of Object.keys(leafContent)) {\n items.push(...Object.values(leafContent[type]));\n }\n // Optionally sort them if a specific order is required, e.g., by ID\n items.sort((a, b) => a.id - b.id);\n\n return items;\n }\n\n /**\n * Retrieves the version of a specific item by its id and type.\n * @param {number} id The ID of the item.\n * @param {ObjectType} type The type of the item.\n * @returns {number | undefined} The version of the item if found, undefined otherwise.\n */\n getItemVersion(id: number, type: ObjectType): number | undefined {\n if (this.numLeaves === 0) {\n return undefined;\n }\n\n const index = id % this.numLeaves;\n const item = this.leaves[index]?.[type]?.[id];\n\n return item?.version;\n }\n\n /**\n * Resizes the HashTree to have a new number of leaf nodes, redistributing all existing items.\n * @param {number} newNumLeaves The new number of leaf nodes (must be 0 or a power of 2).\n * @returns {boolean} true if the tree was resized, false if the size didn't change.\n * @throws {Error} if newNumLeaves is not 0 or a power of 2.\n */\n resize(newNumLeaves: number): boolean {\n // eslint-disable-next-line no-bitwise\n if (newNumLeaves < 0 || (newNumLeaves !== 0 && (newNumLeaves & (newNumLeaves - 1)) !== 0)) {\n throw new Error('New number of leaves must be 0 or a power of 2');\n }\n\n if (newNumLeaves === this.numLeaves) {\n return false;\n }\n\n const allItems: LeafDataItem[] = [];\n for (const leaf of this.leaves) {\n for (const type of Object.keys(leaf)) {\n allItems.push(...Object.values(leaf[type]));\n }\n }\n\n // Re-initialize\n // eslint-disable-next-line no-extra-semi\n (this as any).numLeaves = newNumLeaves; // Type assertion to update readonly property\n this.leafHashes = new Array(newNumLeaves).fill(EMPTY_HASH);\n this.leaves = new Array(newNumLeaves).fill(null).map(() => ({}));\n\n if (newNumLeaves > 0) {\n this.putItems(allItems); // Re-add items which will be re-assigned to leaves and re-hashed\n }\n\n return true;\n }\n\n /**\n * Compares the tree's leaf hashes with an external set of hashes and returns the indices of differing leaf nodes.\n * The externalHashes array is expected to contain all node hashes (internal followed by leaves),\n * similar to the output of getHashes().\n * @param {string[]} externalHashes An array of hash strings (internal node hashes then leaf hashes).\n * @returns {number[]} An array of indices of the leaf nodes that have different hashes.\n */\n diffHashes(externalHashes: string[]): number[] {\n if (this.numLeaves === 0) {\n // If this tree is empty, its hash is EMPTY_HASH.\n // It differs if externalHashes is not a single EMPTY_HASH.\n if (externalHashes && externalHashes.length === 1 && externalHashes[0] === EMPTY_HASH) {\n return []; // No differences\n }\n // An empty tree has no leaves to differ, so return an empty array\n // as no specific leaf indexes are different.\n\n return [];\n }\n\n // We are interested in comparing the leaf hashes part.\n // The externalHashes array should also have its leaf hashes at the end.\n const differingLeafIndexes: number[] = [];\n // Calculate where the leaf hashes would start in the externalHashes array,\n // assuming it has the same number of leaves as this tree.\n const externalLeafHashesStart = externalHashes.length - this.numLeaves;\n\n if (externalLeafHashesStart < 0) {\n // externalHashes is too short to contain a complete set of leaf hashes\n // corresponding to this tree's numLeaves.\n // In this case, consider all of this tree's leaves as \"different\".\n for (let i = 0; i < this.numLeaves; i += 1) {\n differingLeafIndexes.push(i);\n }\n\n return differingLeafIndexes;\n }\n\n // Compare each leaf hash\n for (let i = 0; i < this.numLeaves; i += 1) {\n const ownLeafHash = this.leafHashes[i];\n // externalLeafHash might be undefined if externalHashes is shorter than expected\n // but externalLeafHashesStart was non-negative, implying a structural mismatch.\n const externalLeafHash = externalHashes[externalLeafHashesStart + i];\n if (ownLeafHash !== externalLeafHash) {\n differingLeafIndexes.push(i);\n }\n }\n\n return differingLeafIndexes;\n }\n}\n\nexport default HashTree;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAuC,SAAAE,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,OAAA,IAAAH,CAAA,CAAAI,gBAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,cAAA,CAAAL,CAAA,MAAAE,CAAA,GAAAI,2BAAA,CAAAN,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAO,MAAA,IAAAL,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAM,EAAA,MAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,WAAAH,EAAA,IAAAR,CAAA,CAAAO,MAAA,KAAAK,IAAA,WAAAA,IAAA,MAAAC,KAAA,EAAAb,CAAA,CAAAQ,EAAA,UA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,cAAc,CAAClI,MAAM,KAAK,CAAC,IAAIkI,cAAc,CAAC,CAAC,CAAC,KAAKjG,qBAAU,EAAE;UACrF,OAAO,EAAE,CAAC,CAAC;QACb;QACA;QACA;;QAEA,OAAO,EAAE;MACX;;MAEA;MACA;MACA,IAAMkG,oBAA8B,GAAG,EAAE;MACzC;MACA;MACA,IAAMC,uBAAuB,GAAGF,cAAc,CAAClI,MAAM,GAAG,IAAI,CAACyB,SAAS;MAEtE,IAAI2G,uBAAuB,GAAG,CAAC,EAAE;QAC/B;QACA;QACA;QACA,KAAK,IAAIrC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,IAAI,CAACtE,SAAS,EAAEsE,CAAC,IAAI,CAAC,EAAE;UAC1CoC,oBAAoB,CAAC1E,IAAI,CAACsC,CAAC,CAAC;QAC9B;QAEA,OAAOoC,oBAAoB;MAC7B;;MAEA;MACA,KAAK,IAAIpC,GAAC,GAAG,CAAC,EAAEA,GAAC,GAAG,IAAI,CAACtE,SAAS,EAAEsE,GAAC,IAAI,CAAC,EAAE;QAC1C,IAAMsC,WAAW,GAAG,IAAI,CAACtG,UAAU,CAACgE,GAAC,CAAC;QACtC;QACA;QACA,IAAMuC,gBAAgB,GAAGJ,cAAc,CAACE,uBAAuB,GAAGrC,GAAC,CAAC;QACpE,IAAIsC,WAAW,KAAKC,gBAAgB,EAAE;UACpCH,oBAAoB,CAAC1E,IAAI,CAACsC,GAAC,CAAC;QAC9B;MACF;MAEA,OAAOoC,oBAAoB;IAC7B;EAAC;AAAA;AAAA,IAAAI,QAAA,GAAAC,OAAA,CAAA7G,OAAA,GAGYJ,QAAQ","ignoreList":[]}
@@ -5,7 +5,7 @@ var _Array$from = require("@babel/runtime-corejs2/core-js/array/from");
5
5
  var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
6
6
  var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
7
7
  var _Array$isArray2 = require("@babel/runtime-corejs2/core-js/array/is-array");
8
- var _Object$keys3 = require("@babel/runtime-corejs2/core-js/object/keys");
8
+ var _Object$keys4 = require("@babel/runtime-corejs2/core-js/object/keys");
9
9
  var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
10
10
  var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
11
11
  var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
@@ -40,7 +40,7 @@ var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy")
40
40
  var _constants = require("../constants");
41
41
  var _constants2 = require("./constants");
42
42
  var _utils = require("./utils");
43
- 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; }
43
+ function ownKeys(e, r) { var t = _Object$keys4(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; }
44
44
  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; }
45
45
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && r[_Symbol$iterator] || r["@@iterator"]; if (!t) { if (_Array$isArray2(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
46
46
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -1015,9 +1015,49 @@ var HashTreeParser = /*#__PURE__*/function () {
1015
1015
  }, {
1016
1016
  key: "callLocusInfoUpdateCallback",
1017
1017
  value: function callLocusInfoUpdateCallback(updates) {
1018
+ var _this8 = this;
1018
1019
  var updateType = updates.updateType,
1019
1020
  updatedObjects = updates.updatedObjects;
1020
- if (updateType !== LocusInfoUpdateType.OBJECTS_UPDATED || (updatedObjects === null || updatedObjects === void 0 ? void 0 : updatedObjects.length) > 0) {
1021
+ if (updateType === LocusInfoUpdateType.OBJECTS_UPDATED && (updatedObjects === null || updatedObjects === void 0 ? void 0 : updatedObjects.length) > 0) {
1022
+ // Filter out updates for objects that already have a higher version in their datasets,
1023
+ // or removals for objects that still exist in any of their datasets
1024
+ var filteredUpdates = updatedObjects.filter(function (object) {
1025
+ var elementId = object.htMeta.elementId;
1026
+ var type = elementId.type,
1027
+ id = elementId.id,
1028
+ version = elementId.version;
1029
+
1030
+ // Check all datasets
1031
+ for (var _i2 = 0, _Object$keys3 = (0, _keys.default)(_this8.dataSets); _i2 < _Object$keys3.length; _i2++) {
1032
+ var dataSetName = _Object$keys3[_i2];
1033
+ var dataSet = _this8.dataSets[dataSetName];
1034
+
1035
+ // only visible datasets have hash trees set
1036
+ if (dataSet !== null && dataSet !== void 0 && dataSet.hashTree) {
1037
+ var existingVersion = dataSet.hashTree.getItemVersion(id, type);
1038
+ if (existingVersion !== undefined) {
1039
+ if (object.data) {
1040
+ // For updates: filter out if any dataset has a higher version
1041
+ if (existingVersion > version) {
1042
+ _loggerProxy.default.logger.info("HashTreeParser#callLocusInfoUpdateCallback --> ".concat(_this8.debugId, " Filtering out update for ").concat(type, ":").concat(id, " v").concat(version, " because dataset \"").concat(dataSetName, "\" has v").concat(existingVersion));
1043
+ return false;
1044
+ }
1045
+ } else if (existingVersion >= version) {
1046
+ // For removals: filter out if the object still exists in any dataset
1047
+ _loggerProxy.default.logger.info("HashTreeParser#callLocusInfoUpdateCallback --> ".concat(_this8.debugId, " Filtering out removal for ").concat(type, ":").concat(id, " v").concat(version, " because dataset \"").concat(dataSetName, "\" still has v").concat(existingVersion));
1048
+ return false;
1049
+ }
1050
+ }
1051
+ }
1052
+ }
1053
+ return true;
1054
+ });
1055
+ if (filteredUpdates.length > 0) {
1056
+ this.locusInfoUpdateCallback(updateType, {
1057
+ updatedObjects: filteredUpdates
1058
+ });
1059
+ }
1060
+ } else if (updateType !== LocusInfoUpdateType.OBJECTS_UPDATED) {
1021
1061
  this.locusInfoUpdateCallback(updateType, {
1022
1062
  updatedObjects: updatedObjects
1023
1063
  });
@@ -1048,7 +1088,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1048
1088
  }, {
1049
1089
  key: "runSyncAlgorithm",
1050
1090
  value: function runSyncAlgorithm(receivedDataSet) {
1051
- var _this8 = this;
1091
+ var _this9 = this;
1052
1092
  var dataSet = this.dataSets[receivedDataSet.name];
1053
1093
  if (!dataSet) {
1054
1094
  _loggerProxy.default.logger.warn("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " No data set found for ").concat(receivedDataSet.name, ", skipping sync algorithm"));
@@ -1070,7 +1110,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1070
1110
  }
1071
1111
  _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(this.debugId, " setting \"").concat(dataSet.name, "\" sync timer for ").concat(delay));
1072
1112
  dataSet.timer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
1073
- var rootHash, mismatchedLeavesData, receivedHashes, _yield$_this8$getHash, hashes, latestDataSetInfo, mismatchedLeaveIndexes, syncResponse, _t3;
1113
+ var rootHash, mismatchedLeavesData, receivedHashes, _yield$_this9$getHash, hashes, latestDataSetInfo, mismatchedLeaveIndexes, syncResponse, _t3;
1074
1114
  return _regenerator.default.wrap(function (_context8) {
1075
1115
  while (1) switch (_context8.prev = _context8.next) {
1076
1116
  case 0:
@@ -1079,7 +1119,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1079
1119
  _context8.next = 1;
1080
1120
  break;
1081
1121
  }
1082
- _loggerProxy.default.logger.warn("HashTreeParser#runSyncAlgorithm --> ".concat(_this8.debugId, " Data set \"").concat(dataSet.name, "\" no longer has a hash tree, cannot run sync algorithm"));
1122
+ _loggerProxy.default.logger.warn("HashTreeParser#runSyncAlgorithm --> ".concat(_this9.debugId, " Data set \"").concat(dataSet.name, "\" no longer has a hash tree, cannot run sync algorithm"));
1083
1123
  return _context8.abrupt("return");
1084
1124
  case 1:
1085
1125
  rootHash = dataSet.hashTree.getRootHash();
@@ -1087,7 +1127,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1087
1127
  _context8.next = 11;
1088
1128
  break;
1089
1129
  }
1090
- _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this8.debugId, " Root hash mismatch: received=").concat(dataSet.root, ", ours=").concat(rootHash, ", syncing data set \"").concat(dataSet.name, "\""));
1130
+ _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this9.debugId, " Root hash mismatch: received=").concat(dataSet.root, ", ours=").concat(rootHash, ", syncing data set \"").concat(dataSet.name, "\""));
1091
1131
  mismatchedLeavesData = {};
1092
1132
  if (!(dataSet.leafCount !== 1)) {
1093
1133
  _context8.next = 7;
@@ -1095,11 +1135,11 @@ var HashTreeParser = /*#__PURE__*/function () {
1095
1135
  }
1096
1136
  _context8.prev = 2;
1097
1137
  _context8.next = 3;
1098
- return _this8.getHashesFromLocus(dataSet.name);
1138
+ return _this9.getHashesFromLocus(dataSet.name);
1099
1139
  case 3:
1100
- _yield$_this8$getHash = _context8.sent;
1101
- hashes = _yield$_this8$getHash.hashes;
1102
- latestDataSetInfo = _yield$_this8$getHash.dataSet;
1140
+ _yield$_this9$getHash = _context8.sent;
1141
+ hashes = _yield$_this9$getHash.hashes;
1142
+ latestDataSetInfo = _yield$_this9$getHash.dataSet;
1103
1143
  receivedHashes = hashes;
1104
1144
  dataSet.hashTree.resize(latestDataSetInfo.leafCount);
1105
1145
  _context8.next = 6;
@@ -1112,7 +1152,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1112
1152
  break;
1113
1153
  }
1114
1154
  // this is a leaf count mismatch, we should do nothing, just wait for another heartbeat message from Locus
1115
- _loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(_this8.debugId, " Got 409 when fetching hashes for data set \"").concat(dataSet.name, "\": ").concat(_t3.message));
1155
+ _loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(_this9.debugId, " Got 409 when fetching hashes for data set \"").concat(dataSet.name, "\": ").concat(_t3.message));
1116
1156
  return _context8.abrupt("return");
1117
1157
  case 5:
1118
1158
  throw _t3;
@@ -1132,19 +1172,19 @@ var HashTreeParser = /*#__PURE__*/function () {
1132
1172
  break;
1133
1173
  }
1134
1174
  _context8.next = 9;
1135
- return _this8.sendSyncRequestToLocus(dataSet, mismatchedLeavesData);
1175
+ return _this9.sendSyncRequestToLocus(dataSet, mismatchedLeavesData);
1136
1176
  case 9:
1137
1177
  syncResponse = _context8.sent;
1138
1178
  // sync API may return nothing (in that case data will arrive via messages)
1139
1179
  // or it may return a response in the same format as messages
1140
1180
  if (syncResponse) {
1141
- _this8.handleMessage(syncResponse, 'via sync API');
1181
+ _this9.handleMessage(syncResponse, 'via sync API');
1142
1182
  }
1143
1183
  case 10:
1144
1184
  _context8.next = 12;
1145
1185
  break;
1146
1186
  case 11:
1147
- _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this8.debugId, " \"").concat(dataSet.name, "\" root hash matching: ").concat(rootHash, ", version=").concat(dataSet.version));
1187
+ _loggerProxy.default.logger.info("HashTreeParser#runSyncAlgorithm --> ".concat(_this9.debugId, " \"").concat(dataSet.name, "\" root hash matching: ").concat(rootHash, ", version=").concat(dataSet.version));
1148
1188
  case 12:
1149
1189
  case "end":
1150
1190
  return _context8.stop();
@@ -1179,7 +1219,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1179
1219
  }, {
1180
1220
  key: "getHashesFromLocus",
1181
1221
  value: function getHashesFromLocus(dataSetName) {
1182
- var _this9 = this;
1222
+ var _this0 = this;
1183
1223
  _loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(this.debugId, " Requesting hashes for data set \"").concat(dataSetName, "\""));
1184
1224
  var dataSet = this.dataSets[dataSetName];
1185
1225
  var url = "".concat(dataSet.url, "/hashtree");
@@ -1191,16 +1231,16 @@ var HashTreeParser = /*#__PURE__*/function () {
1191
1231
  var hashes = (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.hashes;
1192
1232
  var dataSetFromResponse = (_response$body2 = response.body) === null || _response$body2 === void 0 ? void 0 : _response$body2.dataSet;
1193
1233
  if (!hashes || !(0, _isArray.default)(hashes)) {
1194
- _loggerProxy.default.logger.warn("HashTreeParser#getHashesFromLocus --> ".concat(_this9.debugId, " Locus returned invalid hashes, response body="), response.body);
1234
+ _loggerProxy.default.logger.warn("HashTreeParser#getHashesFromLocus --> ".concat(_this0.debugId, " Locus returned invalid hashes, response body="), response.body);
1195
1235
  throw new Error("Locus returned invalid hashes: ".concat(hashes));
1196
1236
  }
1197
- _loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(_this9.debugId, " Received hashes for data set \"").concat(dataSetName, "\": ").concat((0, _stringify.default)(hashes)));
1237
+ _loggerProxy.default.logger.info("HashTreeParser#getHashesFromLocus --> ".concat(_this0.debugId, " Received hashes for data set \"").concat(dataSetName, "\": ").concat((0, _stringify.default)(hashes)));
1198
1238
  return {
1199
1239
  hashes: hashes,
1200
1240
  dataSet: dataSetFromResponse
1201
1241
  };
1202
1242
  }).catch(function (error) {
1203
- _loggerProxy.default.logger.error("HashTreeParser#getHashesFromLocus --> ".concat(_this9.debugId, " Error ").concat(error.statusCode, " fetching hashes for data set \"").concat(dataSetName, "\":"), error);
1243
+ _loggerProxy.default.logger.error("HashTreeParser#getHashesFromLocus --> ".concat(_this0.debugId, " Error ").concat(error.statusCode, " fetching hashes for data set \"").concat(dataSetName, "\":"), error);
1204
1244
  throw error;
1205
1245
  });
1206
1246
  }
@@ -1215,7 +1255,7 @@ var HashTreeParser = /*#__PURE__*/function () {
1215
1255
  }, {
1216
1256
  key: "sendSyncRequestToLocus",
1217
1257
  value: function sendSyncRequestToLocus(dataSet, mismatchedLeavesData) {
1218
- var _this0 = this;
1258
+ var _this1 = this;
1219
1259
  _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(this.debugId, " Sending sync request for data set \"").concat(dataSet.name, "\""));
1220
1260
  var url = "".concat(dataSet.url, "/sync");
1221
1261
  var body = {
@@ -1233,14 +1273,14 @@ var HashTreeParser = /*#__PURE__*/function () {
1233
1273
  uri: url,
1234
1274
  body: body
1235
1275
  }).then(function (resp) {
1236
- _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this0.debugId, " Sync request succeeded for \"").concat(dataSet.name, "\""));
1276
+ _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this1.debugId, " Sync request succeeded for \"").concat(dataSet.name, "\""));
1237
1277
  if (!resp.body || (0, _lodash.isEmpty)(resp.body)) {
1238
- _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this0.debugId, " Got ").concat(resp.statusCode, " with empty body for sync request for data set \"").concat(dataSet.name, "\", data should arrive via messages"));
1278
+ _loggerProxy.default.logger.info("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this1.debugId, " Got ").concat(resp.statusCode, " with empty body for sync request for data set \"").concat(dataSet.name, "\", data should arrive via messages"));
1239
1279
  return null;
1240
1280
  }
1241
1281
  return resp.body;
1242
1282
  }).catch(function (error) {
1243
- _loggerProxy.default.logger.error("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this0.debugId, " Error ").concat(error.statusCode, " sending sync request for data set \"").concat(dataSet.name, "\":"), error);
1283
+ _loggerProxy.default.logger.error("HashTreeParser#sendSyncRequestToLocus --> ".concat(_this1.debugId, " Error ").concat(error.statusCode, " sending sync request for data set \"").concat(dataSet.name, "\":"), error);
1244
1284
  throw error;
1245
1285
  });
1246
1286
  }