@fluidframework/id-compressor 2.13.0 → 2.21.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 (86) hide show
  1. package/.eslintrc.cjs +1 -4
  2. package/CHANGELOG.md +8 -0
  3. package/dist/appendOnlySortedMap.d.ts +37 -16
  4. package/dist/appendOnlySortedMap.d.ts.map +1 -1
  5. package/dist/appendOnlySortedMap.js +39 -21
  6. package/dist/appendOnlySortedMap.js.map +1 -1
  7. package/dist/finalSpace.d.ts +2 -2
  8. package/dist/finalSpace.d.ts.map +1 -1
  9. package/dist/finalSpace.js +5 -4
  10. package/dist/finalSpace.js.map +1 -1
  11. package/dist/idCompressor.d.ts.map +1 -1
  12. package/dist/idCompressor.js +18 -15
  13. package/dist/idCompressor.js.map +1 -1
  14. package/dist/identifiers.d.ts +1 -1
  15. package/dist/identifiers.js +1 -1
  16. package/dist/identifiers.js.map +1 -1
  17. package/dist/package.json +2 -1
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/packageVersion.js +1 -1
  20. package/dist/packageVersion.js.map +1 -1
  21. package/dist/sessions.js.map +1 -1
  22. package/dist/test/appendOnlySortedMap.perf.spec.js.map +1 -1
  23. package/dist/test/appendOnlySortedMap.spec.js.map +1 -1
  24. package/dist/test/idCompressor.perf.spec.js.map +1 -1
  25. package/dist/test/idCompressor.spec.js.map +1 -1
  26. package/dist/test/idCompressorTestUtilities.d.ts +39 -13
  27. package/dist/test/idCompressorTestUtilities.d.ts.map +1 -1
  28. package/dist/test/idCompressorTestUtilities.js +67 -56
  29. package/dist/test/idCompressorTestUtilities.js.map +1 -1
  30. package/dist/test/numericUuid.spec.js.map +1 -1
  31. package/dist/test/sessionSpaceNormalizer.spec.js.map +1 -1
  32. package/dist/test/snapshots/summary.spec.js.map +1 -1
  33. package/dist/test/testCommon.d.ts +5 -1
  34. package/dist/test/testCommon.d.ts.map +1 -1
  35. package/dist/test/testCommon.js +2 -0
  36. package/dist/test/testCommon.js.map +1 -1
  37. package/dist/utilities.d.ts.map +1 -1
  38. package/dist/utilities.js +11 -6
  39. package/dist/utilities.js.map +1 -1
  40. package/lib/appendOnlySortedMap.d.ts +37 -16
  41. package/lib/appendOnlySortedMap.d.ts.map +1 -1
  42. package/lib/appendOnlySortedMap.js +39 -21
  43. package/lib/appendOnlySortedMap.js.map +1 -1
  44. package/lib/finalSpace.d.ts +2 -2
  45. package/lib/finalSpace.d.ts.map +1 -1
  46. package/lib/finalSpace.js +5 -4
  47. package/lib/finalSpace.js.map +1 -1
  48. package/lib/idCompressor.d.ts.map +1 -1
  49. package/lib/idCompressor.js +18 -15
  50. package/lib/idCompressor.js.map +1 -1
  51. package/lib/identifiers.d.ts +1 -1
  52. package/lib/identifiers.js +1 -1
  53. package/lib/identifiers.js.map +1 -1
  54. package/lib/packageVersion.d.ts +1 -1
  55. package/lib/packageVersion.js +1 -1
  56. package/lib/packageVersion.js.map +1 -1
  57. package/lib/sessions.js.map +1 -1
  58. package/lib/test/appendOnlySortedMap.perf.spec.js.map +1 -1
  59. package/lib/test/appendOnlySortedMap.spec.js.map +1 -1
  60. package/lib/test/idCompressor.perf.spec.js.map +1 -1
  61. package/lib/test/idCompressor.spec.js.map +1 -1
  62. package/lib/test/idCompressorTestUtilities.d.ts +39 -13
  63. package/lib/test/idCompressorTestUtilities.d.ts.map +1 -1
  64. package/lib/test/idCompressorTestUtilities.js +42 -31
  65. package/lib/test/idCompressorTestUtilities.js.map +1 -1
  66. package/lib/test/numericUuid.spec.js.map +1 -1
  67. package/lib/test/sessionSpaceNormalizer.spec.js.map +1 -1
  68. package/lib/test/snapshots/summary.spec.js.map +1 -1
  69. package/lib/test/testCommon.d.ts +5 -1
  70. package/lib/test/testCommon.d.ts.map +1 -1
  71. package/lib/test/testCommon.js +2 -0
  72. package/lib/test/testCommon.js.map +1 -1
  73. package/lib/utilities.d.ts.map +1 -1
  74. package/lib/utilities.js +11 -6
  75. package/lib/utilities.js.map +1 -1
  76. package/package.json +10 -10
  77. package/src/appendOnlySortedMap.ts +39 -21
  78. package/src/finalSpace.ts +6 -5
  79. package/src/idCompressor.ts +23 -19
  80. package/src/identifiers.ts +1 -1
  81. package/src/packageVersion.ts +1 -1
  82. package/src/sessions.ts +2 -2
  83. package/src/test/idCompressorTestUtilities.ts +69 -40
  84. package/src/test/testCommon.ts +5 -1
  85. package/src/utilities.ts +12 -7
  86. package/tsconfig.json +0 -1
