@fluidframework/container-runtime 2.0.0-internal.5.4.2 → 2.0.0-internal.6.0.1

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 (196) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/batchTracker.d.ts +2 -1
  3. package/dist/batchTracker.d.ts.map +1 -1
  4. package/dist/batchTracker.js.map +1 -1
  5. package/dist/blobManager.d.ts +4 -1
  6. package/dist/blobManager.d.ts.map +1 -1
  7. package/dist/blobManager.js +61 -26
  8. package/dist/blobManager.js.map +1 -1
  9. package/dist/connectionTelemetry.js +10 -2
  10. package/dist/connectionTelemetry.js.map +1 -1
  11. package/dist/containerRuntime.d.ts +26 -11
  12. package/dist/containerRuntime.d.ts.map +1 -1
  13. package/dist/containerRuntime.js +177 -123
  14. package/dist/containerRuntime.js.map +1 -1
  15. package/dist/dataStore.js +8 -2
  16. package/dist/dataStore.js.map +1 -1
  17. package/dist/dataStoreContext.js +23 -24
  18. package/dist/dataStoreContext.js.map +1 -1
  19. package/dist/dataStores.d.ts +20 -4
  20. package/dist/dataStores.d.ts.map +1 -1
  21. package/dist/dataStores.js +107 -53
  22. package/dist/dataStores.js.map +1 -1
  23. package/dist/gc/garbageCollection.js +17 -20
  24. package/dist/gc/garbageCollection.js.map +1 -1
  25. package/dist/gc/gcConfigs.js +13 -11
  26. package/dist/gc/gcConfigs.js.map +1 -1
  27. package/dist/gc/gcHelpers.js +4 -6
  28. package/dist/gc/gcHelpers.js.map +1 -1
  29. package/dist/gc/gcSummaryStateTracker.js +4 -6
  30. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  31. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  32. package/dist/gc/gcTelemetry.js +55 -37
  33. package/dist/gc/gcTelemetry.js.map +1 -1
  34. package/dist/id-compressor/idCompressor.js +49 -51
  35. package/dist/id-compressor/idCompressor.js.map +1 -1
  36. package/dist/id-compressor/idRange.js +2 -2
  37. package/dist/id-compressor/idRange.js.map +1 -1
  38. package/dist/id-compressor/sessionIdNormalizer.js +11 -16
  39. package/dist/id-compressor/sessionIdNormalizer.js.map +1 -1
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/opLifecycle/batchManager.js +10 -6
  44. package/dist/opLifecycle/batchManager.js.map +1 -1
  45. package/dist/opLifecycle/opCompressor.js +6 -1
  46. package/dist/opLifecycle/opCompressor.js.map +1 -1
  47. package/dist/opLifecycle/opDecompressor.js +11 -9
  48. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  49. package/dist/opLifecycle/opGroupingManager.js +13 -5
  50. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  51. package/dist/opLifecycle/opSplitter.js +10 -6
  52. package/dist/opLifecycle/opSplitter.js.map +1 -1
  53. package/dist/opLifecycle/outbox.js +1 -2
  54. package/dist/opLifecycle/outbox.js.map +1 -1
  55. package/dist/opLifecycle/remoteMessageProcessor.js +1 -1
  56. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  57. package/dist/opProperties.js +1 -2
  58. package/dist/opProperties.js.map +1 -1
  59. package/dist/packageVersion.d.ts +1 -1
  60. package/dist/packageVersion.js +1 -1
  61. package/dist/packageVersion.js.map +1 -1
  62. package/dist/pendingStateManager.d.ts +2 -2
  63. package/dist/pendingStateManager.d.ts.map +1 -1
  64. package/dist/pendingStateManager.js +22 -22
  65. package/dist/pendingStateManager.js.map +1 -1
  66. package/dist/scheduleManager.js +14 -10
  67. package/dist/scheduleManager.js.map +1 -1
  68. package/dist/summary/orderedClientElection.d.ts +2 -1
  69. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  70. package/dist/summary/orderedClientElection.js +17 -18
  71. package/dist/summary/orderedClientElection.js.map +1 -1
  72. package/dist/summary/runningSummarizer.js +32 -38
  73. package/dist/summary/runningSummarizer.js.map +1 -1
  74. package/dist/summary/summarizer.js +4 -7
  75. package/dist/summary/summarizer.js.map +1 -1
  76. package/dist/summary/summarizerClientElection.js +5 -9
  77. package/dist/summary/summarizerClientElection.js.map +1 -1
  78. package/dist/summary/summarizerHeuristics.js +8 -12
  79. package/dist/summary/summarizerHeuristics.js.map +1 -1
  80. package/dist/summary/summarizerNode/summarizerNode.js +22 -15
  81. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  82. package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  83. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  84. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +17 -16
  85. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  86. package/dist/summary/summaryCollection.js +3 -5
  87. package/dist/summary/summaryCollection.js.map +1 -1
  88. package/dist/summary/summaryFormat.js +1 -2
  89. package/dist/summary/summaryFormat.js.map +1 -1
  90. package/dist/summary/summaryGenerator.js +62 -20
  91. package/dist/summary/summaryGenerator.js.map +1 -1
  92. package/dist/summary/summaryManager.js +3 -5
  93. package/dist/summary/summaryManager.js.map +1 -1
  94. package/lib/batchTracker.d.ts +2 -1
  95. package/lib/batchTracker.d.ts.map +1 -1
  96. package/lib/batchTracker.js.map +1 -1
  97. package/lib/blobManager.d.ts +4 -1
  98. package/lib/blobManager.d.ts.map +1 -1
  99. package/lib/blobManager.js +61 -26
  100. package/lib/blobManager.js.map +1 -1
  101. package/lib/connectionTelemetry.js +10 -2
  102. package/lib/connectionTelemetry.js.map +1 -1
  103. package/lib/containerRuntime.d.ts +26 -11
  104. package/lib/containerRuntime.d.ts.map +1 -1
  105. package/lib/containerRuntime.js +177 -123
  106. package/lib/containerRuntime.js.map +1 -1
  107. package/lib/dataStore.js +8 -2
  108. package/lib/dataStore.js.map +1 -1
  109. package/lib/dataStoreContext.js +23 -24
  110. package/lib/dataStoreContext.js.map +1 -1
  111. package/lib/dataStores.d.ts +20 -4
  112. package/lib/dataStores.d.ts.map +1 -1
  113. package/lib/dataStores.js +107 -53
  114. package/lib/dataStores.js.map +1 -1
  115. package/lib/gc/garbageCollection.js +17 -20
  116. package/lib/gc/garbageCollection.js.map +1 -1
  117. package/lib/gc/gcConfigs.js +13 -11
  118. package/lib/gc/gcConfigs.js.map +1 -1
  119. package/lib/gc/gcHelpers.js +4 -6
  120. package/lib/gc/gcHelpers.js.map +1 -1
  121. package/lib/gc/gcSummaryStateTracker.js +4 -6
  122. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  123. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  124. package/lib/gc/gcTelemetry.js +55 -37
  125. package/lib/gc/gcTelemetry.js.map +1 -1
  126. package/lib/id-compressor/idCompressor.js +49 -51
  127. package/lib/id-compressor/idCompressor.js.map +1 -1
  128. package/lib/id-compressor/idRange.js +2 -2
  129. package/lib/id-compressor/idRange.js.map +1 -1
  130. package/lib/id-compressor/sessionIdNormalizer.js +11 -16
  131. package/lib/id-compressor/sessionIdNormalizer.js.map +1 -1
  132. package/lib/index.d.ts +1 -1
  133. package/lib/index.d.ts.map +1 -1
  134. package/lib/index.js.map +1 -1
  135. package/lib/opLifecycle/batchManager.js +10 -6
  136. package/lib/opLifecycle/batchManager.js.map +1 -1
  137. package/lib/opLifecycle/opCompressor.js +6 -1
  138. package/lib/opLifecycle/opCompressor.js.map +1 -1
  139. package/lib/opLifecycle/opDecompressor.js +11 -9
  140. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  141. package/lib/opLifecycle/opGroupingManager.js +13 -5
  142. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  143. package/lib/opLifecycle/opSplitter.js +10 -6
  144. package/lib/opLifecycle/opSplitter.js.map +1 -1
  145. package/lib/opLifecycle/outbox.js +1 -2
  146. package/lib/opLifecycle/outbox.js.map +1 -1
  147. package/lib/opLifecycle/remoteMessageProcessor.js +1 -1
  148. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  149. package/lib/opProperties.js +1 -2
  150. package/lib/opProperties.js.map +1 -1
  151. package/lib/packageVersion.d.ts +1 -1
  152. package/lib/packageVersion.js +1 -1
  153. package/lib/packageVersion.js.map +1 -1
  154. package/lib/pendingStateManager.d.ts +2 -2
  155. package/lib/pendingStateManager.d.ts.map +1 -1
  156. package/lib/pendingStateManager.js +22 -22
  157. package/lib/pendingStateManager.js.map +1 -1
  158. package/lib/scheduleManager.js +14 -10
  159. package/lib/scheduleManager.js.map +1 -1
  160. package/lib/summary/orderedClientElection.d.ts +2 -1
  161. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  162. package/lib/summary/orderedClientElection.js +17 -18
  163. package/lib/summary/orderedClientElection.js.map +1 -1
  164. package/lib/summary/runningSummarizer.js +32 -38
  165. package/lib/summary/runningSummarizer.js.map +1 -1
  166. package/lib/summary/summarizer.js +4 -7
  167. package/lib/summary/summarizer.js.map +1 -1
  168. package/lib/summary/summarizerClientElection.js +5 -9
  169. package/lib/summary/summarizerClientElection.js.map +1 -1
  170. package/lib/summary/summarizerHeuristics.js +8 -12
  171. package/lib/summary/summarizerHeuristics.js.map +1 -1
  172. package/lib/summary/summarizerNode/summarizerNode.js +22 -15
  173. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  174. package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  175. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  176. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +17 -16
  177. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  178. package/lib/summary/summaryCollection.js +3 -5
  179. package/lib/summary/summaryCollection.js.map +1 -1
  180. package/lib/summary/summaryFormat.js +1 -2
  181. package/lib/summary/summaryFormat.js.map +1 -1
  182. package/lib/summary/summaryGenerator.js +62 -20
  183. package/lib/summary/summaryGenerator.js.map +1 -1
  184. package/lib/summary/summaryManager.js +3 -5
  185. package/lib/summary/summaryManager.js.map +1 -1
  186. package/package.json +17 -17
  187. package/src/batchTracker.ts +2 -1
  188. package/src/blobManager.ts +43 -2
  189. package/src/containerRuntime.ts +74 -51
  190. package/src/dataStore.ts +7 -1
  191. package/src/dataStores.ts +95 -55
  192. package/src/gc/gcTelemetry.ts +1 -2
  193. package/src/index.ts +0 -1
  194. package/src/packageVersion.ts +1 -1
  195. package/src/pendingStateManager.ts +12 -15
  196. package/src/summary/orderedClientElection.ts +2 -1
