@fluidframework/container-runtime 2.62.0-356644 → 2.63.0-358419

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 (110) hide show
  1. package/.eslintrc.cjs +4 -72
  2. package/CHANGELOG.md +4 -0
  3. package/container-runtime.test-files.tar +0 -0
  4. package/dist/blobManager/blobManager.d.ts.map +1 -1
  5. package/dist/blobManager/blobManager.js +10 -7
  6. package/dist/blobManager/blobManager.js.map +1 -1
  7. package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
  8. package/dist/channelCollection.js +2 -2
  9. package/dist/channelCollection.js.map +1 -1
  10. package/dist/containerRuntime.d.ts +1 -2
  11. package/dist/containerRuntime.d.ts.map +1 -1
  12. package/dist/containerRuntime.js +93 -96
  13. package/dist/containerRuntime.js.map +1 -1
  14. package/dist/dataStoreContext.d.ts.map +1 -1
  15. package/dist/dataStoreContext.js +2 -2
  16. package/dist/dataStoreContext.js.map +1 -1
  17. package/dist/deltaScheduler.js +1 -1
  18. package/dist/deltaScheduler.js.map +1 -1
  19. package/dist/gc/garbageCollection.d.ts.map +1 -1
  20. package/dist/gc/garbageCollection.js +3 -1
  21. package/dist/gc/garbageCollection.js.map +1 -1
  22. package/dist/gc/gcConfigs.js +3 -1
  23. package/dist/gc/gcConfigs.js.map +1 -1
  24. package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  25. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  26. package/dist/gc/gcTelemetry.js +4 -3
  27. package/dist/gc/gcTelemetry.js.map +1 -1
  28. package/dist/inboundBatchAggregator.js +1 -1
  29. package/dist/inboundBatchAggregator.js.map +1 -1
  30. package/dist/metadata.d.ts.map +1 -1
  31. package/dist/metadata.js +2 -1
  32. package/dist/metadata.js.map +1 -1
  33. package/dist/opLifecycle/opGroupingManager.js +2 -2
  34. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  35. package/dist/packageVersion.d.ts +1 -1
  36. package/dist/packageVersion.js +1 -1
  37. package/dist/packageVersion.js.map +1 -1
  38. package/dist/pendingStateManager.d.ts.map +1 -1
  39. package/dist/pendingStateManager.js +8 -3
  40. package/dist/pendingStateManager.js.map +1 -1
  41. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
  42. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js +3 -2
  43. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
  44. package/dist/summary/summaryDelayLoadedModule/summarizer.js +1 -1
  45. package/dist/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
  46. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js +1 -1
  47. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  48. package/lib/blobManager/blobManager.d.ts.map +1 -1
  49. package/lib/blobManager/blobManager.js +10 -7
  50. package/lib/blobManager/blobManager.js.map +1 -1
  51. package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
  52. package/lib/channelCollection.js +2 -2
  53. package/lib/channelCollection.js.map +1 -1
  54. package/lib/containerRuntime.d.ts +1 -2
  55. package/lib/containerRuntime.d.ts.map +1 -1
  56. package/lib/containerRuntime.js +22 -25
  57. package/lib/containerRuntime.js.map +1 -1
  58. package/lib/dataStoreContext.d.ts.map +1 -1
  59. package/lib/dataStoreContext.js +2 -2
  60. package/lib/dataStoreContext.js.map +1 -1
  61. package/lib/deltaScheduler.js +1 -1
  62. package/lib/deltaScheduler.js.map +1 -1
  63. package/lib/gc/garbageCollection.d.ts.map +1 -1
  64. package/lib/gc/garbageCollection.js +3 -1
  65. package/lib/gc/garbageCollection.js.map +1 -1
  66. package/lib/gc/gcConfigs.js +3 -1
  67. package/lib/gc/gcConfigs.js.map +1 -1
  68. package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  69. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  70. package/lib/gc/gcTelemetry.js +4 -3
  71. package/lib/gc/gcTelemetry.js.map +1 -1
  72. package/lib/inboundBatchAggregator.js +1 -1
  73. package/lib/inboundBatchAggregator.js.map +1 -1
  74. package/lib/metadata.d.ts.map +1 -1
  75. package/lib/metadata.js +2 -1
  76. package/lib/metadata.js.map +1 -1
  77. package/lib/opLifecycle/opGroupingManager.js +2 -2
  78. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  79. package/lib/packageVersion.d.ts +1 -1
  80. package/lib/packageVersion.js +1 -1
  81. package/lib/packageVersion.js.map +1 -1
  82. package/lib/pendingStateManager.d.ts.map +1 -1
  83. package/lib/pendingStateManager.js +8 -3
  84. package/lib/pendingStateManager.js.map +1 -1
  85. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
  86. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js +3 -2
  87. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
  88. package/lib/summary/summaryDelayLoadedModule/summarizer.js +1 -1
  89. package/lib/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
  90. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js +1 -1
  91. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  92. package/package.json +18 -18
  93. package/src/blobManager/blobManager.ts +12 -7
  94. package/src/blobManager/blobManagerSnapSum.ts +1 -1
  95. package/src/channelCollection.ts +3 -3
  96. package/src/containerRuntime.ts +58 -65
  97. package/src/dataStoreContext.ts +3 -3
  98. package/src/deltaScheduler.ts +1 -1
  99. package/src/gc/garbageCollection.ts +5 -2
  100. package/src/gc/gcConfigs.ts +3 -3
  101. package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
  102. package/src/gc/gcTelemetry.ts +4 -5
  103. package/src/inboundBatchAggregator.ts +1 -1
  104. package/src/metadata.ts +2 -1
  105. package/src/opLifecycle/opGroupingManager.ts +2 -2
  106. package/src/packageVersion.ts +1 -1
  107. package/src/pendingStateManager.ts +11 -5
  108. package/src/summary/summaryDelayLoadedModule/runningSummarizer.ts +3 -2
  109. package/src/summary/summaryDelayLoadedModule/summarizer.ts +1 -1
  110. package/src/summary/summaryDelayLoadedModule/summaryGenerator.ts +1 -1