@@ -13,17 +13,23 @@ import { ReadonlyIdCompressor } from "./testCommon.js";
13
13
  export interface ClosedMap<K, V> extends Omit<Map<K, V>, "delete" | "clear"> {
14
14
  get(key: K): V;
15
15
  }
16
- /** Identifies a compressor in a network */
16
+ /**
17
+ * Identifies a compressor in a network
18
+ */
17
19
  export declare enum Client {
18
20
  Client1 = "Client1",
19
21
  Client2 = "Client2",
20
22
  Client3 = "Client3"
21
23
  }
22
- /** Identifies categories of compressors */
24
+ /**
25
+ * Identifies categories of compressors
26
+ */
23
27
  export declare enum MetaClient {
24
28
  All = "All"
25
29
  }
26
- /** Identifies a compressor inside the network but outside the three specially tracked clients. */
30
+ /**
31
+ * Identifies a compressor inside the network but outside the three specially tracked clients.
32
+ */
27
33
  export declare enum OutsideClient {
28
34
  Remote = "Remote"
29
35
  }
@@ -38,7 +44,9 @@ export declare const OriginatingClient: {
38
44
  Client2: Client.Client2;
39
45
  Client3: Client.Client3;
40
46
  };
41
- /** Identifies a compressor to which to send an operation */
47
+ /**
48
+ * Identifies a compressor to which to send an operation
49
+ */
42
50
  export type DestinationClient = Client | MetaClient;