@@ -153,9 +153,8 @@ class IdCompressor {
153
153
  * it is finalized. Ranges must be sent to the server in the order that they are taken via calls to this method.
154
154
  */
155
155
  takeNextCreationRange() {
156
- var _a;
157
156
  const lastLocalInRange = -this.localIdCount;
158
- const lastTakenNormalized = (_a = this.lastTakenLocalId) !== null && _a !== void 0 ? _a : 0;
157
+ const lastTakenNormalized = this.lastTakenLocalId ?? 0;
159
158
  (0, common_utils_1.assert)(lastLocalInRange <= lastTakenNormalized, 0x485 /* Inconsistent local ID state */);
160
159
  let ids;
161
160
  if (lastLocalInRange !== lastTakenNormalized) {
@@ -198,21 +197,20 @@ class IdCompressor {
198
197
  * @param range - the range of session-local IDs to finalize.
199
198
  */
200
199
  finalizeCreationRange(range) {
201
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
202
200
  const { sessionId } = range;
203
201
  const isLocal = sessionId === this.localSessionId;
204
- const session = (_a = this.sessions.get(sessionId)) !== null && _a !== void 0 ? _a : this.createSession(sessionId);
202
+ const session = this.sessions.get(sessionId) ?? this.createSession(sessionId);
205
203
  const ids = (0, idRange_1.getIds)(range);
206
204
  if (ids === undefined) {
207
205
  return;
208
206
  }
209
207
  const { currentClusterDetails } = session;
210
- const { cluster: currentCluster, clusterBase: currentBaseFinalId } = currentClusterDetails !== null && currentClusterDetails !== void 0 ? currentClusterDetails : {
208
+ const { cluster: currentCluster, clusterBase: currentBaseFinalId } = currentClusterDetails ?? {
211
209
  cluster: undefined,
212
210
  clusterBase: undefined,
213
211
  };
214
212
  const currentClusterExists = currentCluster !== undefined && currentBaseFinalId !== undefined;
215
- const normalizedLastFinalizedLocal = (_b = session.lastFinalizedLocalId) !== null && _b !== void 0 ? _b : 0;
213
+ const normalizedLastFinalizedLocal = session.lastFinalizedLocalId ?? 0;
216
214
  const { first: newFirstFinalizedLocal, last: newLastFinalizedLocal } = ids;
217
215
  (0, common_utils_1.assert)(newFirstFinalizedLocal === normalizedLastFinalizedLocal - 1, 0x489 /* Ranges finalized out of order. */);
218
216
  // The total number of session-local IDs to finalize
@@ -224,7 +222,8 @@ class IdCompressor {
224
222
  let newBaseUuid;
225
223
  if (currentClusterExists) {
226
224
  if (isLocal) {
227
- const lastKnownFinal = (_c = this.sessionIdNormalizer.getLastFinalId()) !== null && _c !== void 0 ? _c : (0, utils_1.fail)("Cluster exists but normalizer does not have an entry for it.");
225
+ const lastKnownFinal = this.sessionIdNormalizer.getLastFinalId() ??
226
+ (0, utils_1.fail)("Cluster exists but normalizer does not have an entry for it.");
228
227
  const lastAlignedFinalInCluster = (currentBaseFinalId +
229
228
  Math.min(currentCluster.count + finalizeCount, currentCluster.capacity) -
230
229
  1);
@@ -275,7 +274,7 @@ class IdCompressor {
275
274
  // actually finalized, because total order broadcast guarantees that any usage of those final IDs will be observed after
276
275
  // the finalization of the ranges.
277
276
  this.sessionIdNormalizer.registerFinalIdBlock(finalPivot, expansionAmount, currentCluster);
278
- (_d = this.logger) === null || _d === void 0 ? void 0 : _d.sendTelemetryEvent({
277
+ this.logger?.sendTelemetryEvent({
279
278
  eventName: "RuntimeIdCompressor:ClusterExpansion",
280
279
  sessionId: this.localSessionId,
281
280
  previousCapacity,
@@ -291,7 +290,7 @@ class IdCompressor {
291
290
  newBaseUuid = (0, numericUuid_1.incrementUuid)(currentCluster.baseUuid, currentCluster.capacity);
292
291
  currentCluster.count += remainingCapacity;
293
292
  remainingCount -= remainingCapacity;
294
- (_e = this.logger) === null || _e === void 0 ? void 0 : _e.sendTelemetryEvent({
293
+ this.logger?.sendTelemetryEvent({
295
294
  eventName: "RuntimeIdCompressor:OverfilledCluster",
296
295
  sessionId: this.localSessionId,
297
296
  });
@@ -301,7 +300,7 @@ class IdCompressor {
301
300
  // Session has never made a cluster, form a new one with the session UUID as the baseUuid
302
301
  newBaseUuid = session.sessionUuid;
303
302
  if (isLocal) {
304
- (_f = this.logger) === null || _f === void 0 ? void 0 : _f.sendTelemetryEvent({
303
+ this.logger?.sendTelemetryEvent({
305
304
  eventName: "RuntimeIdCompressor:FirstCluster",
306
305
  sessionId: this.localSessionId,
307
306
  });
@@ -336,7 +335,7 @@ class IdCompressor {
336
335
  const usedCapacity = finalizeCount - remainingCount;
337
336
  localIdPivot = (newFirstFinalizedLocal - usedCapacity);
338
337
  if (isLocal) {
339
- (_g = this.logger) === null || _g === void 0 ? void 0 : _g.sendTelemetryEvent({
338
+ this.logger?.sendTelemetryEvent({
340
339
  eventName: "RuntimeIdCompressor:NewCluster",
341
340
  sessionId: this.localSessionId,
342
341
  clusterCapacity: newCapacity,
@@ -382,7 +381,7 @@ class IdCompressor {
382
381
  (normalizedLastFinalizedLocal - overriddenLocal) -
383
382
  1);
384
383
  }
385
- (_h = cluster.overrides) !== null && _h !== void 0 ? _h : (cluster.overrides = new Map());
384
+ cluster.overrides ?? (cluster.overrides = new Map());
386
385
  const inversionKey = IdCompressor.createInversionKey(override);
387
386
  const existingIds = this.getExistingIdsForNewOverride(inversionKey, true);
388
387
  let overrideForCluster;
@@ -450,11 +449,11 @@ class IdCompressor {
450
449
  }
451
450
  }
452
451
  if (isLocal) {
453
- (_j = this.logger) === null || _j === void 0 ? void 0 : _j.sendTelemetryEvent({
452
+ this.logger?.sendTelemetryEvent({
454
453
  eventName: "RuntimeIdCompressor:IdCompressorStatus",
455
- eagerFinalIdCount: eagerFinalIdCount - ((_k = overrides === null || overrides === void 0 ? void 0 : overrides.length) !== null && _k !== void 0 ? _k : 0),
456
- localIdCount: remainingCount + ((_l = overrides === null || overrides === void 0 ? void 0 : overrides.length) !== null && _l !== void 0 ? _l : 0),
457
- overridesCount: (_m = overrides === null || overrides === void 0 ? void 0 : overrides.length) !== null && _m !== void 0 ? _m : 0,
454
+ eagerFinalIdCount: eagerFinalIdCount - (overrides?.length ?? 0),
455
+ localIdCount: remainingCount + (overrides?.length ?? 0),
456
+ overridesCount: overrides?.length ?? 0,
458
457
  sessionId: this.localSessionId,
459
458
  });
460
459
  }
@@ -499,7 +498,6 @@ class IdCompressor {
499
498
  * Returns an existing ID associated with an override, or undefined if none exists.
500
499
  */
501
500
  getExistingIdsForNewOverride(inversionKey, isFinalOverride) {
502
- var _a;
503
501
  const closestMatch = this.clustersAndOverridesInversion.getPairOrNextLower(inversionKey, reusedArray);
504
502
  let numericOverride;
505
503
  let stableOverride;
@@ -537,7 +535,9 @@ class IdCompressor {
537
535
  }
538
536
  }
539
537
  }
540
- const override = (_a = numericOverride !== null && numericOverride !== void 0 ? numericOverride : stableOverride) !== null && _a !== void 0 ? _a : (IdCompressor.isStableInversionKey(inversionKey) ? inversionKey : undefined);
538
+ const override = numericOverride ??
539
+ stableOverride ??
540
+ (IdCompressor.isStableInversionKey(inversionKey) ? inversionKey : undefined);
541
541
  if (override !== undefined) {
542
542
  const sessionSpaceId = this.getCompressedIdForStableId(override);
543
543
  if (sessionSpaceId !== undefined) {
@@ -565,8 +565,7 @@ class IdCompressor {
565
565
  * Helper for retrieving an override.
566
566
  */
567
567
  static tryGetOverride(cluster, finalId) {
568
- var _a;
569
- const override = (_a = cluster.overrides) === null || _a === void 0 ? void 0 : _a.get(finalId);
568
+ const override = cluster.overrides?.get(finalId);
570
569
  if (override === undefined) {
571
570
  return undefined;
572
571
  }
@@ -611,15 +610,15 @@ class IdCompressor {
611
610
  const registeredLocal = sessionIdNormalizer.addLocalId();
612
611
  (0, common_utils_1.assert)(registeredLocal === newLocalId, 0x496 /* Session ID Normalizer produced unexpected local ID */);
613
612
  if (eagerFinalId !== undefined) {
614
- sessionIdNormalizer.addFinalIds(eagerFinalId, eagerFinalId, cluster !== null && cluster !== void 0 ? cluster : (0, utils_1.fail)("No cluster when generating compressed ID"));
613
+ sessionIdNormalizer.addFinalIds(eagerFinalId, eagerFinalId, cluster ?? (0, utils_1.fail)("No cluster when generating compressed ID"));
615
614
  }
616
- this.localOverrides.append(newLocalId, override !== null && override !== void 0 ? override : (0, utils_1.fail)("Override must be defined"));
615
+ this.localOverrides.append(newLocalId, override ?? (0, utils_1.fail)("Override must be defined"));
617
616
  // Since the local ID was just created, it is in both session and op space
618
617
  const compressionMapping = newLocalId;
619
618
  this.clustersAndOverridesInversion.set(overrideInversionKey, compressionMapping);
620
619
  }
621
620
  else if (eagerFinalId !== undefined) {
622
- sessionIdNormalizer.addFinalIds(eagerFinalId, eagerFinalId, cluster !== null && cluster !== void 0 ? cluster : (0, utils_1.fail)("No cluster when generating compressed ID"));
621
+ sessionIdNormalizer.addFinalIds(eagerFinalId, eagerFinalId, cluster ?? (0, utils_1.fail)("No cluster when generating compressed ID"));
623
622
  return eagerFinalId;
624
623
  }
625
624
  else {
@@ -634,8 +633,7 @@ class IdCompressor {
634
633
  * @returns the UUID or override string associated with the compressed ID. Fails if the ID was not generated by this compressor.
635
634
  */
636
635
  decompress(id) {
637
- var _a;
638
- return (_a = this.tryDecompress(id)) !== null && _a !== void 0 ? _a : (0, utils_1.fail)("Compressed ID was not generated by this compressor");
636
+ return this.tryDecompress(id) ?? (0, utils_1.fail)("Compressed ID was not generated by this compressor");
639
637
  }
640
638
  /**
641
639
  * Attempts to decompress a previously compressed ID into a UUID or override string.
@@ -643,7 +641,6 @@ class IdCompressor {
643
641
  * @returns the UUID or override string associated with the compressed ID, or undefined if the ID was not generated by this compressor.
644
642
  */
645
643
  tryDecompress(id) {
646
- var _a;
647
644
  if (isFinalId(id)) {
648
645
  const possibleCluster = this.getClusterForFinalId(id);
649
646
  if (possibleCluster === undefined) {
@@ -675,7 +672,7 @@ class IdCompressor {
675
672
  // If this is a local ID with an override, then it must have been allocated on this machine and will be contained in
676
673
  // `localOverrides`s. Otherwise, it is a sequential allocation from the session UUID and can simply be negated and
677
674
  // added to that UUID to obtain the stable ID associated with it.
678
- const localOverride = (_a = this.localOverrides) === null || _a === void 0 ? void 0 : _a.get(id);
675
+ const localOverride = this.localOverrides?.get(id);
679
676
  return localOverride !== undefined
680
677
  ? localOverride
681
678
  : (0, numericUuid_1.stableIdFromNumericUuid)(this.localSession.sessionUuid, idOffset - 1);
@@ -687,8 +684,7 @@ class IdCompressor {
687
684
  * @returns the `CompressedId` associated with `uncompressed`. Fails if it has not been previously compressed by this compressor.
688
685
  */
689
686
  recompress(uncompressed) {
690
- var _a;
691
- return (_a = this.tryRecompress(uncompressed)) !== null && _a !== void 0 ? _a : (0, utils_1.fail)("No such string has ever been compressed");
687
+ return this.tryRecompress(uncompressed) ?? (0, utils_1.fail)("No such string has ever been compressed");
692
688
  }
693
689
  /**
694
690
  * Attempts to recompresses a decompressed ID, which could be a UUID or an override string.
@@ -703,7 +699,6 @@ class IdCompressor {
703
699
  * performance optimization.
704
700
  */
705
701
  recompressInternal(uncompressed, uncompressedUuidNumeric) {
706
- var _a, _b;
707
702
  let numericUuid = uncompressedUuidNumeric;
708
703
  const inversionKey = IdCompressor.createInversionKey(uncompressed);
709
704
  const isStable = IdCompressor.isStableInversionKey(inversionKey);
@@ -714,7 +709,8 @@ class IdCompressor {
714
709
  if (key === inversionKey) {
715
710
  return IdCompressor.isUnfinalizedOverride(compressionMapping)
716
711
  ? compressionMapping
717
- : (_a = compressionMapping.associatedLocalId) !== null && _a !== void 0 ? _a : compressionMapping.originalOverridingFinal;
712
+ : compressionMapping.associatedLocalId ??
713
+ compressionMapping.originalOverridingFinal;
718
714
  }
719
715
  }
720
716
  else {
@@ -722,11 +718,11 @@ class IdCompressor {
722
718
  return undefined;
723
719
  }
724
720
  const { clusterBase: closestBaseFinalId, cluster: closestCluster } = compressionMapping;
725
- numericUuid !== null && numericUuid !== void 0 ? numericUuid : (numericUuid = (0, numericUuid_1.numericUuidFromStableId)(inversionKey));
721
+ numericUuid ?? (numericUuid = (0, numericUuid_1.numericUuidFromStableId)(inversionKey));
726
722
  const uuidOffset = (0, numericUuid_1.getPositiveDelta)(numericUuid, closestCluster.baseUuid, closestCluster.count - 1);
727
723
  if (uuidOffset !== undefined) {
728
724
  let targetFinalId = (closestBaseFinalId + uuidOffset);
729
- const override = (_b = closestCluster.overrides) === null || _b === void 0 ? void 0 : _b.get(targetFinalId);
725
+ const override = closestCluster.overrides?.get(targetFinalId);
730
726
  if (typeof override === "object") {
731
727
  if (override.associatedLocalId !== undefined) {
732
728
  return override.associatedLocalId;
@@ -741,7 +737,7 @@ class IdCompressor {
741
737
  }
742
738
  if (isStable) {
743
739
  // May have already computed the numeric UUID, so avoid recomputing if possible
744
- const sessionSpaceId = this.getCompressedIdForStableId(numericUuid !== null && numericUuid !== void 0 ? numericUuid : inversionKey);
740
+ const sessionSpaceId = this.getCompressedIdForStableId(numericUuid ?? inversionKey);
745
741
  if (sessionSpaceId !== undefined) {
746
742
  return sessionSpaceId;
747
743
  }
@@ -754,7 +750,6 @@ class IdCompressor {
754
750
  * @returns the ID in op space.
755
751
  */
756
752
  normalizeToOpSpace(id) {
757
- var _a, _b, _c;
758
753
  if (isFinalId(id)) {
759
754
  return id;
760
755
  }
@@ -773,7 +768,8 @@ class IdCompressor {
773
768
  const override = this.localOverrides.get(id);
774
769
  if (override !== undefined) {
775
770
  const inversionKey = IdCompressor.createInversionKey(override);
776
- const compressionMapping = (_a = this.clustersAndOverridesInversion.get(inversionKey)) !== null && _a !== void 0 ? _a : (0, utils_1.fail)("Bimap is malformed.");
771
+ const compressionMapping = this.clustersAndOverridesInversion.get(inversionKey) ??
772
+ (0, utils_1.fail)("Bimap is malformed.");
777
773
  return !IdCompressor.isClusterInfo(compressionMapping) &&
778
774
  !IdCompressor.isUnfinalizedOverride(compressionMapping) &&
779
775
  compressionMapping.associatedLocalId === id
@@ -781,9 +777,10 @@ class IdCompressor {
781
777
  : id;
782
778
  }
783
779
  const possibleFinal = this.sessionIdNormalizer.getFinalId(id);
784
- return (_b = possibleFinal === null || possibleFinal === void 0 ? void 0 : possibleFinal[0]) !== null && _b !== void 0 ? _b : id;
780
+ return possibleFinal?.[0] ?? id;
785
781
  }
786
- const [correspondingFinal, cluster] = (_c = this.sessionIdNormalizer.getFinalId(id)) !== null && _c !== void 0 ? _c : (0, utils_1.fail)("Locally created cluster should be added to the map when allocated");
782
+ const [correspondingFinal, cluster] = this.sessionIdNormalizer.getFinalId(id) ??
783
+ (0, utils_1.fail)("Locally created cluster should be added to the map when allocated");
787
784
  if (cluster.overrides) {
788
785
  const override = cluster.overrides.get(correspondingFinal);
789
786
  if (typeof override === "object" && override.originalOverridingFinal !== undefined) {
@@ -794,7 +791,6 @@ class IdCompressor {
794
791
  return correspondingFinal;
795
792
  }
796
793
  normalizeToSessionSpace(id, sessionIdIfLocal) {
797
- var _a, _b, _c, _d;
798
794
  if (isLocalId(id)) {
799
795
  if (sessionIdIfLocal === undefined || sessionIdIfLocal === this.localSessionId) {
800
796
  const localIndex = -id;
@@ -804,10 +800,12 @@ class IdCompressor {
804
800
  return id;
805
801
  }
806
802
  else {
807
- const session = (_a = this.sessions.get(sessionIdIfLocal)) !== null && _a !== void 0 ? _a : (0, utils_1.fail)("No IDs have ever been finalized by the supplied session.");
803
+ const session = this.sessions.get(sessionIdIfLocal) ??
804
+ (0, utils_1.fail)("No IDs have ever been finalized by the supplied session.");
808
805
  const localCount = -id;
809
806
  const numericUuid = (0, numericUuid_1.incrementUuid)(session.sessionUuid, localCount - 1);
810
- return ((_b = this.compressNumericUuid(numericUuid)) !== null && _b !== void 0 ? _b : (0, utils_1.fail)("ID is not known to this compressor."));
807
+ return (this.compressNumericUuid(numericUuid) ??
808
+ (0, utils_1.fail)("ID is not known to this compressor."));
811
809
  }
812
810
  }
813
811
  const normalizedId = this.sessionIdNormalizer.getSessionSpaceId(id);
@@ -816,8 +814,9 @@ class IdCompressor {
816
814
  }
817
815
  // Check for a unified override finalized first by another session but to which the local session
818
816
  // still has an associated local ID.
819
- const [_, cluster] = (_c = this.getClusterForFinalId(id)) !== null && _c !== void 0 ? _c : (0, utils_1.fail)("Supplied final ID was not finalized by this compressor.");
820
- const override = (_d = cluster.overrides) === null || _d === void 0 ? void 0 : _d.get(id);
817
+ const [_, cluster] = this.getClusterForFinalId(id) ??
818
+ (0, utils_1.fail)("Supplied final ID was not finalized by this compressor.");
819
+ const override = cluster.overrides?.get(id);
821
820
  if (typeof override === "object" && override.associatedLocalId !== undefined) {
822
821
  return override.associatedLocalId;
823
822
  }
@@ -986,7 +985,6 @@ class IdCompressor {
986
985
  return true;
987
986
  }
988
987
  static idClustersEqual(a, b, checkSessionData = true, compareLocalState = true) {
989
- var _a, _b;
990
988
  const areEqual = (0, numericUuid_1.numericUuidEquals)(a.baseUuid, b.baseUuid) &&
991
989
  a.capacity === b.capacity &&
992
990
  a.count === b.count &&
@@ -994,7 +992,7 @@ class IdCompressor {
994
992
  IdCompressor.sessionDataEqual(a.session, b.session, false, compareLocalState)) &&
995
993
  (a.overrides === undefined) === (b.overrides === undefined) &&
996
994
  (a.overrides === undefined ||
997
- (0, utils_1.compareMaps)((_a = a.overrides) !== null && _a !== void 0 ? _a : (0, utils_1.fail)("Overrides must be defined"), (_b = b.overrides) !== null && _b !== void 0 ? _b : (0, utils_1.fail)("Overrides must be defined"), (overrideA, overrideB) => {
995
+ (0, utils_1.compareMaps)(a.overrides ?? (0, utils_1.fail)("Overrides must be defined"), b.overrides ?? (0, utils_1.fail)("Overrides must be defined"), (overrideA, overrideB) => {
998
996
  if (compareLocalState) {
999
997
  if (typeof overrideA === "string" || typeof overrideB === "string") {
1000
998
  return overrideA === overrideB;
@@ -1018,7 +1016,6 @@ class IdCompressor {
1018
1016
  return areEqual;
1019
1017
  }
1020
1018
  serialize(withSession) {
1021
- var _a, _b;
1022
1019
  const serializedSessions = [];
1023
1020
  const sessionIdToSessionIndex = new Map();
1024
1021
  for (const [sessionId, session] of this.sessions) {
@@ -1036,7 +1033,8 @@ class IdCompressor {
1036
1033
  for (const [baseFinalId, cluster] of this.finalIdToCluster.entries()) {
1037
1034
  const sessionId = (0, numericUuid_1.stableIdFromNumericUuid)(cluster.session.sessionUuid);
1038
1035
  if (sessionId !== reservedSessionId) {
1039
- const sessionIndex = (_a = sessionIdToSessionIndex.get(sessionId)) !== null && _a !== void 0 ? _a : (0, utils_1.fail)("Session object contains wrong session numeric UUID");
1036
+ const sessionIndex = sessionIdToSessionIndex.get(sessionId) ??
1037
+ (0, utils_1.fail)("Session object contains wrong session numeric UUID");
1040
1038
  const serializedCluster = [
1041
1039
  sessionIndex,
1042
1040
  cluster.capacity,
@@ -1088,7 +1086,7 @@ class IdCompressor {
1088
1086
  }
1089
1087
  return serializedWithSession;
1090
1088
  }
1091
- (_b = this.logger) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent({
1089
+ this.logger?.sendTelemetryEvent({
1092
1090
  eventName: "RuntimeIdCompressor:SerializedIdCompressorSize",
1093
1091
  size: JSON.stringify(serializedIdCompressor).length,
1094
1092
  clusterCount: serializedIdCompressor.clusters.length,
@@ -1149,7 +1147,7 @@ class IdCompressor {
1149
1147
  baseUuid: (0, numericUuid_1.incrementUuid)(sessionUuid, currentIdCount),
1150
1148
  session,
1151
1149
  };
1152
- const lastFinalizedNormalized = lastFinalizedLocalId !== null && lastFinalizedLocalId !== void 0 ? lastFinalizedLocalId : 0;
1150
+ const lastFinalizedNormalized = lastFinalizedLocalId ?? 0;
1153
1151
  const clusterBase = compressor.nextClusterBaseFinalId;
1154
1152
  session.lastFinalizedLocalId = (lastFinalizedNormalized - count);
1155
1153
  session.currentClusterDetails = { clusterBase, cluster };
@@ -1203,8 +1201,8 @@ class IdCompressor {
1203
1201
  }
1204
1202
  if (serializedLocalState !== undefined) {
1205
1203
  compressor.sessionIdNormalizer = sessionIdNormalizer_1.SessionIdNormalizer.deserialize(serializedLocalState.sessionNormalizer, (finalId) => {
1206
- var _a;
1207
- const [_, cluster] = (_a = compressor.finalIdToCluster.getPairOrNextLower(finalId)) !== null && _a !== void 0 ? _a : (0, utils_1.fail)("Final in serialized normalizer was never created.");
1204
+ const [_, cluster] = compressor.finalIdToCluster.getPairOrNextLower(finalId) ??
1205
+ (0, utils_1.fail)("Final in serialized normalizer was never created.");
1208
1206
  return cluster;
1209
1207
  });
1210
1208
  }