@@ -11,9 +11,7 @@ import { FetchSource, MessageType } from "@fluidframework/driver-definitions/int
11
11
  import { readAndParse } from "@fluidframework/driver-utils/internal";
12
12
  import { createIdCompressor, createSessionId, deserializeIdCompressor, } from "@fluidframework/id-compressor/internal";
13
13
  import { FlushMode, FlushModeExperimental, channelsTreeName, gcTreeKey, } from "@fluidframework/runtime-definitions/internal";
14
- import { defaultMinVersionForCollab, isValidMinVersionForCollab, } from "@fluidframework/runtime-utils/internal";
15
- import { GCDataBuilder, RequestParser, RuntimeHeaders, TelemetryContext, addBlobToSummary, addSummarizeResultToSummary, calculateStats, create404Response, exceptionToResponse, seqFromTree, } from "@fluidframework/runtime-utils/internal";
16
- import { semanticVersionToMinimumVersionForCollab } from "@fluidframework/runtime-utils/internal";
14
+ import { addBlobToSummary, addSummarizeResultToSummary, calculateStats, create404Response, defaultMinVersionForCollab, exceptionToResponse, GCDataBuilder, isValidMinVersionForCollab, RequestParser, RuntimeHeaders, semanticVersionToMinimumVersionForCollab, seqFromTree, TelemetryContext, } from "@fluidframework/runtime-utils/internal";
17
15
  import { DataCorruptionError, DataProcessingError, extractSafePropertiesFromMessage, GenericError, LoggingError, PerformanceEvent,
18
16
  // eslint-disable-next-line import/no-deprecated
19
17
  TaggedLoggerAdapter, UsageError, createChildLogger, createChildMonitoringContext, createSampledLogger, loggerToMonitoringContext, raiseConnectedEvent, wrapError, tagCodeArtifacts, normalizeError, } from "@fluidframework/telemetry-utils/internal";
@@ -39,7 +37,8 @@ import { PendingStateManager, } from "./pendingStateManager.js";
39
37
  import { BatchRunCounter, RunCounter } from "./runCounter.js";
40
38
  import { runtimeCompatDetailsForLoader, validateLoaderCompatibility, } from "./runtimeLayerCompatState.js";
41
39
  import { SignalTelemetryManager } from "./signalTelemetryProcessing.js";