43
51
  export declare const DestinationClient: {
44
52
  All: MetaClient.All;
@@ -69,7 +77,9 @@ export type ClientMap<T> = ClosedMap<Client, T>;
69
77
  * An array of session ID strings corresponding to all non-local `Client` entries.
70
78
  */
71
79
  export declare const sessionIds: ClientMap<SessionId>;
72
- /** Information about a generated ID in a network to be validated by tests */
80
+ /**
81
+ * Information about a generated ID in a network to be validated by tests
82
+ */
73
83
  export interface TestIdData {
74
84
  readonly id: SessionSpaceCompressedId;
75
85
  readonly originatingClient: OriginatingClient;
@@ -82,15 +92,25 @@ export interface TestIdData {
82
92
  */
83
93
  export declare class IdCompressorTestNetwork {
84
94
  readonly initialClusterSize: number;
85
- /** The compressors used in this network */
95
+ /**
96
+ * The compressors used in this network
97
+ */
86
98
  private readonly compressors;
87
- /** The log of operations seen by the server so far. Append-only. */
99
+ /**
100
+ * The log of operations seen by the server so far. Append-only.
101
+ */
88
102
  private readonly serverOperations;
89
- /** An index into `serverOperations` for each client which represents how many operations have been delivered to that client */
103
+ /**
104
+ * An index into `serverOperations` for each client which represents how many operations have been delivered to that client
105
+ */
90
106
  private readonly clientProgress;
91
- /** All ids (local and sequenced) that a client has created or received, in order. */
107
+ /**
108
+ * All ids (local and sequenced) that a client has created or received, in order.
109
+ */
92
110
  private readonly idLogs;
93
- /** All ids that a client has received from the server, in order. */
111
+ /**
112
+ * All ids that a client has received from the server, in order.
113
+ */
94
114
  private readonly sequencedIdLogs;
95
115
  constructor(initialClusterSize?: number);
96
116
  /**
@@ -209,11 +229,17 @@ interface FuzzTestState extends BaseFuzzTestState {
209
229
  clusterSize: number;
210
230
  }
211
231
  export interface OperationGenerationConfig {
212
- /** maximum cluster size of the network. Default: 25 */
232
+ /**
233
+ * maximum cluster size of the network. Default: 25
234
+ */
213
235
  maxClusterSize?: number;
214
- /** Number of ops between validation ops. Default: 200 */
236
+ /**
237
+ * Number of ops between validation ops. Default: 200
238
+ */
215
239
  validateInterval?: number;
216
- /** Fraction of ID allocations that are from an outside client (not Client1/2/3). */
240
+ /**
241
+ * Fraction of ID allocations that are from an outside client (not Client1/2/3).
242
+ */
217
243
  outsideAllocationFraction?: number;
218
244
  }
219
245
  export declare function makeOpGenerator(options: OperationGenerationConfig): Generator<Operation, FuzzTestState>;
@@ -1 +1 @@
1
- {"version":3,"file":"idCompressorTestUtilities.d.ts","sourceRoot":"","sources":["../../src/test/idCompressorTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAG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,WAAW,yBAAyB;IACzC,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oFAAoF;IACpF,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACnC;AAQD,wBAAgB,eAAe,CAC9B,OAAO,EAAE,yBAAyB,GAChC,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,CA4FrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,EAC9C,OAAO,EAAE,uBAAuB,EAChC,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,MAAM,EACvB,gBAAgB,GAAE,OAAc,EAChC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,EACtD,QAAQ,CAAC,EAAE,QAAQ,GACjB,IAAI,CA0DN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,UAAU,EAAE,YAAY,EACxB,KAAK,EAAE,MAAM,GACX,wBAAwB,EAAE,CAM5B;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAChD,MAAM,CAAC,EAAE,oBAAoB,GAC3B,aAAa,GAAG,iBAAiB,CAAC;AACrC;;;GAGG;AACH,wBAAgB,iCAAiC,CAChD,SAAS,EAAE,SAAS,EACpB,MAAM,CAAC,EAAE,oBAAoB,GAC3B,aAAa,GAAG,iBAAiB,CAAC"}
1
+ {"version":3,"file":"idCompressorTestUtilities.d.ts","sourceRoot":"","sources":["../../src/test/idCompressorTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,iBAAiB,EACjB,SAAS,EACT,QAAQ,EAOR,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAA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,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,CA4FrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,EAC9C,OAAO,EAAE,uBAAuB,EAChC,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,MAAM,EACvB,gBAAgB,GAAE,OAAc,EAChC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,EACtD,QAAQ,CAAC,EAAE,QAAQ,GACjB,IAAI,CA0DN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,UAAU,EAAE,YAAY,EACxB,KAAK,EAAE,MAAM,GACX,wBAAwB,EAAE,CAM5B;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAChD,MAAM,CAAC,EAAE,oBAAoB,GAC3B,aAAa,GAAG,iBAAiB,CAAC;AACrC;;;GAGG;AACH,wBAAgB,iCAAiC,CAChD,SAAS,EAAE,SAAS,EACpB,MAAM,CAAC,EAAE,oBAAoB,GAC3B,aAAa,GAAG,iBAAiB,CAAC"}
@@ -5,26 +5,33 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.createAlwaysFinalizedIdCompressor = exports.generateCompressedIds = exports.performFuzzActions = exports.makeOpGenerator = exports.mergeArrayMaps = exports.expectSerializes = exports.roundtrip = exports.IdCompressorTestNetwork = exports.sessionIds = exports.buildHugeCompressor = exports.CompressorFactory = exports.DestinationClient = exports.OriginatingClient = exports.OutsideClient = exports.MetaClient = exports.Client = void 0;
8
- const assert_1 = require("assert");
8
+ // eslint-disable-next-line import/no-nodejs-modules
9
+ const node_assert_1 = require("node:assert");
9
10
  const stochastic_test_utils_1 = require("@fluid-private/stochastic-test-utils");
10
11
  const idCompressor_js_1 = require("../idCompressor.js");
11
12
  const index_js_1 = require("../index.js");
12
13
  const sessionSpaceNormalizer_js_1 = require("../sessionSpaceNormalizer.js");
13
14
  const utilities_js_1 = require("../utilities.js");
14
15
  const testCommon_js_1 = require("./testCommon.js");
15
- /** Identifies a compressor in a network */
16
+ /**
17
+ * Identifies a compressor in a network
18
+ */
16
19
  var Client;
17
20
  (function (Client) {
18
21
  Client["Client1"] = "Client1";
19
22
  Client["Client2"] = "Client2";
20
23
  Client["Client3"] = "Client3";
21
24
  })(Client || (exports.Client = Client = {}));
22
- /** Identifies categories of compressors */
25
+ /**
26
+ * Identifies categories of compressors
27
+ */
23
28
  var MetaClient;
24
29
  (function (MetaClient) {
25
30
  MetaClient["All"] = "All";
26
31
  })(MetaClient || (exports.MetaClient = MetaClient = {}));
27
- /** Identifies a compressor inside the network but outside the three specially tracked clients. */
32
+ /**
33
+ * Identifies a compressor inside the network but outside the three specially tracked clients.
34
+ */
28
35
  var OutsideClient;
29
36
  (function (OutsideClient) {
30
37
  OutsideClient["Remote"] = "Remote";
@@ -103,7 +110,9 @@ exports.sessionIds = makeSessionIds();
103
110
  class IdCompressorTestNetwork {
104
111
  constructor(initialClusterSize = 5) {
105
112
  this.initialClusterSize = initialClusterSize;
106
- /** The log of operations seen by the server so far. Append-only. */
113
+ /**
114
+ * The log of operations seen by the server so far. Append-only.
115
+ */
107
116
  this.serverOperations = [];
108
117
  const compressors = new Map();
109
118
  const clientProgress = new Map();
@@ -209,13 +218,14 @@ class IdCompressorTestNetwork {
209
218
  * Same contract as `allocateAndSendIds`, but the originating client will be a client with the supplied sessionId.
210
219
  */
211
220
  allocateAndSendIdsFromRemoteClient(clientFrom, sessionIdFrom, numIds) {
212
- (0, assert_1.strict)(numIds > 0, "Must allocate a non-zero number of IDs");
221
+ (0, node_assert_1.strict)(numIds > 0, "Must allocate a non-zero number of IDs");
213
222
  if (clientFrom === exports.OriginatingClient.Remote) {
214
223
  const range = {
215
224
  sessionId: sessionIdFrom,
216
225
  ids: {
217
226
  firstGenCount: 1,
218
227
  count: numIds,
228
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
219
229
  requestedClusterSize: this.getCompressor(Client.Client1)[
220
230
  // eslint-disable-next-line @typescript-eslint/dot-notation
221
231
  "nextRequestedClusterSize"],
@@ -230,7 +240,7 @@ class IdCompressorTestNetwork {
230
240
  return opSpaceIds;
231
241
  }
232
242
  else {
233
- (0, assert_1.strict)(sessionIdFrom === exports.sessionIds.get(clientFrom));
243
+ (0, node_assert_1.strict)(sessionIdFrom === exports.sessionIds.get(clientFrom));
234
244
  const compressor = this.compressors.get(clientFrom);
235
245
  const sessionSpaceIds = generateCompressedIds(compressor, numIds);
236
246
  for (let i = 0; i < numIds; i++) {
@@ -248,14 +258,14 @@ class IdCompressorTestNetwork {
248
258
  deliverOperations(clientTakingDelivery, opsToDeliver) {
249
259
  let opIndexBound;
250
260
  if (clientTakingDelivery === exports.DestinationClient.All) {
251
- (0, assert_1.strict)(opsToDeliver === undefined);
261
+ (0, node_assert_1.strict)(opsToDeliver === undefined);
252
262
  opIndexBound = this.serverOperations.length;
253
263
  }
254
264
  else {
255
265
  opIndexBound =
256
- opsToDeliver !== undefined
257
- ? this.clientProgress.get(clientTakingDelivery) + opsToDeliver
258
- : this.serverOperations.length;
266
+ opsToDeliver === undefined
267
+ ? this.serverOperations.length
268
+ : this.clientProgress.get(clientTakingDelivery) + opsToDeliver;
259
269
  }
260
270
  for (const [clientTo, compressorTo] of this.getTargetCompressors(clientTakingDelivery)) {
261
271
  for (let i = this.clientProgress.get(clientTo); i < opIndexBound; i++) {
@@ -294,7 +304,7 @@ class IdCompressorTestNetwork {
294
304
  for (let g = genCount; g < genCount + count; g++) {
295
305
  const local = (0, utilities_js_1.localIdFromGenCount)(g);
296
306
  if (opSpaceIds) {
297
- assert_1.strict.strictEqual(opSpaceIds[g - firstGenCount], local);
307
+ node_assert_1.strict.strictEqual(opSpaceIds[g - firstGenCount], local);
298
308
  }
299
309
  localIdsInCreationRange.add(local);
300
310
  }
@@ -303,71 +313,72 @@ class IdCompressorTestNetwork {
303
313
  return localIdsInCreationRange;
304
314
  };
305
315
  // Ensure creation ranges for clients we track contain the correct local ID ranges
306
- this.serverOperations.forEach(([range, opSpaceIds, clientFrom]) => {
316
+ for (const [range, opSpaceIds, clientFrom] of this.serverOperations) {
307
317
  if (clientFrom !== exports.OriginatingClient.Remote) {
308
318
  const localIdsInCreationRange = getLocalIdsInRange(range, opSpaceIds);
309
319
  let localCount = 0;
310
- opSpaceIds.forEach((id) => {
320
+ for (const id of opSpaceIds) {
311
321
  if ((0, testCommon_js_1.isLocalId)(id)) {
312
322
  localCount++;
313
- (0, assert_1.strict)(localIdsInCreationRange.has(id), "Local ID not in creation range");
323
+ (0, node_assert_1.strict)(localIdsInCreationRange.has(id), "Local ID not in creation range");
314
324
  }
315
- });
316
- assert_1.strict.strictEqual(localCount, localIdsInCreationRange.size, "Local ID count mismatch");
325
+ }
326
+ node_assert_1.strict.strictEqual(localCount, localIdsInCreationRange.size, "Local ID count mismatch");
317
327
  }
318
- });
328
+ }
319
329
  const undeliveredRanges = new Map();
320
- this.clientProgress.forEach((progress, client) => {
330
+ for (const [client, progress] of this.clientProgress.entries()) {
321
331
  const ranges = this.serverOperations
322
332
  .slice(progress)
323
333
  .filter((op) => op[2] === client)
324
334
  .map(([range]) => range);
325
335
  undeliveredRanges.set(client, ranges);
326
- });
327
- undeliveredRanges.forEach((ranges, client) => {
336
+ }
337
+ for (const [client, ranges] of undeliveredRanges.entries()) {
328
338
  const compressor = this.compressors.get(client);
329
339
  let firstGenCount;
330
340
  let totalCount = 0;
331
341
  const unionedLocalRanges = new sessionSpaceNormalizer_js_1.SessionSpaceNormalizer();
332
- ranges.forEach((range) => {
333
- (0, assert_1.strict)(range.sessionId === compressor.localSessionId);
342
+ for (const range of ranges) {
343
+ (0, node_assert_1.strict)(range.sessionId === compressor.localSessionId);
334
344
  if (range.ids !== undefined) {
335
345
  // initialize firstGenCount if not set
336
346
  if (firstGenCount === undefined) {
337
347
  firstGenCount = range.ids.firstGenCount;
338
348
  }
339
349
  totalCount += range.ids.count;
340
- range.ids.localIdRanges.forEach(([genCount, count]) => {
350
+ for (const [genCount, count] of range.ids.localIdRanges) {
341
351
  unionedLocalRanges.addLocalRange(genCount, count);
342
- });
352
+ }
343
353
  }
344
- });
354
+ }
345
355
  const retakenRange = compressor.takeUnfinalizedCreationRange();
346
- if (retakenRange.ids !== undefined) {
347
- const retakenLocalIds = new sessionSpaceNormalizer_js_1.SessionSpaceNormalizer();
348
- retakenRange.ids.localIdRanges.forEach(([genCount, count]) => {
349
- retakenLocalIds.addLocalRange(genCount, count);
350
- });
351
- assert_1.strict.strictEqual(retakenLocalIds.equals(unionedLocalRanges), true, "Local ID ranges mismatch");
352
- assert_1.strict.strictEqual(retakenRange.ids.count, totalCount, "Count mismatch");
353
- assert_1.strict.strictEqual(retakenRange.ids.firstGenCount, firstGenCount, "Count mismatch");
356
+ if (retakenRange.ids === undefined) {
357
+ node_assert_1.strict.strictEqual(totalCount, 0);
358
+ node_assert_1.strict.strictEqual(unionedLocalRanges.idRanges.size, 0);
354
359
  }
355
360
  else {
356
- assert_1.strict.strictEqual(totalCount, 0);
357
- assert_1.strict.strictEqual(unionedLocalRanges.idRanges.size, 0);
361
+ const retakenLocalIds = new sessionSpaceNormalizer_js_1.SessionSpaceNormalizer();
362
+ for (const [genCount, count] of retakenRange.ids.localIdRanges) {
363
+ retakenLocalIds.addLocalRange(genCount, count);
364
+ }
365
+ node_assert_1.strict.strictEqual(retakenLocalIds.equals(unionedLocalRanges), true, "Local ID ranges mismatch");
366
+ node_assert_1.strict.strictEqual(retakenRange.ids.count, totalCount, "Count mismatch");
367
+ node_assert_1.strict.strictEqual(retakenRange.ids.firstGenCount, firstGenCount, "Count mismatch");
358
368
  }
359
- });
369
+ }
360
370
  // First, ensure all clients each generated a unique ID for each of their own calls to generate.
361
371
  for (const [compressor, ids] of sequencedLogs) {
362
372
  const allUuids = new Set();
363
373
  for (const idData of ids) {
364
374
  const uuid = compressor.decompress(idData.id);
365
- assert_1.strict.strictEqual(!allUuids.has(uuid), true, "Duplicate UUID generated.");
375
+ node_assert_1.strict.strictEqual(!allUuids.has(uuid), true, "Duplicate UUID generated.");
366
376
  allUuids.add(uuid);
367
377
  }
368
378
  }
369
379
  const maxLogLength = sequencedLogs
370
380
  .map(([_, data]) => data.length)
381
+ // eslint-disable-next-line unicorn/no-array-reduce
371
382
  .reduce((p, n) => Math.max(p, n));
372
383
  function getNextLogWithEntryAt(logsIndex, entryIndex) {
373
384
  for (let i = logsIndex; i < sequencedLogs.length; i++) {
@@ -407,48 +418,48 @@ class IdCompressorTestNetwork {
407
418
  const sessionSpaceIdA = idDataA.id;
408
419
  const idIndex = (0, testCommon_js_1.getOrCreate)(idIndicesAggregator, idDataA.sessionId, () => 0);
409
420
  originatingSession ?? (originatingSession = idDataA.sessionId);
410
- (0, assert_1.strict)(idDataA.sessionId === originatingSession, "Test infra gave wrong originating client to TestIdData");
421
+ (0, node_assert_1.strict)(idDataA.sessionId === originatingSession, "Test infra gave wrong originating client to TestIdData");
411
422
  // Only one client should have this ID as local in its session space, as only one client could have created this ID
412
423
  if ((0, testCommon_js_1.isLocalId)(sessionSpaceIdA)) {
413
424
  if (originatingSession !== exports.OriginatingClient.Remote) {
414
- assert_1.strict.strictEqual(idDataA.sessionId, this.compressors.get(idDataA.originatingClient).localSessionId);
425
+ node_assert_1.strict.strictEqual(idDataA.sessionId, this.compressors.get(idDataA.originatingClient).localSessionId);
415
426
  }
416
427
  idCreatorCount++;
417
428
  }
418
429
  const uuidASessionSpace = compressorA.decompress(sessionSpaceIdA);
419
- assert_1.strict.strictEqual(uuidASessionSpace, (0, testCommon_js_1.incrementStableId)(idDataA.sessionId, idIndex));
420
- assert_1.strict.strictEqual(compressorA.recompress(uuidASessionSpace), sessionSpaceIdA);
430
+ node_assert_1.strict.strictEqual(uuidASessionSpace, (0, testCommon_js_1.incrementStableId)(idDataA.sessionId, idIndex));
431
+ node_assert_1.strict.strictEqual(compressorA.recompress(uuidASessionSpace), sessionSpaceIdA);
421
432
  uuids.add(uuidASessionSpace);
422
433
  const opSpaceIdA = compressorA.normalizeToOpSpace(sessionSpaceIdA);
423
434
  if (!(0, testCommon_js_1.isFinalId)(opSpaceIdA)) {
424
435
  (0, testCommon_js_1.fail)("IDs should have been finalized.");
425
436
  }
426
437
  const reNormalizedIdA = compressorA.normalizeToSessionSpace(opSpaceIdA, compressorA.localSessionId);
427
- assert_1.strict.strictEqual(reNormalizedIdA, sessionSpaceIdA);
438
+ node_assert_1.strict.strictEqual(reNormalizedIdA, sessionSpaceIdA);
428
439
  finalIds.add(opSpaceIdA);
429
440
  const uuidAOpSpace = compressorA.decompress(reNormalizedIdA);
430
- assert_1.strict.strictEqual(uuidASessionSpace, uuidAOpSpace);
441
+ node_assert_1.strict.strictEqual(uuidASessionSpace, uuidAOpSpace);
431
442
  if (next !== undefined) {
432
443
  const [compressorB, idDataB] = next;
433
444
  const sessionSpaceIdB = idDataB.id;
434
445
  const uuidBSessionSpace = compressorB.decompress(sessionSpaceIdB);
435
- assert_1.strict.strictEqual(uuidASessionSpace, uuidBSessionSpace);
446
+ node_assert_1.strict.strictEqual(uuidASessionSpace, uuidBSessionSpace);
436
447
  const opSpaceIdB = compressorB.normalizeToOpSpace(sessionSpaceIdB);
437
448
  if (opSpaceIdA !== opSpaceIdB) {
438
449
  compressorB.normalizeToOpSpace(sessionSpaceIdB);
439
450
  compressorA.normalizeToOpSpace(sessionSpaceIdA);
440
451
  }
441
- assert_1.strict.strictEqual(opSpaceIdA, opSpaceIdB);
452
+ node_assert_1.strict.strictEqual(opSpaceIdA, opSpaceIdB);
442
453
  if (!(0, testCommon_js_1.isFinalId)(opSpaceIdB)) {
443
454
  (0, testCommon_js_1.fail)("IDs should have been finalized.");
444
455
  }
445
456
  const uuidBOpSpace = compressorB.decompress(opSpaceIdB);
446
- assert_1.strict.strictEqual(uuidAOpSpace, uuidBOpSpace);
457
+ node_assert_1.strict.strictEqual(uuidAOpSpace, uuidBOpSpace);
447
458
  }
448
459
  }
449
- (0, assert_1.strict)(idCreatorCount <= 1, "Only one client can create an ID.");
450
- assert_1.strict.strictEqual(uuids.size, finalIds.size);
451
- (0, assert_1.strict)(originatingSession !== undefined, "Expected originating client to be defined");
460
+ (0, node_assert_1.strict)(idCreatorCount <= 1, "Only one client can create an ID.");
461
+ node_assert_1.strict.strictEqual(uuids.size, finalIds.size);
462
+ (0, node_assert_1.strict)(originatingSession !== undefined, "Expected originating client to be defined");
452
463
  idIndicesAggregator.set(originatingSession, (idIndicesAggregator.get(originatingSession) ??
453
464
  (0, testCommon_js_1.fail)("Expected pre-existing index for originating client")) + 1);
454
465
  }
@@ -465,7 +476,7 @@ function changeCapacity(compressor, newClusterCapacity) {
465
476
  function roundtrip(compressor, withSession) {
466
477
  // preserve the capacity request as this property is normally private and resets
467
478
  // to a default on construction (deserialization)
468
- // eslint-disable-next-line @typescript-eslint/dot-notation
479
+ // eslint-disable-next-line @typescript-eslint/dot-notation, @typescript-eslint/no-unsafe-assignment
469
480
  const capacity = compressor["nextRequestedClusterSize"];
470
481
  if (withSession) {
471
482
  const serialized = compressor.serialize(withSession);
@@ -494,7 +505,7 @@ function expectSerializes(compressor) {
494
505
  else {
495
506
  [serialized, deserialized] = roundtrip(compressor, false);
496
507
  }
497
- assert_1.strict.strictEqual(compressor.equals(deserialized, withSession), true);
508
+ node_assert_1.strict.strictEqual(compressor.equals(deserialized, withSession), true);
498
509
  return serialized;
499
510
  }
500
511
  return [
@@ -509,11 +520,11 @@ exports.expectSerializes = expectSerializes;
509
520
  function mergeArrayMaps(to, from) {
510
521
  for (const [key, value] of from.entries()) {
511
522
  const entry = to.get(key);
512
- if (entry !== undefined) {
513
- entry.push(...value);
523
+ if (entry === undefined) {
524
+ to.set(key, [...value]);
514
525
  }
515
526
  else {
516
- to.set(key, [...value]);
527
+ entry.push(...value);
517
528
  }
518
529
  }
519
530
  return to;
@@ -529,7 +540,7 @@ function makeOpGenerator(options) {
529
540
  ...defaultOptions,
530
541
  ...options,
531
542
  };
532
- (0, assert_1.strict)(outsideAllocationFraction >= 0 && outsideAllocationFraction <= 1);
543
+ (0, node_assert_1.strict)(outsideAllocationFraction >= 0 && outsideAllocationFraction <= 1);
533
544
  function allocateIdsGenerator({ activeClients, clusterSize, random, }) {
534
545
  const client = random.pick(activeClients);
535
546
  const maxIdsPerUsage = clusterSize * 2;