42
- import { DocumentsSchemaController, OrderedClientElection, RetriableSummaryError, aliasBlobName, chunksBlobName, recentBatchInfoBlobName, createRootSummarizerNodeWithGC, electedSummarizerBlobName, extractSummaryMetadataMessage, idCompressorBlobName, metadataBlobName, rootHasIsolatedChannels, wrapSummaryInChannelsTree, formCreateSummarizerFn, summarizerRequestUrl, SummaryManager, SummarizerClientElection, SummaryCollection, OrderedClientCollection, validateSummaryHeuristicConfiguration, DefaultSummaryConfiguration, isSummariesDisabled, summarizerClientType, } from "./summary/index.js";
40
+ // These types are imported as types here because they are present in summaryDelayLoadedModule, which is loaded dynamically when required.
41
+ import { aliasBlobName, chunksBlobName, createRootSummarizerNodeWithGC, DefaultSummaryConfiguration, DocumentsSchemaController, electedSummarizerBlobName, extractSummaryMetadataMessage, formCreateSummarizerFn, idCompressorBlobName, isSummariesDisabled, metadataBlobName, OrderedClientCollection, OrderedClientElection, recentBatchInfoBlobName, RetriableSummaryError, rootHasIsolatedChannels, SummarizerClientElection, summarizerClientType, summarizerRequestUrl, SummaryCollection, SummaryManager, validateSummaryHeuristicConfiguration, wrapSummaryInChannelsTree, } from "./summary/index.js";
43
42
  import { Throttler, formExponentialFn } from "./throttler.js";
44
43
  /**
45
44
  * Creates an error object to be thrown / passed to Container's close fn in case of an unknown message type.
@@ -161,7 +160,7 @@ export const makeLegacySendBatchFn = (submitFn, deltaManager) => (batch) => {
161
160
  * Please see addMetadataToSummary() as well
162
161
  */
163
162
  function lastMessageFromMetadata(metadata) {
164
- return metadata?.documentSchema?.runtime?.explicitSchemaControl
163
+ return metadata?.documentSchema?.runtime?.explicitSchemaControl === true
165
164
  ? metadata?.lastMessage
166
165
  : metadata?.message;
167
166
  }
@@ -298,7 +297,7 @@ export class ContainerRuntime extends TypedEventEmitter {
298
297
  const registry = new FluidDataStoreRegistry(registryEntries);
299
298
  const tryFetchBlob = async (blobName) => {
300
299
  const blobId = context.baseSnapshot?.blobs[blobName];
301
- if (context.baseSnapshot && blobId) {
300
+ if (context.baseSnapshot !== undefined && blobId !== undefined) {
302
301
  // IContainerContext storage api return type still has undefined in 0.39 package version.
303
302
  // So once we release 0.40 container-defn package we can remove this check.
304
303
  assert(context.storage !== undefined, 0x1f5 /* "Attached state should have storage" */);
@@ -320,7 +319,7 @@ export class ContainerRuntime extends TypedEventEmitter {
320
319
  const runtimeSequenceNumber = messageAtLastSummary?.sequenceNumber;
321
320
  const protocolSequenceNumber = context.deltaManager.initialSequenceNumber;
322
321
  // When we load with pending state, we reuse an old snapshot so we don't expect these numbers to match
323
- if (!context.pendingLocalState && runtimeSequenceNumber !== undefined) {
322
+ if (context.pendingLocalState === undefined && runtimeSequenceNumber !== undefined) {
324
323
  // Unless bypass is explicitly set, then take action when sequence numbers mismatch.
325
324
  // eslint-disable-next-line unicorn/no-lonely-if -- Separate if statements make flow easier to parse
326
325
  if (loadSequenceNumberVerification !== "bypass" &&
@@ -701,6 +700,7 @@ export class ContainerRuntime extends TypedEventEmitter {
701
700
  this.getConnectionState = getConnectionState;
702
701
  // In old loaders without dispose functionality, closeFn is equivalent but will also switch container to readonly mode
703
702
  this.disposeFn = disposeFn ?? closeFn;
703
+ this.isSnapshotInstanceOfISnapshot = snapshotWithContents !== undefined;
704
704
  // Validate that the Loader is compatible with this Runtime.
705
705
  const maybeLoaderCompatDetailsForRuntime = context;
706
706
  validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime.ILayerCompatDetails, this.disposeFn);
@@ -738,7 +738,7 @@ export class ContainerRuntime extends TypedEventEmitter {
738
738
  submitSignalFn(envelope, targetClientId);
739
739
  };
740
740
  this.submitSignalFn = (envelope, targetClientId) => {
741
- if (envelope.address?.startsWith("/")) {
741
+ if (envelope.address?.startsWith("/") === true) {
742
742
  throw new Error("General path based addressing is not implemented");
743
743
  }
744
744
  sequenceAndSubmitSignal(envelope, targetClientId);
@@ -939,9 +939,6 @@ export class ContainerRuntime extends TypedEventEmitter {
939
939
  // Function to get the GC details from the base snapshot we loaded from.
940
940
  async () => this.garbageCollector.getBaseGCDetails());
941
941
  const parentContext = wrapContext(this);
942
- if (snapshotWithContents !== undefined) {
943
- this.isSnapshotInstanceOfISnapshot = true;
944
- }
945
942
  // Due to a mismatch between different layers in terms of
946
943
  // what is the interface of passing signals, we need the
947
944
  // downstream stores to wrap the signal.
@@ -1429,7 +1426,7 @@ export class ContainerRuntime extends TypedEventEmitter {
1429
1426
  this.messageAtLastSummary;
1430
1427
  const documentSchema = this.documentsSchemaController.summarizeDocumentSchema(this.deltaManager.lastSequenceNumber);
1431
1428
  // Is document schema explicit control on?
1432
- const explicitSchemaControl = documentSchema?.runtime.explicitSchemaControl;
1429
+ const explicitSchemaControl = documentSchema?.runtime.explicitSchemaControl === true;
1433
1430
  const metadata = {
1434
1431
  ...this.createContainerMetadata,
1435
1432
  // Increment the summary number for the next summary that will be generated.
@@ -1439,7 +1436,7 @@ export class ContainerRuntime extends TypedEventEmitter {
1439
1436
  telemetryDocumentId: this.telemetryDocumentId,
1440
1437
  // If explicit document schema control is not on, use legacy way to supply last message (using 'message' property).
1441
1438
  // Otherwise use new 'lastMessage' property, but also put content into the 'message' property that cases old
1442
- // runtimes (that preceed document schema control capabilities) to close container on load due to mismatch in
1439
+ // runtimes (that preceded document schema control capabilities) to close container on load due to mismatch in
1443
1440
  // last message's sequence number.
1444
1441
  // See also lastMessageFromMetadata()
1445
1442
  message: explicitSchemaControl
@@ -1753,7 +1750,7 @@ export class ContainerRuntime extends TypedEventEmitter {
1753
1750
  if ("batchStart" in inboundResult) {
1754
1751
  const batchStart = inboundResult.batchStart;
1755
1752
  const result = this.duplicateBatchDetector?.processInboundBatch(batchStart);
1756
- if (result?.duplicate) {
1753
+ if (result?.duplicate === true) {
1757
1754
  const error = new DataCorruptionError("Duplicate batch - The same batch was sequenced twice", { batchId: batchStart.batchId });
1758
1755
  this.mc.logger.sendTelemetryEvent({
1759
1756
  eventName: "DuplicateBatch",
@@ -2093,7 +2090,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2093
2090
  let checkpoint;
2094
2091
  // eslint-disable-next-line import/no-deprecated
2095
2092
  let stageControls;
2096
- if (this.mc.config.getBoolean("Fluid.ContainerRuntime.EnableRollback")) {
2093
+ if (this.mc.config.getBoolean("Fluid.ContainerRuntime.EnableRollback") === true) {
2097
2094
  if (!this.batchRunner.running && !this.inStagingMode) {
2098
2095
  stageControls = this.enterStagingMode();
2099
2096
  }
@@ -2192,7 +2189,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2192
2189
  shouldSendOps() {
2193
2190
  // Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
2194
2191
  // container runtime's ability to send ops depend on the actual readonly state of the delta manager.
2195
- return this.connected && !this.innerDeltaManager.readOnlyInfo.readonly;
2192
+ return this.connected && this.innerDeltaManager.readOnlyInfo.readonly !== true;
2196
2193
  }
2197
2194
  getQuorum() {
2198
2195
  return this._quorum;
@@ -2653,11 +2650,11 @@ export class ContainerRuntime extends TypedEventEmitter {
2653
2650
  // Because handles are unchanged dataStores in the current logic,
2654
2651
  // summarized dataStore count is total dataStore count minus handle count
2655
2652
  const dataStoreTree = summaryTree.tree[channelsTreeName];
2656
- assert(dataStoreTree.type === SummaryType.Tree, 0x1fc /* "summary is not a tree" */);
2653
+ assert(dataStoreTree?.type === SummaryType.Tree, 0x1fc /* "summary is not a tree" */);
2657
2654
  const handleCount = Object.values(dataStoreTree.tree).filter((value) => value.type === SummaryType.Handle).length;
2658
- const gcSummaryTreeStats = summaryTree.tree[gcTreeKey]
2659
- ? calculateStats(summaryTree.tree[gcTreeKey])
2660
- : undefined;
2655
+ const gcSummaryTreeStats = summaryTree.tree[gcTreeKey] === undefined
2656
+ ? undefined
2657
+ : calculateStats(summaryTree.tree[gcTreeKey]);
2661
2658
  const summaryStats = {
2662
2659
  dataStoreCount: this.channelCollection.size,
2663
2660
  summarizedDataStoreCount: this.channelCollection.size - handleCount,
@@ -2704,7 +2701,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2704
2701
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2705
2702
  head: parent,
2706
2703
  message,
2707
- parents: parent ? [parent] : [],
2704
+ parents: parent === undefined ? [] : [parent],
2708
2705
  };
2709
2706
  const uploadData = {
2710
2707
  ...generateSummaryData,
@@ -2778,7 +2775,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2778
2775
  // This is a fallback to make progress in documents where there are consistently pending ops in
2779
2776
  // the summarizer.
2780
2777
  if (finalAttempt &&
2781
- this.mc.config.getBoolean("Fluid.Summarizer.SkipFailingIncorrectSummary")) {
2778
+ this.mc.config.getBoolean("Fluid.Summarizer.SkipFailingIncorrectSummary") === true) {
2782
2779
  const error = DataProcessingError.create("Pending ops during summarization", "submitSummary", undefined, { pendingMessages: this.pendingMessagesCount });
2783
2780
  logger.sendErrorEvent({
2784
2781
  eventName: "SkipFailingIncorrectSummary",
@@ -2882,7 +2879,7 @@ export class ContainerRuntime extends TypedEventEmitter {
2882
2879
  containerRuntimeMessage.type === ContainerMessageType.BlobAttach, 0x93f /* metadata */);
2883
2880
  // Note that the real (non-proxy) delta manager is used here to get the readonly info. This is because
2884
2881
  // container runtime's ability to submit ops depend on the actual readonly state of the delta manager.
2885
- if (this.innerDeltaManager.readOnlyInfo.readonly) {
2882
+ if (this.innerDeltaManager.readOnlyInfo.readonly === true) {
2886
2883
  this.mc.logger.sendTelemetryEvent({
2887
2884
  eventName: "SubmitOpInReadonly",
2888
2885
  connected: this.connected,
@@ -3211,7 +3208,7 @@ export class ContainerRuntime extends TypedEventEmitter {
3211
3208
  const versions = await this.storage.getVersions(
3212
3209
  // eslint-disable-next-line unicorn/no-null
3213
3210
  null, 1, scenarioName, FetchSource.noCache);
3214
- assert(!!versions && !!versions[0], 0x137 /* "Failed to get version from storage" */);
3211
+ assert(versions[0] !== undefined, 0x137 /* "Failed to get version from storage" */);
3215
3212
  snapshotTree = await this.storage.getSnapshotTree(versions[0]);
3216
3213
  assert(!!snapshotTree, 0x138 /* "Failed to get snapshot from storage" */);
3217
3214
  props.snapshotVersion = versions[0].id;
@@ -3239,7 +3236,7 @@ export class ContainerRuntime extends TypedEventEmitter {
3239
3236
  throw new UsageError("getPendingLocalState is not yet supported in staging mode");
3240
3237
  }
3241
3238
  this.verifyNotClosed();
3242
- if (props?.notifyImminentClosure) {
3239
+ if (props?.notifyImminentClosure === true) {
3243
3240
  throw new UsageError("notifyImminentClosure is no longer supported in ContainerRuntime");
3244
3241
  }
3245
3242
  if (this.batchRunner.running) {