@fluidframework/container-runtime 2.80.0 → 2.81.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 (47) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/dataStoreContext.d.ts.map +1 -1
  4. package/dist/dataStoreContext.js +1 -0
  5. package/dist/dataStoreContext.js.map +1 -1
  6. package/dist/deltaScheduler.d.ts.map +1 -1
  7. package/dist/deltaScheduler.js +1 -0
  8. package/dist/deltaScheduler.js.map +1 -1
  9. package/dist/gc/gcHelpers.d.ts.map +1 -1
  10. package/dist/gc/gcHelpers.js +1 -0
  11. package/dist/gc/gcHelpers.js.map +1 -1
  12. package/dist/packageVersion.d.ts +1 -1
  13. package/dist/packageVersion.js +1 -1
  14. package/dist/packageVersion.js.map +1 -1
  15. package/dist/runtimeLayerCompatState.d.ts +2 -2
  16. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  17. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +1 -0
  18. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  19. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js +8 -8
  20. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  21. package/eslint.config.mts +4 -4
  22. package/lib/dataStoreContext.d.ts.map +1 -1
  23. package/lib/dataStoreContext.js +1 -0
  24. package/lib/dataStoreContext.js.map +1 -1
  25. package/lib/deltaScheduler.d.ts.map +1 -1
  26. package/lib/deltaScheduler.js +1 -0
  27. package/lib/deltaScheduler.js.map +1 -1
  28. package/lib/gc/gcHelpers.d.ts.map +1 -1
  29. package/lib/gc/gcHelpers.js +1 -0
  30. package/lib/gc/gcHelpers.js.map +1 -1
  31. package/lib/packageVersion.d.ts +1 -1
  32. package/lib/packageVersion.js +1 -1
  33. package/lib/packageVersion.js.map +1 -1
  34. package/lib/runtimeLayerCompatState.d.ts +2 -2
  35. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  36. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +1 -0
  37. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  38. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js +8 -8
  39. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  40. package/package.json +22 -22
  41. package/src/dataStoreContext.ts +1 -0
  42. package/src/deltaScheduler.ts +1 -0
  43. package/src/gc/gcHelpers.ts +1 -0
  44. package/src/packageVersion.ts +1 -1
  45. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +1 -0
  46. package/src/summary/summaryDelayLoadedModule/summaryGenerator.ts +8 -8
  47. package/.eslintrc.cjs +0 -30
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,GAGjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAkB,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAEN,mBAAmB,GAGnB,MAAM,gDAAgD,CAAC;AAYxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAS3F,OAAO,EACN,aAAa,EACb,qBAAqB,EACrB,YAAY,GACZ,MAAM,uCAAuC,CAAC;AAgC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EACN,gBAAgB,EAChB,wCAAwC,GACxC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,mBAAmB,EACnB,YAAY,EAEZ,gBAAgB,EAChB,UAAU,EACV,4BAA4B,EAC5B,gCAAgC,EAChC,aAAa,EACb,gBAAgB,GAChB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,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,OAAO,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAEhF,MAAM,KAAK,CAAC,WAAW,CAAC,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;YAEhE,MAAM,CACL,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,EACtB,KAAK,CAAC,2DAA2D,CACjE,CAAC;YAEF,OAAO,gBAAgB,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChB,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,EAAE,KAAK,CAAC,CAAC;YAC1E,2DAA2D;YAC3D,sFAAsF;YACtF,qCAAqC;YACrC,MAAM,KAAK,CAAC;QACb,CAAC,CAAC,CAAC;QAEJ,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;;;OAUG;IACI,wBAAwB,CAAC,OAA+B;QAC9D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,yBAAyB;QACrC,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CACd,mFAAmF,CACnF,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC,yBAAyB,EAAE,CAAC;IAC1C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tTypedEventEmitter,\n\ttype ILayerCompatDetails,\n\ttype IProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\nimport { AttachState, type IAudience } from \"@fluidframework/container-definitions\";\nimport {\n\ttype IDeltaManager,\n\tisIDeltaManagerFull,\n\ttype IDeltaManagerFull,\n\ttype ReadOnlyInfo,\n} from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tITelemetryBaseProperties,\n\tIEvent,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleContext,\n\tIFluidHandleInternal,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, LazyPromise, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tITreeEntry,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tBlobTreeEntry,\n\tisInstanceOfISnapshot,\n\treadAndParse,\n} from \"@fluidframework/driver-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type {\n\tFluidDataStoreMessage,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tIGarbageCollectionData,\n\tCreateChildSummarizerNodeFn,\n\tCreateChildSummarizerNodeParam,\n\tFluidDataStoreContextInternal,\n\tFluidDataStoreRegistryEntry,\n\tIContainerRuntimeBase,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreRegistry,\n\tIGarbageCollectionDetailsBase,\n\tIProvideFluidDataStoreFactory,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n\tIInboundSignalMessage,\n\tIPendingMessagesState,\n\tIRuntimeMessageCollection,\n\tIFluidDataStoreFactory,\n\tPackagePath,\n\tIRuntimeStorageService,\n\tMinimumVersionForCollab,\n\tContainerExtensionId,\n\tContainerExtensionExpectations,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { channelsTreeName } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\taddBlobToSummary,\n\tisSnapshotFetchRequiredForLoadingGroupId,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tDataProcessingError,\n\tLoggingError,\n\ttype MonitoringContext,\n\tThresholdCounter,\n\tUsageError,\n\tcreateChildMonitoringContext,\n\textractSafePropertiesFromMessage,\n\tgenerateStack,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { IFluidParentContextPrivate } from \"./channelCollection.js\";\nimport { BaseDeltaManagerProxy } from \"./deltaManagerProxies.js\";\nimport {\n\truntimeCompatDetailsForDataStore,\n\tvalidateDatastoreCompatibility,\n} from \"./runtimeLayerCompatState.js\";\nimport {\n\t// eslint-disable-next-line import-x/no-deprecated\n\ttype ReadFluidDataStoreAttributes,\n\ttype WriteFluidDataStoreAttributes,\n\tdataStoreAttributesBlobName,\n\tgetAttributesFormatVersion,\n\tgetFluidDataStoreAttributes,\n\thasIsolatedChannels,\n\twrapSummaryInChannelsTree,\n} from \"./summary/index.js\";\n\nfunction createAttributes(\n\tpkg: readonly string[],\n\tisRootDataStore: boolean,\n): WriteFluidDataStoreAttributes {\n\tconst stringifiedPkg = JSON.stringify(pkg);\n\treturn {\n\t\tpkg: stringifiedPkg,\n\t\tsummaryFormatVersion: 2,\n\t\tisRootDataStore,\n\t};\n}\nexport function createAttributesBlob(\n\tpkg: readonly string[],\n\tisRootDataStore: boolean,\n): ITreeEntry {\n\tconst attributes = createAttributes(pkg, isRootDataStore);\n\treturn new BlobTreeEntry(dataStoreAttributesBlobName, JSON.stringify(attributes));\n}\n\nexport interface ISnapshotDetails {\n\tpkg: readonly string[];\n\tisRootDataStore: boolean;\n\tsnapshot?: ISnapshotTree;\n\tsequenceNumber?: number;\n}\n\n/**\n * This is interface that every context should implement.\n * This interface is used for context's parent - ChannelCollection.\n * It should not be exposed to any other users of context.\n */\nexport interface IFluidDataStoreContextPrivate extends FluidDataStoreContextInternal {\n\tgetAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n\tgetAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;\n\n\tgetInitialSnapshotDetails(): Promise<ISnapshotDetails>;\n\n\trealize(): Promise<IFluidDataStoreChannel>;\n\n\tisRoot(): Promise<boolean>;\n}\n\n/**\n * Properties necessary for creating a FluidDataStoreContext\n */\nexport interface IFluidDataStoreContextProps {\n\treadonly id: string;\n\treadonly parentContext: IFluidParentContextPrivate;\n\treadonly storage: IRuntimeStorageService;\n\treadonly scope: FluidObject;\n\treadonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;\n\t/**\n\t * See {@link FluidDataStoreContext.pkg}.\n\t */\n\treadonly pkg?: PackagePath;\n\t/**\n\t * See {@link FluidDataStoreContext.loadingGroupId}.\n\t */\n\treadonly loadingGroupId?: string;\n}\n\n/**\n * Properties necessary for creating a local FluidDataStoreContext\n */\nexport interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {\n\treadonly pkg: readonly string[] | undefined;\n\treadonly snapshotTree: ISnapshotTree | undefined;\n\treadonly makeLocallyVisibleFn: () => void;\n}\n\n/**\n * Properties necessary for creating a local FluidDataStoreContext\n */\nexport interface ILocalDetachedFluidDataStoreContextProps\n\textends ILocalFluidDataStoreContextProps {\n\treadonly channelToDataStoreFn: (channel: IFluidDataStoreChannel) => IDataStore;\n}\n\n/**\n * Properties necessary for creating a remote FluidDataStoreContext\n */\nexport interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {\n\treadonly snapshot: ISnapshotTree | ISnapshot | undefined;\n}\n\n// back-compat: To be removed in the future.\n// Added in \"2.0.0-rc.2.0.0\" timeframe (to support older builds).\nexport interface IFluidDataStoreContextEvents extends IEvent {\n\t(event: \"attaching\" | \"attached\", listener: () => void);\n}\n\n/**\n * Eventually we should remove the delta manger from being exposed to Datastore runtimes via the context. However to remove that exposure we need to add new\n * features, and those features themselves need forward and back compat. This proxy is here to enable that back compat. Each feature this proxy is used to\n * support should be listed below, and as layer compat support goes away for those feature, we should also remove them from this proxy, with the eventual goal\n * of completely removing this proxy.\n *\n * - Everything regarding readonly is to support older datastore runtimes which do not have the setReadonly function, so they must get their readonly state via the delta manager.\n *\n */\nclass ContextDeltaManagerProxy extends BaseDeltaManagerProxy {\n\tconstructor(\n\t\tbase: IDeltaManagerFull,\n\t\tprivate readonly isReadOnly: () => boolean,\n\t) {\n\t\tsuper(base, {\n\t\t\tonReadonly: (): void => {\n\t\t\t\t/* readonly is controlled from the context which calls setReadonly */\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\tconst readonly = this.isReadOnly();\n\t\tif (readonly === this.deltaManager.readOnlyInfo.readonly) {\n\t\t\treturn this.deltaManager.readOnlyInfo;\n\t\t} else {\n\t\t\treturn readonly === true\n\t\t\t\t? {\n\t\t\t\t\t\treadonly,\n\t\t\t\t\t\tforced: false,\n\t\t\t\t\t\tpermissions: undefined,\n\t\t\t\t\t\tstorageOnly: false,\n\t\t\t\t\t}\n\t\t\t\t: { readonly };\n\t\t}\n\t}\n\n\t/**\n\t * Called by the owning datastore context to emit the readonly\n\t * event on the delta manger that is projected down to the datastore\n\t * runtime. This state may not align with that of the true delta\n\t * manager if the context wishes to control the read only state\n\t * differently than the delta manager itself.\n\t */\n\tpublic emitReadonly(): void {\n\t\tthis.emit(\"readonly\", this.isReadOnly());\n\t}\n}\n\n/**\n * {@link IFluidDataStoreContext} for the implementations of {@link IFluidDataStoreChannel} which powers the {@link IDataStore}s.\n */\nexport abstract class FluidDataStoreContext\n\textends TypedEventEmitter<IFluidDataStoreContextEvents>\n\timplements IFluidDataStoreContextPrivate, IDisposable, IProvideLayerCompatDetails\n{\n\tpublic get packagePath(): PackagePath {\n\t\tassert(this.pkg !== undefined, 0x139 /* \"Undefined package path\" */);\n\t\treturn this.pkg;\n\t}\n\n\tpublic get options(): Record<string | number, unknown> {\n\t\treturn this.parentContext.options;\n\t}\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this.parentContext.clientId;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this.parentContext.clientDetails;\n\t}\n\n\tpublic get baseLogger(): ITelemetryBaseLogger {\n\t\treturn this.parentContext.baseLogger;\n\t}\n\n\tprivate readonly _contextDeltaManagerProxy: ContextDeltaManagerProxy;\n\tpublic get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {\n\t\treturn this._contextDeltaManagerProxy;\n\t}\n\n\tprivate isStagingMode: boolean = false;\n\tpublic isReadOnly = (): boolean =>\n\t\t(this.isStagingMode && this.channel?.policies?.readonlyInStagingMode === true) ||\n\t\tthis.parentContext.isReadOnly();\n\n\tpublic get connected(): boolean {\n\t\treturn this.parentContext.connected;\n\t}\n\n\tpublic get IFluidHandleContext(): IFluidHandleContext {\n\t\treturn this.parentContext.IFluidHandleContext;\n\t}\n\n\tpublic get containerRuntime(): IContainerRuntimeBase {\n\t\treturn this._containerRuntime;\n\t}\n\tpublic get isLoaded(): boolean {\n\t\treturn this.loaded;\n\t}\n\n\tpublic get baseSnapshot(): ISnapshotTree | undefined {\n\t\treturn this._baseSnapshot;\n\t}\n\n\tpublic get idCompressor(): IIdCompressor | undefined {\n\t\treturn this.parentContext.idCompressor;\n\t}\n\n\tprivate _disposed = false;\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * A Tombstoned object has been unreferenced long enough that GC knows it won't be referenced again.\n\t * Tombstoned objects are eventually deleted by GC.\n\t */\n\tprivate _tombstoned = false;\n\tpublic get tombstoned(): boolean {\n\t\treturn this._tombstoned;\n\t}\n\t/**\n\t * If true, throw an error when a tombstone data store is used.\n\t * @deprecated NOT SUPPORTED - hardcoded to return false since it's deprecated.\n\t */\n\tpublic readonly gcThrowOnTombstoneUsage: boolean = false;\n\t/**\n\t * @deprecated NOT SUPPORTED - hardcoded to return false since it's deprecated.\n\t */\n\tpublic readonly gcTombstoneEnforcementAllowed: boolean = false;\n\n\t/**\n\t * If true, this means that this data store context and its children have been removed from the runtime\n\t */\n\tprotected deleted: boolean = false;\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._attachState;\n\t}\n\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined {\n\t\treturn this.registry;\n\t}\n\n\t/**\n\t * The compatibility details of the Runtime layer that is exposed to the DataStore layer\n\t * for validating DataStore-Runtime compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn runtimeCompatDetailsForDataStore;\n\t}\n\n\t/**\n\t * {@inheritdoc IFluidDataStoreContext.minVersionForCollab}\n\t */\n\tpublic readonly minVersionForCollab: MinimumVersionForCollab;\n\n\tprivate baseSnapshotSequenceNumber: number | undefined;\n\n\t/**\n\t * A datastore is considered as root if it\n\t * 1. is root in memory - see isInMemoryRoot\n\t * 2. is root as part of the base snapshot that the datastore loaded from\n\t * @returns whether a datastore is root\n\t */\n\tpublic async isRoot(aliasedDataStores?: Set<string>): Promise<boolean> {\n\t\tif (this.isInMemoryRoot()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// This if is a performance optimization.\n\t\t// We know that if the base snapshot is omitted, then the isRootDataStore flag is not set.\n\t\t// That means we can skip the expensive call to getInitialSnapshotDetails for virtualized datastores,\n\t\t// and get the information from the alias map directly.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n\t\tif (aliasedDataStores !== undefined && (this.baseSnapshot as any)?.omitted === true) {\n\t\t\treturn aliasedDataStores.has(this.id);\n\t\t}\n\n\t\tconst snapshotDetails = await this.getInitialSnapshotDetails();\n\t\treturn snapshotDetails.isRootDataStore;\n\t}\n\n\t/**\n\t * There are 3 states where isInMemoryRoot needs to be true\n\t * 1. when a datastore becomes aliased. This can happen for both remote and local datastores\n\t * 2. when a datastore is created locally as root\n\t * 3. when a datastore is created locally as root and is rehydrated\n\t * @returns whether a datastore is root in memory\n\t */\n\tprotected isInMemoryRoot(): boolean {\n\t\treturn this._isInMemoryRoot;\n\t}\n\n\t/**\n\t * Returns the count of pending messages that are stored until the data store is realized.\n\t */\n\tpublic get pendingCount(): number {\n\t\treturn this.pendingMessagesState?.pendingCount ?? 0;\n\t}\n\n\tprotected registry: IFluidDataStoreRegistry | undefined;\n\n\tprotected detachedRuntimeCreation = false;\n\tprotected channel: IFluidDataStoreChannel | undefined;\n\tprivate loaded = false;\n\t/**\n\t * Tracks the messages for this data store that are sent while it's not loaded\n\t */\n\tprivate pendingMessagesState: IPendingMessagesState | undefined = {\n\t\tmessageCollections: [],\n\t\tpendingCount: 0,\n\t};\n\tprotected channelP: Promise<IFluidDataStoreChannel> | undefined;\n\tprotected _baseSnapshot: ISnapshotTree | undefined;\n\tprotected _attachState: AttachState;\n\tprivate _isInMemoryRoot: boolean = false;\n\tprotected readonly summarizerNode: ISummarizerNodeWithGC;\n\tprotected readonly mc: MonitoringContext;\n\tprivate readonly thresholdOpsCounter: ThresholdCounter;\n\tprivate static readonly pendingOpsCountThreshold = 1000;\n\n\t/**\n\t * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.\n\t * So, adding a count of how many telemetry events are logged per data store context. This can be\n\t * controlled via feature flags.\n\t */\n\tprivate localChangesTelemetryCount: number;\n\n\tpublic readonly id: string;\n\tprivate readonly _containerRuntime: IContainerRuntimeBase;\n\t/**\n\t * Information for this data store from its parent.\n\t *\n\t * @remarks\n\t * The parent which provided this information currently can be the container runtime or a datastore (if the datastore this context is for is nested under another one).\n\t */\n\tprivate readonly parentContext: IFluidParentContextPrivate;\n\tpublic readonly storage: IRuntimeStorageService;\n\tpublic readonly scope: FluidObject;\n\t/**\n\t * The loading group to which the data store belongs to.\n\t */\n\tpublic readonly loadingGroupId: string | undefined;\n\t/**\n\t * {@link PackagePath} of this data store.\n\t *\n\t * This can be undefined when a data store is delay loaded, i.e., the attributes of this data store in the snapshot are not fetched until this data store is actually used.\n\t * At that time, the attributes blob is fetched and the pkg is updated from it.\n\t *\n\t * @see {@link PackagePath}.\n\t * @see {@link IFluidDataStoreContext.packagePath}.\n\t * @see {@link factoryFromPackagePath}.\n\t */\n\tprotected pkg?: PackagePath;\n\n\tpublic constructor(\n\t\tprops: IFluidDataStoreContextProps,\n\t\tprivate readonly existing: boolean,\n\t\tpublic readonly isLocalDataStore: boolean,\n\t\tprivate readonly makeLocallyVisibleFn: () => void,\n\t) {\n\t\tsuper();\n\n\t\tthis._containerRuntime = props.parentContext.containerRuntime;\n\t\tthis.parentContext = props.parentContext;\n\t\tthis.minVersionForCollab = props.parentContext.minVersionForCollab;\n\t\tthis.id = props.id;\n\t\tthis.storage = props.storage;\n\t\tthis.scope = props.scope;\n\t\tthis.pkg = props.pkg;\n\t\tthis.loadingGroupId = props.loadingGroupId;\n\n\t\t// URIs use slashes as delimiters. Handles use URIs.\n\t\t// Thus having slashes in types almost guarantees trouble down the road!\n\t\tassert(!this.id.includes(\"/\"), 0x13a /* Data store ID contains slash */);\n\n\t\tthis._attachState =\n\t\t\tthis.parentContext.attachState !== AttachState.Detached && this.existing\n\t\t\t\t? this.parentContext.attachState\n\t\t\t\t: AttachState.Detached;\n\n\t\tthis.summarizerNode = props.createSummarizerNodeFn(\n\t\t\tasync (fullTree, trackState, telemetryContext) =>\n\t\t\t\tthis.summarizeInternal(fullTree, trackState, telemetryContext),\n\t\t\tasync (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n\t\t);\n\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: this.baseLogger,\n\t\t\tnamespace: \"FluidDataStoreContext\",\n\t\t\tproperties: {\n\t\t\t\tall: tagCodeArtifacts({\n\t\t\t\t\tfluidDataStoreId: this.id,\n\t\t\t\t\t// The package name is a getter because `this.pkg` may not be initialized during construction.\n\t\t\t\t\t// For data stores loaded from summary, it is initialized during data store realization.\n\t\t\t\t\tfullPackageName: () => this.pkg?.join(\"/\"),\n\t\t\t\t}),\n\t\t\t},\n\t\t});\n\t\tthis.thresholdOpsCounter = new ThresholdCounter(\n\t\t\tFluidDataStoreContext.pendingOpsCountThreshold,\n\t\t\tthis.mc.logger,\n\t\t);\n\n\t\t// By default, a data store can log maximum 10 local changes telemetry in summarizer.\n\t\tthis.localChangesTelemetryCount =\n\t\t\tthis.mc.config.getNumber(\"Fluid.Telemetry.LocalChangesTelemetryCount\") ?? 10;\n\n\t\tassert(\n\t\t\tisIDeltaManagerFull(this.parentContext.deltaManager),\n\t\t\t0xb83 /* Invalid delta manager */,\n\t\t);\n\n\t\tthis._contextDeltaManagerProxy = new ContextDeltaManagerProxy(\n\t\t\tthis.parentContext.deltaManager,\n\t\t\t() => this.isReadOnly(),\n\t\t);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._disposed = true;\n\n\t\t// Dispose any pending runtime after it gets fulfilled\n\t\t// Errors are logged where this.channelP is consumed/generated (realizeCore(), bindRuntime())\n\t\tif (this.channelP) {\n\t\t\tthis.channelP\n\t\t\t\t.then((runtime) => {\n\t\t\t\t\truntime.dispose();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {});\n\t\t}\n\t\tthis._contextDeltaManagerProxy.dispose();\n\t}\n\n\t/**\n\t * When delete is called, that means that the data store is permanently removed from the runtime, and will not show up in future summaries\n\t * This function is called to prevent ops from being generated from this data store once it has been deleted. Furthermore, this data store\n\t * should not receive any ops/signals.\n\t */\n\tpublic delete(): void {\n\t\tthis.deleted = true;\n\t}\n\n\tpublic setTombstone(tombstone: boolean): void {\n\t\tif (this.tombstoned === tombstone) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tombstoned = tombstone;\n\t}\n\n\tpublic abstract setAttachState(\n\t\tattachState: AttachState.Attaching | AttachState.Attached,\n\t): void;\n\n\t/**\n\t * Throw a {@link LoggingError} indicating that {@link factoryFromPackagePath} failed.\n\t */\n\tprivate factoryFromPackagePathError(\n\t\treason: string,\n\t\tfailedPkgPath?: string,\n\t\tfullPackageName?: PackagePath,\n\t): never {\n\t\tthrow new LoggingError(\n\t\t\treason,\n\t\t\ttagCodeArtifacts({\n\t\t\t\tfailedPkgPath,\n\t\t\t\tpackagePath: fullPackageName?.join(\"/\"),\n\t\t\t}),\n\t\t);\n\t}\n\n\tpublic async realize(): Promise<IFluidDataStoreChannel> {\n\t\tassert(\n\t\t\t!this.detachedRuntimeCreation,\n\t\t\t0x13d /* \"Detached runtime creation on realize()\" */,\n\t\t);\n\t\tif (!this.channelP) {\n\t\t\tthis.channelP = this.realizeCore(this.existing).catch((error) => {\n\t\t\t\tconst errorWrapped = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\t\terror,\n\t\t\t\t\t\"realizeFluidDataStoreContext\",\n\t\t\t\t);\n\t\t\t\terrorWrapped.addTelemetryProperties(\n\t\t\t\t\ttagCodeArtifacts({\n\t\t\t\t\t\tfullPackageName: this.pkg?.join(\"/\"),\n\t\t\t\t\t\tfluidDataStoreId: this.id,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthis.mc.logger.sendErrorEvent({ eventName: \"RealizeError\" }, errorWrapped);\n\t\t\t\tthrow errorWrapped;\n\t\t\t});\n\t\t}\n\t\treturn this.channelP;\n\t}\n\n\t/**\n\t * Gets the factory that would be used to instantiate this data store by calling `instantiateDataStore` based on {@link pkg}.\n\t * @remarks\n\t * Also populates {@link registry}.\n\t *\n\t * Must be called after {@link pkg} is set, and only called once.\n\t *\n\t * @see {@link @fluidframework/container-runtime-definitions#IContainerRuntimeBase.createDataStore}.\n\t * @see {@link FluidDataStoreContext.pkg}.\n\t */\n\tprotected async factoryFromPackagePath(): Promise<IFluidDataStoreFactory> {\n\t\tconst path = this.pkg;\n\t\tif (path === undefined) {\n\t\t\tthis.factoryFromPackagePathError(\"packages is undefined\");\n\t\t}\n\n\t\tlet entry: FluidDataStoreRegistryEntry | undefined;\n\t\tlet registry: IFluidDataStoreRegistry | undefined =\n\t\t\tthis.parentContext.IFluidDataStoreRegistry;\n\t\tlet lastIdentifier: string | undefined;\n\t\t// Follow the path, looking up each identifier in the registry along the way:\n\t\tfor (const identifier of path) {\n\t\t\tif (!registry) {\n\t\t\t\tthis.factoryFromPackagePathError(\"No registry for package\", lastIdentifier, path);\n\t\t\t}\n\t\t\tlastIdentifier = identifier;\n\t\t\tentry = registry.getSync?.(identifier) ?? (await registry.get(identifier));\n\t\t\tif (!entry) {\n\t\t\t\tthis.factoryFromPackagePathError(\n\t\t\t\t\t\"Registry does not contain entry for the package\",\n\t\t\t\t\tidentifier,\n\t\t\t\t\tpath,\n\t\t\t\t);\n\t\t\t}\n\t\t\tregistry = entry.IFluidDataStoreRegistry;\n\t\t}\n\t\tconst factory = entry?.IFluidDataStoreFactory;\n\t\tif (factory === undefined) {\n\t\t\tthis.factoryFromPackagePathError(\"Can't find factory for package\", lastIdentifier, path);\n\t\t}\n\n\t\tassert(this.registry === undefined, 0x157 /* \"datastore registry already attached\" */);\n\t\tthis.registry = registry;\n\n\t\treturn factory;\n\t}\n\n\tpublic createChildDataStore<T extends IFluidDataStoreFactory>(\n\t\tchildFactory: T,\n\t): ReturnType<Exclude<T[\"createDataStore\"], undefined>> {\n\t\tconst maybe = this.registry?.getSync?.(childFactory.type);\n\n\t\tconst isUndefined = maybe === undefined;\n\t\tconst diffInstance = maybe?.IFluidDataStoreFactory !== childFactory;\n\n\t\tif (isUndefined || diffInstance) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"The provided factory instance must be synchronously available as a child of this datastore\",\n\t\t\t\t{ isUndefined, diffInstance },\n\t\t\t);\n\t\t}\n\t\tif (childFactory?.createDataStore === undefined) {\n\t\t\tthrow new UsageError(\"createDataStore must exist on the provided factory\", {\n\t\t\t\tnoCreateDataStore: true,\n\t\t\t});\n\t\t}\n\n\t\tconst context = this._containerRuntime.createDetachedDataStore([\n\t\t\t...this.packagePath,\n\t\t\tchildFactory.type,\n\t\t]);\n\t\tassert(\n\t\t\tcontext instanceof LocalDetachedFluidDataStoreContext,\n\t\t\t0xa89 /* must be a LocalDetachedFluidDataStoreContext */,\n\t\t);\n\n\t\tconst created = childFactory.createDataStore(context) as ReturnType<\n\t\t\tExclude<T[\"createDataStore\"], undefined>\n\t\t>;\n\t\tcontext.unsafe_AttachRuntimeSync(created.runtime);\n\t\treturn created;\n\t}\n\n\tprivate async realizeCore(existing: boolean): Promise<IFluidDataStoreChannel> {\n\t\tconst details = await this.getInitialSnapshotDetails();\n\t\t// Base snapshot is the baseline where pending ops are applied to.\n\t\t// It is important that this be in sync with the pending ops, and also\n\t\t// that it is set here, before bindRuntime is called.\n\t\tthis._baseSnapshot = details.snapshot;\n\t\tthis.baseSnapshotSequenceNumber = details.sequenceNumber;\n\t\tassert(this.pkg === details.pkg, 0x13e /* \"Unexpected package path\" */);\n\n\t\tconst factory = await this.factoryFromPackagePath();\n\n\t\tconst channel = await factory.instantiateDataStore(this, existing);\n\t\tassert(channel !== undefined, 0x140 /* \"undefined channel on datastore context\" */);\n\n\t\tawait this.bindRuntime(channel, existing);\n\t\t// This data store may have been disposed before the channel is created during realization. If so,\n\t\t// dispose the channel now.\n\t\tif (this.disposed) {\n\t\t\tchannel.dispose();\n\t\t}\n\n\t\treturn channel;\n\t}\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. Its old ID when in disconnected state and\n\t * its new client ID when we are connecting or connected.\n\t */\n\tpublic setConnectionState(connected: boolean, clientId?: string): void {\n\t\t// ConnectionState should not fail in tombstone mode as this is internally run\n\t\tthis.verifyNotClosed(\"setConnectionState\", false /* checkTombstone */);\n\n\t\t// Connection events are ignored if the store is not yet loaded\n\t\tif (!this.loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tassert(this.connected === connected, 0x141 /* \"Unexpected connected state\" */);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tthis.channel!.setConnectionState(connected, clientId);\n\t}\n\n\tpublic notifyReadOnlyState(): void {\n\t\tthis.verifyNotClosed(\"notifyReadOnlyState\", false /* checkTombstone */);\n\n\t\t// These two calls achieve the same purpose, and are both needed for a time for back compat\n\t\tthis.channel?.notifyReadOnlyState?.(this.isReadOnly());\n\t\tthis._contextDeltaManagerProxy.emitReadonly();\n\t}\n\n\t/**\n\t * Updates the readonly state of the data store based on the staging mode.\n\t *\n\t * @param staging - A boolean indicating whether the container is in staging mode.\n\t * If true, the data store is set to readonly unless explicitly allowed by its policies.\n\t */\n\tpublic notifyStagingMode(staging: boolean): void {\n\t\t// If the `readonlyInStagingMode` policy is not explicitly set to `false`,\n\t\t// the data store is treated as readonly in staging mode.\n\t\tconst oldReadOnlyState = this.isReadOnly();\n\t\tthis.isStagingMode = staging;\n\t\tif (this.isReadOnly() !== oldReadOnlyState) {\n\t\t\tthis.notifyReadOnlyState();\n\t\t}\n\t}\n\n\t/**\n\t * Process messages for this data store. The messages here are contiguous messages for this data store in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tpublic processMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tconst safeTelemetryProps = extractSafePropertiesFromMessage(envelope);\n\t\t// Tombstone error is logged in garbage collector. So, set \"checkTombstone\" to false when calling\n\t\t// \"verifyNotClosed\" which logs tombstone errors.\n\t\tthis.verifyNotClosed(\"process\", false /* checkTombstone */, safeTelemetryProps);\n\n\t\tthis.summarizerNode.recordChange(envelope as ISequencedDocumentMessage);\n\n\t\tif (this.loaded) {\n\t\t\tassert(this.channel !== undefined, 0xa68 /* Channel is not loaded */);\n\t\t\tthis.channel.processMessages(messageCollection);\n\t\t} else {\n\t\t\tassert(!local, 0x142 /* \"local store channel is not loaded\" */);\n\t\t\tassert(\n\t\t\t\tthis.pendingMessagesState !== undefined,\n\t\t\t\t0xa69 /* pending messages queue is undefined */,\n\t\t\t);\n\t\t\tthis.pendingMessagesState.messageCollections.push({\n\t\t\t\t...messageCollection,\n\t\t\t\tmessagesContent: [...messagesContent],\n\t\t\t});\n\t\t\tthis.pendingMessagesState.pendingCount += messagesContent.length;\n\t\t\tthis.thresholdOpsCounter.sendIfMultiple(\n\t\t\t\t\"StorePendingOps\",\n\t\t\t\tthis.pendingMessagesState.pendingCount,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic processSignal(message: IInboundSignalMessage, local: boolean): void {\n\t\tthis.verifyNotClosed(\"processSignal\");\n\n\t\t// Signals are ignored if the store is not yet loaded\n\t\tif (!this.loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.channel?.processSignal(message, local);\n\t}\n\n\tpublic getQuorum(): IQuorumClients {\n\t\treturn this.parentContext.getQuorum();\n\t}\n\n\tpublic getAudience(): IAudience {\n\t\treturn this.parentContext.getAudience();\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\treturn this.summarizerNode.summarize(fullTree, trackState, telemetryContext);\n\t}\n\n\tprivate async summarizeInternal(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeInternalResult> {\n\t\tawait this.realize();\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst summarizeResult = await this.channel!.summarize(\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t);\n\n\t\t// Wrap dds summaries in .channels subtree.\n\t\twrapSummaryInChannelsTree(summarizeResult);\n\t\tconst pathPartsForChildren = [channelsTreeName];\n\n\t\t// Add data store's attributes to the summary.\n\t\tconst { pkg } = await this.getInitialSnapshotDetails();\n\t\tconst isRoot = await this.isRoot();\n\t\tconst attributes = createAttributes(pkg, isRoot);\n\t\taddBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));\n\n\t\t// If we are not referenced, mark the summary tree as unreferenced. Also, update unreferenced blob\n\t\t// size in the summary stats with the blobs size of this data store.\n\t\tif (!this.summarizerNode.isReferenced()) {\n\t\t\tsummarizeResult.summary.unreferenced = true;\n\t\t\tsummarizeResult.stats.unreferencedBlobSize = summarizeResult.stats.totalBlobSize;\n\t\t}\n\n\t\t// Add loadingGroupId to the summary\n\t\tif (this.loadingGroupId !== undefined) {\n\t\t\tsummarizeResult.summary.groupId = this.loadingGroupId;\n\t\t}\n\n\t\treturn {\n\t\t\t...summarizeResult,\n\t\t\tid: this.id,\n\t\t\tpathPartsForChildren,\n\t\t};\n\t}\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this data store\n\t * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the\n\t * document.\n\t * If there is no new data in this data store since the last summary, previous GC data is used.\n\t * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\treturn this.summarizerNode.getGCData(fullGC);\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. This is called when there is new data since last summary. It\n\t * realizes the data store and calls into each channel context to get its GC data.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tprivate async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tawait this.realize();\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x143 /* \"Channel should not be undefined when running GC\" */,\n\t\t);\n\n\t\treturn this.channel.getGCData(fullGC);\n\t}\n\n\t/**\n\t * After GC has run, called to notify the data store of routes used in it. These are used for the following:\n\t * 1. To identify if this data store is being referenced in the document or not.\n\t * 2. To determine if it needs to re-summarize in case used routes changed since last summary.\n\t * 3. To notify child contexts of their used routes. This is done immediately if the data store is loaded.\n\t * Else, it is done by the data stores's summarizer node when child summarizer nodes are created.\n\t *\n\t * @param usedRoutes - The routes that are used in this data store.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: string[]): void {\n\t\t// Update the used routes in this data store's summarizer node.\n\t\tthis.summarizerNode.updateUsedRoutes(usedRoutes);\n\n\t\t// If the channel doesn't exist yet (data store is not realized), the summarizer node will update it\n\t\t// when it creates child nodes.\n\t\tif (!this.channel) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the route to this data store, if it exists.\n\t\tconst usedChannelRoutes = usedRoutes.filter((id: string) => {\n\t\t\treturn id !== \"/\" && id !== \"\";\n\t\t});\n\t\tthis.channel.updateUsedRoutes(usedChannelRoutes);\n\t}\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t *\n\t * @param fromPath - The absolute path of the node that added the reference.\n\t * @param toPath - The absolute path of the outbound node that is referenced.\n\t * @param messageTimestampMs - The timestamp of the message that added the reference.\n\t */\n\tpublic addedGCOutboundRoute(\n\t\tfromPath: string,\n\t\ttoPath: string,\n\t\tmessageTimestampMs?: number,\n\t): void {\n\t\tthis.parentContext.addedGCOutboundRoute(fromPath, toPath, messageTimestampMs);\n\t}\n\n\tpublic submitMessage(type: string, content: unknown, localOpMetadata: unknown): void {\n\t\tthis.verifyNotClosed(\"submitMessage\");\n\t\tassert(!!this.channel, 0x146 /* \"Channel must exist when submitting message\" */);\n\t\t// Readonly clients should not submit messages.\n\t\tthis.identifyLocalChangeIfReadonly(\"DataStoreMessageWhileReadonly\", type);\n\n\t\tthis.parentContext.submitMessage(type, content, localOpMetadata);\n\t}\n\n\t/**\n\t * This is called from a SharedSummaryBlock that does not generate ops but only wants to be part of the summary.\n\t * It indicates that there is data in the object that needs to be summarized.\n\t * We will update the latestSequenceNumber of the summary tracker of this\n\t * store and of the object's channel.\n\t *\n\t * @param address - The address of the channel that is dirty.\n\t *\n\t */\n\tpublic setChannelDirty(address: string): void {\n\t\tthis.verifyNotClosed(\"setChannelDirty\");\n\n\t\t// Get the latest sequence number.\n\t\tconst latestSequenceNumber = this.deltaManager.lastSequenceNumber;\n\n\t\tthis.summarizerNode.invalidate(latestSequenceNumber);\n\n\t\tconst channelSummarizerNode = this.summarizerNode.getChild(address);\n\n\t\tif (channelSummarizerNode) {\n\t\t\tchannelSummarizerNode.invalidate(latestSequenceNumber); // TODO: lazy load problem?\n\t\t}\n\t}\n\n\tpublic submitSignal(type: string, content: unknown, targetClientId?: string): void {\n\t\tthis.verifyNotClosed(\"submitSignal\");\n\n\t\tassert(!!this.channel, 0x147 /* \"Channel must exist on submitting signal\" */);\n\t\treturn this.parentContext.submitSignal(type, content, targetClientId);\n\t}\n\n\t/**\n\t * This is called by the data store channel when it becomes locally visible indicating that it is ready to become\n\t * globally visible now.\n\t */\n\tpublic makeLocallyVisible(): void {\n\t\tassert(this.channel !== undefined, 0x2cf /* \"undefined channel on datastore context\" */);\n\t\tthis.makeLocallyVisibleFn();\n\t}\n\n\tprotected processPendingOps(channel: IFluidDataStoreChannel): void {\n\t\tconst baseSequenceNumber = this.baseSnapshotSequenceNumber ?? -1;\n\n\t\tassert(\n\t\t\tthis.pendingMessagesState !== undefined,\n\t\t\t0xa6a /* pending messages queue is undefined */,\n\t\t);\n\t\tfor (const messageCollection of this.pendingMessagesState.messageCollections) {\n\t\t\t// Only process ops whose seq number is greater than snapshot sequence number from which it loaded.\n\t\t\tif (messageCollection.envelope.sequenceNumber > baseSequenceNumber) {\n\t\t\t\tchannel.processMessages(messageCollection);\n\t\t\t}\n\t\t}\n\n\t\tthis.thresholdOpsCounter.send(\"ProcessPendingOps\", this.pendingMessagesState.pendingCount);\n\t\tthis.pendingMessagesState = undefined;\n\t}\n\n\tprotected completeBindingRuntime(channel: IFluidDataStoreChannel): void {\n\t\t// Validate that the DataStore is compatible with this Runtime.\n\t\tconst maybeDataStoreCompatDetails = channel as FluidObject<ILayerCompatDetails>;\n\t\tvalidateDatastoreCompatibility(\n\t\t\tmaybeDataStoreCompatDetails.ILayerCompatDetails,\n\t\t\tthis.dispose.bind(this),\n\t\t\tthis.mc,\n\t\t);\n\n\t\t// And now mark the runtime active\n\t\tthis.loaded = true;\n\t\tthis.channel = channel;\n\n\t\t// Channel does not know when it's \"live\" (as in - starts to receive events in the system)\n\t\t// It may read current state of the system when channel was created, but it was not getting any updates\n\t\t// through creation process and could have missed events. So update it on current state.\n\t\t// Once this.loaded is set (above), it will stat receiving events.\n\t\tchannel.setConnectionState(this.connected, this.clientId);\n\n\t\t// Freeze the package path to ensure that someone doesn't modify it when it is\n\t\t// returned in packagePath().\n\t\tObject.freeze(this.pkg);\n\t}\n\n\tprotected async bindRuntime(\n\t\tchannel: IFluidDataStoreChannel,\n\t\texisting: boolean,\n\t): Promise<void> {\n\t\tif (this.channel) {\n\t\t\tthrow new Error(\"Runtime already bound\");\n\t\t}\n\n\t\tassert(\n\t\t\t!this.detachedRuntimeCreation,\n\t\t\t0x148 /* \"Detached runtime creation on runtime bind\" */,\n\t\t);\n\t\tassert(this.pkg !== undefined, 0x14a /* \"Undefined package path\" */);\n\n\t\tif (!existing) {\n\t\t\t// Execute data store's entry point to make sure that for a local (aka detached from container) data store, the\n\t\t\t// entryPoint initialization function is called before the data store gets attached and potentially connected to\n\t\t\t// the delta stream, so it gets a chance to do things while the data store is still \"purely local\".\n\t\t\t// This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method\n\t\t\t// of data store factories tends to construct the data object (at least kick off an async method that returns\n\t\t\t// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes\n\t\t\t// before the data store is attached.\n\t\t\tawait channel.entryPoint.get();\n\t\t}\n\n\t\tthis.processPendingOps(channel);\n\t\tthis.completeBindingRuntime(channel);\n\t}\n\n\tpublic async getAbsoluteUrl(relativeUrl: string): Promise<string | undefined> {\n\t\tif (this.attachState !== AttachState.Attached) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.parentContext.getAbsoluteUrl(relativeUrl);\n\t}\n\n\t/**\n\t * Get the summary required when attaching this context's DataStore.\n\t * Used for both Container Attach and DataStore Attach.\n\t */\n\tpublic abstract getAttachSummary(\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats;\n\n\t/**\n\t * Get the GC Data for the initial state being attached so remote clients can learn of this DataStore's\n\t * outbound routes.\n\t */\n\tpublic abstract getAttachGCData(\n\t\ttelemetryContext?: ITelemetryContext,\n\t): IGarbageCollectionData;\n\n\tpublic abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;\n\n\t// eslint-disable-next-line jsdoc/require-description\n\t/**\n\t * @deprecated Sets the datastore as root, for aliasing purposes: #7948\n\t * This method should not be used outside of the aliasing context.\n\t * It will be removed, as the source of truth for this flag will be the aliasing blob.\n\t */\n\tpublic setInMemoryRoot(): void {\n\t\tthis._isInMemoryRoot = true;\n\t}\n\n\t// eslint-disable-next-line jsdoc/require-description\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tpublic async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {\n\t\treturn {};\n\t}\n\n\tpublic reSubmit(\n\t\tmessage: FluidDataStoreMessage,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash: boolean,\n\t): void {\n\t\tassert(!!this.channel, 0x14b /* \"Channel must exist when resubmitting ops\" */);\n\t\tthis.channel.reSubmit(message.type, message.content, localOpMetadata, squash);\n\t}\n\n\tpublic rollback(message: FluidDataStoreMessage, localOpMetadata: unknown): void {\n\t\tif (!this.channel) {\n\t\t\tthrow new Error(\"Channel must exist when rolling back ops\");\n\t\t}\n\t\tif (!this.channel.rollback) {\n\t\t\tthrow new Error(\"Channel doesn't support rollback\");\n\t\t}\n\t\tthis.channel.rollback(message.type, message.content, localOpMetadata);\n\t}\n\n\tpublic async applyStashedOp(contents: unknown): Promise<unknown> {\n\t\tif (!this.channel) {\n\t\t\tawait this.realize();\n\t\t}\n\t\tassert(!!this.channel, 0x14c /* \"Channel must exist when rebasing ops\" */);\n\t\treturn this.channel.applyStashedOp(contents);\n\t}\n\n\tprivate verifyNotClosed(\n\t\tcallSite: string,\n\t\tcheckTombstone = true,\n\t\tsafeTelemetryProps: ITelemetryBaseProperties = {},\n\t): void {\n\t\tif (this.deleted) {\n\t\t\tconst messageString = `Context is deleted! Call site [${callSite}]`;\n\t\t\tconst error = DataProcessingError.create(\n\t\t\t\tmessageString,\n\t\t\t\tcallSite,\n\t\t\t\tundefined /* sequencedMessage */,\n\t\t\t\tsafeTelemetryProps,\n\t\t\t);\n\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"GC_Deleted_DataStore_Changed\",\n\t\t\t\t\tcallSite,\n\t\t\t\t},\n\t\t\t\terror,\n\t\t\t);\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this._disposed) {\n\t\t\tthrow new Error(`Context is closed! Call site [${callSite}]`);\n\t\t}\n\n\t\tif (checkTombstone && this.tombstoned) {\n\t\t\tconst messageString = `Context is tombstoned! Call site [${callSite}]`;\n\t\t\tconst error = DataProcessingError.create(\n\t\t\t\tmessageString,\n\t\t\t\tcallSite,\n\t\t\t\tundefined /* sequencedMessage */,\n\t\t\t\tsafeTelemetryProps,\n\t\t\t\t30 /* stackTraceLimit */,\n\t\t\t);\n\n\t\t\tthis.mc.logger.sendTelemetryEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"GC_Tombstone_DataStore_Changed\",\n\t\t\t\t\tcategory: \"generic\",\n\t\t\t\t\tcallSite,\n\t\t\t\t},\n\t\t\t\terror,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Readonly client, including summarizer, should not have local changes. These changes can become part of the summary and can break\n\t * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas\n\t * other clients that are up-to-date till seq# 100 may not have them yet.\n\t */\n\tprotected identifyLocalChangeIfReadonly(eventName: string, type?: string): void {\n\t\tif (!this.isReadOnly() || this.localChangesTelemetryCount <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Log a telemetry if there are local changes in readonly. This will give us data on how often\n\t\t// this is happening and which data stores do this. The eventual goal is to disallow local changes\n\t\t// in the summarizer and the data will help us plan this.\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName,\n\t\t\ttype,\n\t\t\tisSummaryInProgress: this.summarizerNode.isSummaryInProgress?.(),\n\t\t\tstack: generateStack(30),\n\t\t\treadonly: this.isReadOnly(),\n\t\t\tisStagingMode: this.isStagingMode,\n\t\t});\n\t\tthis.localChangesTelemetryCount--;\n\t}\n\n\tpublic getCreateChildSummarizerNodeFn(\n\t\tid: string,\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t) {\n\t\treturn (\n\t\t\tsummarizeInternal: SummarizeInternalFn,\n\t\t\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\t): ISummarizerNodeWithGC =>\n\t\t\tthis.summarizerNode.createChild(\n\t\t\t\tsummarizeInternal,\n\t\t\t\tid,\n\t\t\t\tcreateParam,\n\t\t\t\tundefined /* config */,\n\t\t\t\tgetGCDataFn,\n\t\t\t);\n\t}\n\n\tpublic deleteChildSummarizerNode(id: string): void {\n\t\tthis.summarizerNode.deleteChild(id);\n\t}\n\n\tpublic async uploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternal<ArrayBufferLike>> {\n\t\treturn this.parentContext.uploadBlob(blob, signal);\n\t}\n\n\tpublic getExtension<TInterface, TUseContext extends unknown[] = []>(\n\t\tid: ContainerExtensionId,\n\t\trequirements: ContainerExtensionExpectations,\n\t\t...context: TUseContext\n\t): TInterface {\n\t\treturn this.parentContext.getExtension(id, requirements, ...context);\n\t}\n}\n\n/**\n * @internal\n */\nexport class RemoteFluidDataStoreContext extends FluidDataStoreContext {\n\t// Tells whether we need to fetch the snapshot before use. This is to support Data Virtualization.\n\tprivate snapshotFetchRequired: boolean | undefined;\n\tprivate readonly runtime: IContainerRuntimeBase;\n\tprivate readonly blobContents: Map<string, ArrayBuffer> | undefined;\n\tprivate readonly isSnapshotInISnapshotFormat: boolean;\n\n\tconstructor(props: IRemoteFluidDataStoreContextProps) {\n\t\tsuper(props, true /* existing */, false /* isLocalDataStore */, () => {\n\t\t\tthrow new Error(\"Already attached\");\n\t\t});\n\n\t\tthis.runtime = props.parentContext.containerRuntime;\n\t\tif (isInstanceOfISnapshot(props.snapshot)) {\n\t\t\tthis.blobContents = props.snapshot.blobContents;\n\t\t\tthis._baseSnapshot = props.snapshot.snapshotTree;\n\t\t\tthis.isSnapshotInISnapshotFormat = true;\n\t\t} else {\n\t\t\tthis._baseSnapshot = props.snapshot;\n\t\t\tthis.isSnapshotInISnapshotFormat = false;\n\t\t}\n\t}\n\n\t/**\n\t * This API should not be called for RemoteFluidDataStoreContext. But here is one scenario where it's not the case:\n\t * The scenario (hit by stashedOps.spec.ts, \"resends attach op\" UT is the following (as far as I understand):\n\t *\n\t * 1. data store is being attached in attached container\n\t *\n\t * 2. container state is serialized (stashed ops feature)\n\t *\n\t * 3. new container instance is rehydrated (from stashed ops) -\n\t * As result, we create RemoteFluidDataStoreContext for this data store that is actually in \"attaching\" state * (as of # 2).\n\t * But its state is set to attached when loading container from stashed ops.\n\t *\n\t * 4. attach op for this data store is processed - setAttachState() is called.\n\t */\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {}\n\n\t// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda\n\tprivate readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {\n\t\t// Sequence number of the snapshot.\n\t\tlet sequenceNumber: number | undefined;\n\t\t// Check whether we need to fetch the snapshot first to load. The snapshot should be in new format to see\n\t\t// whether we want to evaluate to fetch snapshot or not for loadingGroupId. Otherwise, the snapshot\n\t\t// will contain all the blobs.\n\t\tif (\n\t\t\tthis.snapshotFetchRequired === undefined &&\n\t\t\tthis._baseSnapshot?.groupId !== undefined &&\n\t\t\tthis.isSnapshotInISnapshotFormat\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.blobContents !== undefined,\n\t\t\t\t0x97a /* Blob contents should be present to evaluate */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tthis._baseSnapshot !== undefined,\n\t\t\t\t0x97b /* snapshotTree should be present to evaluate */,\n\t\t\t);\n\t\t\tthis.snapshotFetchRequired = isSnapshotFetchRequiredForLoadingGroupId(\n\t\t\t\tthis._baseSnapshot,\n\t\t\t\tthis.blobContents,\n\t\t\t);\n\t\t}\n\t\tif (this.snapshotFetchRequired === true) {\n\t\t\tassert(\n\t\t\t\tthis.loadingGroupId !== undefined,\n\t\t\t\t0x8f5 /* groupId should be present to fetch snapshot */,\n\t\t\t);\n\t\t\tconst snapshot = await this.runtime.getSnapshotForLoadingGroupId(\n\t\t\t\t[this.loadingGroupId],\n\t\t\t\t[this.id],\n\t\t\t);\n\t\t\tthis._baseSnapshot = snapshot.snapshotTree;\n\t\t\tsequenceNumber = snapshot.sequenceNumber;\n\t\t\tthis.snapshotFetchRequired = false;\n\t\t}\n\t\tlet tree = this.baseSnapshot;\n\t\tlet isRootDataStore = true;\n\n\t\tif (!!tree && tree.blobs[dataStoreAttributesBlobName] !== undefined) {\n\t\t\t// Need to get through snapshot and use that to populate extraBlobs\n\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\tconst attributes = await readAndParse<ReadFluidDataStoreAttributes>(\n\t\t\t\tthis.storage,\n\t\t\t\ttree.blobs[dataStoreAttributesBlobName],\n\t\t\t);\n\n\t\t\tlet pkgFromSnapshot: string[];\n\t\t\t// Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.\n\t\t\t// For snapshotFormatVersion = \"0.1\" (1) or above, pkg is jsonified, otherwise it is just a string.\n\t\t\tconst formatVersion = getAttributesFormatVersion(attributes);\n\t\t\tif (formatVersion < 1) {\n\t\t\t\tpkgFromSnapshot =\n\t\t\t\t\tattributes.pkg.startsWith('[\"') && attributes.pkg.endsWith('\"]')\n\t\t\t\t\t\t? (JSON.parse(attributes.pkg) as string[])\n\t\t\t\t\t\t: [attributes.pkg];\n\t\t\t} else {\n\t\t\t\tpkgFromSnapshot = JSON.parse(attributes.pkg) as string[];\n\t\t\t}\n\t\t\tthis.pkg = pkgFromSnapshot;\n\n\t\t\t/**\n\t\t\t * If there is no isRootDataStore in the attributes blob, set it to true. This will ensure that\n\t\t\t * data stores in older documents are not garbage collected incorrectly. This may lead to additional\n\t\t\t * roots in the document but they won't break.\n\t\t\t */\n\t\t\tisRootDataStore = attributes.isRootDataStore ?? true;\n\n\t\t\tif (hasIsolatedChannels(attributes)) {\n\t\t\t\ttree = tree.trees[channelsTreeName];\n\t\t\t\tassert(\n\t\t\t\t\ttree !== undefined,\n\t\t\t\t\t0x1fe /* \"isolated channels subtree should exist in remote datastore snapshot\" */,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tassert(\n\t\t\tthis.pkg !== undefined,\n\t\t\t0x8f6 /* The datastore context package should be defined */,\n\t\t);\n\t\treturn {\n\t\t\tpkg: this.pkg,\n\t\t\tisRootDataStore,\n\t\t\tsnapshot: tree,\n\t\t\tsequenceNumber,\n\t\t};\n\t});\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\treturn this.initialSnapshotDetailsP;\n\t}\n\n\t/**\n\t * {@inheritDoc FluidDataStoreContext.getAttachSummary}\n\t */\n\tpublic getAttachSummary(): ISummaryTreeWithStats {\n\t\tthrow new Error(\"Cannot attach remote store\");\n\t}\n\n\t/**\n\t * {@inheritDoc FluidDataStoreContext.getAttachGCData}\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tthrow new Error(\"Cannot attach remote store\");\n\t}\n}\n\n/**\n * Base class for detached & attached context classes\n * @internal\n */\nexport class LocalFluidDataStoreContextBase extends FluidDataStoreContext {\n\tprivate readonly snapshotTree: ISnapshotTree | undefined;\n\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(\n\t\t\tprops,\n\t\t\tprops.snapshotTree !== undefined /* existing */,\n\t\t\ttrue /* isLocalDataStore */,\n\t\t\tprops.makeLocallyVisibleFn,\n\t\t);\n\n\t\t// Summarizer client should not create local data stores.\n\t\tthis.identifyLocalChangeIfReadonly(\"DataStoreCreatedWhileReadonly\");\n\n\t\tthis.snapshotTree = props.snapshotTree;\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tswitch (attachState) {\n\t\t\tcase AttachState.Attaching: {\n\t\t\t\tassert(\n\t\t\t\t\tthis.attachState === AttachState.Detached,\n\t\t\t\t\t0x14d /* \"Should move from detached to attaching\" */,\n\t\t\t\t);\n\t\t\t\tthis._attachState = AttachState.Attaching;\n\t\t\t\tif (this.channel?.setAttachState) {\n\t\t\t\t\tthis.channel.setAttachState(attachState);\n\t\t\t\t} else if (this.channel) {\n\t\t\t\t\t// back-compat! To be removed in the future\n\t\t\t\t\t// Added in \"2.0.0-rc.2.0.0\" timeframe.\n\t\t\t\t\tthis.emit(\"attaching\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase AttachState.Attached: {\n\t\t\t\t// We can get called into here twice, as result of both container and data store being attached, if\n\t\t\t\t// those processes overlapped, for example, in a flow like that one:\n\t\t\t\t// 1. Container attach started\n\t\t\t\t// 2. data store attachment started\n\t\t\t\t// 3. container attached\n\t\t\t\t// 4. data store attached.\n\t\t\t\tif (this.attachState !== AttachState.Attached) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.attachState === AttachState.Attaching,\n\t\t\t\t\t\t0x14e /* \"Should move from attaching to attached\" */,\n\t\t\t\t\t);\n\t\t\t\t\tthis._attachState = AttachState.Attached;\n\t\t\t\t\tthis.channel?.setAttachState?.(attachState);\n\t\t\t\t\tif (this.channel?.setAttachState) {\n\t\t\t\t\t\tthis.channel.setAttachState(attachState);\n\t\t\t\t\t} else if (this.channel) {\n\t\t\t\t\t\t// back-compat! To be removed in the future\n\t\t\t\t\t\t// Added in \"2.0.0-rc.2.0.0\" timeframe.\n\t\t\t\t\t\tthis.emit(\"attached\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(attachState, \"unreached\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc FluidDataStoreContext.getAttachSummary}\n\t */\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x14f /* \"There should be a channel when generating attach message\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.pkg !== undefined,\n\t\t\t0x150 /* \"pkg should be available in local data store context\" */,\n\t\t);\n\n\t\tconst attachSummary = this.channel.getAttachSummary(telemetryContext);\n\n\t\t// Wrap dds summaries in .channels subtree.\n\t\twrapSummaryInChannelsTree(attachSummary);\n\n\t\t// Add data store's attributes to the summary.\n\t\tconst attributes = createAttributes(this.pkg, this.isInMemoryRoot());\n\t\taddBlobToSummary(attachSummary, dataStoreAttributesBlobName, JSON.stringify(attributes));\n\n\t\t// Add loadingGroupId to the summary\n\t\tif (this.loadingGroupId !== undefined) {\n\t\t\tattachSummary.summary.groupId = this.loadingGroupId;\n\t\t}\n\n\t\treturn attachSummary;\n\t}\n\n\t/**\n\t * {@inheritDoc FluidDataStoreContext.getAttachGCData}\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x9a6 /* There should be a channel when generating attach GC data */,\n\t\t);\n\t\treturn this.channel.getAttachGCData(telemetryContext);\n\t}\n\n\t// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda\n\tprivate readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {\n\t\tlet snapshot = this.snapshotTree;\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tlet attributes: ReadFluidDataStoreAttributes;\n\t\tlet isRootDataStore = false;\n\t\tif (snapshot !== undefined) {\n\t\t\t// Get the dataStore attributes.\n\t\t\t// Note: storage can be undefined in special case while detached.\n\t\t\tattributes = await getFluidDataStoreAttributes(this.storage, snapshot);\n\t\t\tif (hasIsolatedChannels(attributes)) {\n\t\t\t\tsnapshot = snapshot.trees[channelsTreeName];\n\t\t\t\tassert(\n\t\t\t\t\tsnapshot !== undefined,\n\t\t\t\t\t0x1ff /* \"isolated channels subtree should exist in local datastore snapshot\" */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.pkg === undefined) {\n\t\t\t\tthis.pkg = JSON.parse(attributes.pkg) as string[];\n\t\t\t\t// If there is no isRootDataStore in the attributes blob, set it to true. This ensures that data\n\t\t\t\t// stores in older documents are not garbage collected incorrectly. This may lead to additional\n\t\t\t\t// roots in the document but they won't break.\n\t\t\t\tif (attributes.isRootDataStore ?? true) {\n\t\t\t\t\tisRootDataStore = true;\n\t\t\t\t\tthis.setInMemoryRoot();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassert(this.pkg !== undefined, 0x152 /* \"pkg should be available in local data store\" */);\n\n\t\treturn {\n\t\t\tpkg: this.pkg,\n\t\t\tisRootDataStore,\n\t\t\tsnapshot,\n\t\t};\n\t});\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\treturn this.initialSnapshotDetailsP;\n\t}\n\n\t/**\n\t * A context should only be marked as deleted when its a remote context.\n\t * Session Expiry at the runtime level should have closed the container creating the local data store context\n\t * before delete is even possible. Session Expiry is at 30 days, and sweep is done 36+ days later from the time\n\t * it was unreferenced. Thus the sweeping container should have loaded from a snapshot and thus creating a remote\n\t * context.\n\t */\n\tpublic delete(): void {\n\t\t// TODO: GC:Validation - potentially prevent this from happening or asserting. Maybe throw here.\n\t\tthis.mc.logger.sendErrorEvent({\n\t\t\teventName: \"GC_Deleted_DataStore_Unexpected_Delete\",\n\t\t\tmessage: \"Unexpected deletion of a local data store context\",\n\t\t});\n\t\tsuper.delete();\n\t}\n}\n\n/**\n * context implementation for \"attached\" data store runtime.\n * Various workflows (snapshot creation, requests) result in .realize() being called\n * on context, resulting in instantiation and attachment of runtime.\n * Runtime is created using data store factory that is associated with this context.\n * @internal\n */\nexport class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(props);\n\t}\n}\n\n/**\n * Detached context. Data Store runtime will be attached to it by attachRuntime() call\n * Before attachment happens, this context is not associated with particular type of runtime\n * or factory, i.e. it's package path is undefined.\n * Attachment process provides all missing parts - package path, data store runtime, and data store factory\n */\nexport class LocalDetachedFluidDataStoreContext\n\textends LocalFluidDataStoreContextBase\n\timplements IFluidDataStoreContextDetached\n{\n\tconstructor(props: ILocalDetachedFluidDataStoreContextProps) {\n\t\tsuper(props);\n\t\tthis.detachedRuntimeCreation = true;\n\t\tthis.channelToDataStoreFn = props.channelToDataStoreFn;\n\t}\n\tprivate readonly channelToDataStoreFn: (channel: IFluidDataStoreChannel) => IDataStore;\n\n\tpublic async attachRuntime(\n\t\tregistry: IProvideFluidDataStoreFactory,\n\t\tdataStoreChannel: IFluidDataStoreChannel,\n\t): Promise<IDataStore> {\n\t\tassert(this.detachedRuntimeCreation, 0x154 /* \"runtime creation is already attached\" */);\n\t\tthis.detachedRuntimeCreation = false;\n\n\t\tassert(this.channelP === undefined, 0x155 /* \"channel deferral is already set\" */);\n\n\t\tthis.channelP = Promise.resolve()\n\t\t\t.then(async () => {\n\t\t\t\tconst factory = registry.IFluidDataStoreFactory;\n\n\t\t\t\tconst factory2 = await this.factoryFromPackagePath();\n\t\t\t\tassert(factory2 === factory, 0x156 /* \"Unexpected factory for package path\" */);\n\n\t\t\t\tawait super.bindRuntime(dataStoreChannel, false /* existing */);\n\n\t\t\t\tassert(\n\t\t\t\t\t!(await this.isRoot()),\n\t\t\t\t\t0x8f7 /* there are no more createRootDataStore() kind of APIs! */,\n\t\t\t\t);\n\n\t\t\t\treturn dataStoreChannel;\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.mc.logger.sendErrorEvent({ eventName: \"AttachRuntimeError\" }, error);\n\t\t\t\t// The following two lines result in same exception thrown.\n\t\t\t\t// But we need to ensure that this.channelDeferred.promise is \"observed\", as otherwise\n\t\t\t\t// out UT reports unhandled exception\n\t\t\t\tthrow error;\n\t\t\t});\n\n\t\treturn this.channelToDataStoreFn(await this.channelP);\n\t}\n\n\t/**\n\t * This method provides a synchronous path for binding a runtime to the context.\n\t *\n\t * Due to its synchronous nature, it is unable to validate that the runtime\n\t * represents a datastore which is instantiable by remote clients. This could\n\t * happen if the runtime's package path does not return a factory when looked up\n\t * in the container runtime's registry, or if the runtime's entrypoint is not\n\t * properly initialized. As both of these validation's are asynchronous to preform.\n\t *\n\t * If used incorrectly, this function can result in permanent data corruption.\n\t */\n\tpublic unsafe_AttachRuntimeSync(channel: IFluidDataStoreChannel): IDataStore {\n\t\tthis.channelP = Promise.resolve(channel);\n\t\tthis.processPendingOps(channel);\n\t\tthis.completeBindingRuntime(channel);\n\t\treturn this.channelToDataStoreFn(channel);\n\t}\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\tif (this.detachedRuntimeCreation) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Detached Fluid Data Store context can't be realized! Please attach runtime first!\",\n\t\t\t);\n\t\t}\n\t\treturn super.getInitialSnapshotDetails();\n\t}\n}\n"]}
1
+ {"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,GAGjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAkB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9D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,yBAAyB;QACrC,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CACd,mFAAmF,CACnF,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC,yBAAyB,EAAE,CAAC;IAC1C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tTypedEventEmitter,\n\ttype ILayerCompatDetails,\n\ttype IProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\nimport { AttachState, type IAudience } from \"@fluidframework/container-definitions\";\nimport {\n\ttype IDeltaManager,\n\tisIDeltaManagerFull,\n\ttype IDeltaManagerFull,\n\ttype ReadOnlyInfo,\n} from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tITelemetryBaseProperties,\n\tIEvent,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleContext,\n\tIFluidHandleInternal,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, LazyPromise, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tITreeEntry,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tBlobTreeEntry,\n\tisInstanceOfISnapshot,\n\treadAndParse,\n} from \"@fluidframework/driver-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type {\n\tFluidDataStoreMessage,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tIGarbageCollectionData,\n\tCreateChildSummarizerNodeFn,\n\tCreateChildSummarizerNodeParam,\n\tFluidDataStoreContextInternal,\n\tFluidDataStoreRegistryEntry,\n\tIContainerRuntimeBase,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreRegistry,\n\tIGarbageCollectionDetailsBase,\n\tIProvideFluidDataStoreFactory,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n\tIInboundSignalMessage,\n\tIPendingMessagesState,\n\tIRuntimeMessageCollection,\n\tIFluidDataStoreFactory,\n\tPackagePath,\n\tIRuntimeStorageService,\n\tMinimumVersionForCollab,\n\tContainerExtensionId,\n\tContainerExtensionExpectations,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { channelsTreeName } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\taddBlobToSummary,\n\tisSnapshotFetchRequiredForLoadingGroupId,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tDataProcessingError,\n\tLoggingError,\n\ttype MonitoringContext,\n\tThresholdCounter,\n\tUsageError,\n\tcreateChildMonitoringContext,\n\textractSafePropertiesFromMessage,\n\tgenerateStack,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { IFluidParentContextPrivate } from \"./channelCollection.js\";\nimport { BaseDeltaManagerProxy } from \"./deltaManagerProxies.js\";\nimport {\n\truntimeCompatDetailsForDataStore,\n\tvalidateDatastoreCompatibility,\n} from \"./runtimeLayerCompatState.js\";\nimport {\n\t// eslint-disable-next-line import-x/no-deprecated\n\ttype ReadFluidDataStoreAttributes,\n\ttype WriteFluidDataStoreAttributes,\n\tdataStoreAttributesBlobName,\n\tgetAttributesFormatVersion,\n\tgetFluidDataStoreAttributes,\n\thasIsolatedChannels,\n\twrapSummaryInChannelsTree,\n} from \"./summary/index.js\";\n\nfunction createAttributes(\n\tpkg: readonly string[],\n\tisRootDataStore: boolean,\n): WriteFluidDataStoreAttributes {\n\tconst stringifiedPkg = JSON.stringify(pkg);\n\treturn {\n\t\tpkg: stringifiedPkg,\n\t\tsummaryFormatVersion: 2,\n\t\tisRootDataStore,\n\t};\n}\nexport function createAttributesBlob(\n\tpkg: readonly string[],\n\tisRootDataStore: boolean,\n): ITreeEntry {\n\tconst attributes = createAttributes(pkg, isRootDataStore);\n\treturn new BlobTreeEntry(dataStoreAttributesBlobName, JSON.stringify(attributes));\n}\n\nexport interface ISnapshotDetails {\n\tpkg: readonly string[];\n\tisRootDataStore: boolean;\n\tsnapshot?: ISnapshotTree;\n\tsequenceNumber?: number;\n}\n\n/**\n * This is interface that every context should implement.\n * This interface is used for context's parent - ChannelCollection.\n * It should not be exposed to any other users of context.\n */\nexport interface IFluidDataStoreContextPrivate extends FluidDataStoreContextInternal {\n\tgetAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n\tgetAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;\n\n\tgetInitialSnapshotDetails(): Promise<ISnapshotDetails>;\n\n\trealize(): Promise<IFluidDataStoreChannel>;\n\n\tisRoot(): Promise<boolean>;\n}\n\n/**\n * Properties necessary for creating a FluidDataStoreContext\n */\nexport interface IFluidDataStoreContextProps {\n\treadonly id: string;\n\treadonly parentContext: IFluidParentContextPrivate;\n\treadonly storage: IRuntimeStorageService;\n\treadonly scope: FluidObject;\n\treadonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;\n\t/**\n\t * See {@link FluidDataStoreContext.pkg}.\n\t */\n\treadonly pkg?: PackagePath;\n\t/**\n\t * See {@link FluidDataStoreContext.loadingGroupId}.\n\t */\n\treadonly loadingGroupId?: string;\n}\n\n/**\n * Properties necessary for creating a local FluidDataStoreContext\n */\nexport interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {\n\treadonly pkg: readonly string[] | undefined;\n\treadonly snapshotTree: ISnapshotTree | undefined;\n\treadonly makeLocallyVisibleFn: () => void;\n}\n\n/**\n * Properties necessary for creating a local FluidDataStoreContext\n */\nexport interface ILocalDetachedFluidDataStoreContextProps\n\textends ILocalFluidDataStoreContextProps {\n\treadonly channelToDataStoreFn: (channel: IFluidDataStoreChannel) => IDataStore;\n}\n\n/**\n * Properties necessary for creating a remote FluidDataStoreContext\n */\nexport interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {\n\treadonly snapshot: ISnapshotTree | ISnapshot | undefined;\n}\n\n// back-compat: To be removed in the future.\n// Added in \"2.0.0-rc.2.0.0\" timeframe (to support older builds).\nexport interface IFluidDataStoreContextEvents extends IEvent {\n\t(event: \"attaching\" | \"attached\", listener: () => void);\n}\n\n/**\n * Eventually we should remove the delta manger from being exposed to Datastore runtimes via the context. However to remove that exposure we need to add new\n * features, and those features themselves need forward and back compat. This proxy is here to enable that back compat. Each feature this proxy is used to\n * support should be listed below, and as layer compat support goes away for those feature, we should also remove them from this proxy, with the eventual goal\n * of completely removing this proxy.\n *\n * - Everything regarding readonly is to support older datastore runtimes which do not have the setReadonly function, so they must get their readonly state via the delta manager.\n *\n */\nclass ContextDeltaManagerProxy extends BaseDeltaManagerProxy {\n\tconstructor(\n\t\tbase: IDeltaManagerFull,\n\t\tprivate readonly isReadOnly: () => boolean,\n\t) {\n\t\tsuper(base, {\n\t\t\tonReadonly: (): void => {\n\t\t\t\t/* readonly is controlled from the context which calls setReadonly */\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\tconst readonly = this.isReadOnly();\n\t\tif (readonly === this.deltaManager.readOnlyInfo.readonly) {\n\t\t\treturn this.deltaManager.readOnlyInfo;\n\t\t} else {\n\t\t\treturn readonly === true\n\t\t\t\t? {\n\t\t\t\t\t\treadonly,\n\t\t\t\t\t\tforced: false,\n\t\t\t\t\t\tpermissions: undefined,\n\t\t\t\t\t\tstorageOnly: false,\n\t\t\t\t\t}\n\t\t\t\t: { readonly };\n\t\t}\n\t}\n\n\t/**\n\t * Called by the owning datastore context to emit the readonly\n\t * event on the delta manger that is projected down to the datastore\n\t * runtime. This state may not align with that of the true delta\n\t * manager if the context wishes to control the read only state\n\t * differently than the delta manager itself.\n\t */\n\tpublic emitReadonly(): void {\n\t\tthis.emit(\"readonly\", this.isReadOnly());\n\t}\n}\n\n/**\n * {@link IFluidDataStoreContext} for the implementations of {@link IFluidDataStoreChannel} which powers the {@link IDataStore}s.\n */\nexport abstract class FluidDataStoreContext\n\textends TypedEventEmitter<IFluidDataStoreContextEvents>\n\timplements IFluidDataStoreContextPrivate, IDisposable, IProvideLayerCompatDetails\n{\n\tpublic get packagePath(): PackagePath {\n\t\tassert(this.pkg !== undefined, 0x139 /* \"Undefined package path\" */);\n\t\treturn this.pkg;\n\t}\n\n\tpublic get options(): Record<string | number, unknown> {\n\t\treturn this.parentContext.options;\n\t}\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this.parentContext.clientId;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this.parentContext.clientDetails;\n\t}\n\n\tpublic get baseLogger(): ITelemetryBaseLogger {\n\t\treturn this.parentContext.baseLogger;\n\t}\n\n\tprivate readonly _contextDeltaManagerProxy: ContextDeltaManagerProxy;\n\tpublic get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {\n\t\treturn this._contextDeltaManagerProxy;\n\t}\n\n\tprivate isStagingMode: boolean = false;\n\tpublic isReadOnly = (): boolean =>\n\t\t(this.isStagingMode && this.channel?.policies?.readonlyInStagingMode === true) ||\n\t\tthis.parentContext.isReadOnly();\n\n\tpublic get connected(): boolean {\n\t\treturn this.parentContext.connected;\n\t}\n\n\tpublic get IFluidHandleContext(): IFluidHandleContext {\n\t\treturn this.parentContext.IFluidHandleContext;\n\t}\n\n\tpublic get containerRuntime(): IContainerRuntimeBase {\n\t\treturn this._containerRuntime;\n\t}\n\tpublic get isLoaded(): boolean {\n\t\treturn this.loaded;\n\t}\n\n\tpublic get baseSnapshot(): ISnapshotTree | undefined {\n\t\treturn this._baseSnapshot;\n\t}\n\n\tpublic get idCompressor(): IIdCompressor | undefined {\n\t\treturn this.parentContext.idCompressor;\n\t}\n\n\tprivate _disposed = false;\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * A Tombstoned object has been unreferenced long enough that GC knows it won't be referenced again.\n\t * Tombstoned objects are eventually deleted by GC.\n\t */\n\tprivate _tombstoned = false;\n\tpublic get tombstoned(): boolean {\n\t\treturn this._tombstoned;\n\t}\n\t/**\n\t * If true, throw an error when a tombstone data store is used.\n\t * @deprecated NOT SUPPORTED - hardcoded to return false since it's deprecated.\n\t */\n\tpublic readonly gcThrowOnTombstoneUsage: boolean = false;\n\t/**\n\t * @deprecated NOT SUPPORTED - hardcoded to return false since it's deprecated.\n\t */\n\tpublic readonly gcTombstoneEnforcementAllowed: boolean = false;\n\n\t/**\n\t * If true, this means that this data store context and its children have been removed from the runtime\n\t */\n\tprotected deleted: boolean = false;\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._attachState;\n\t}\n\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined {\n\t\treturn this.registry;\n\t}\n\n\t/**\n\t * The compatibility details of the Runtime layer that is exposed to the DataStore layer\n\t * for validating DataStore-Runtime compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn runtimeCompatDetailsForDataStore;\n\t}\n\n\t/**\n\t * {@inheritdoc IFluidDataStoreContext.minVersionForCollab}\n\t */\n\tpublic readonly minVersionForCollab: MinimumVersionForCollab;\n\n\tprivate baseSnapshotSequenceNumber: number | undefined;\n\n\t/**\n\t * A datastore is considered as root if it\n\t * 1. is root in memory - see isInMemoryRoot\n\t * 2. is root as part of the base snapshot that the datastore loaded from\n\t * @returns whether a datastore is root\n\t */\n\tpublic async isRoot(aliasedDataStores?: Set<string>): Promise<boolean> {\n\t\tif (this.isInMemoryRoot()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// This if is a performance optimization.\n\t\t// We know that if the base snapshot is omitted, then the isRootDataStore flag is not set.\n\t\t// That means we can skip the expensive call to getInitialSnapshotDetails for virtualized datastores,\n\t\t// and get the information from the alias map directly.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n\t\tif (aliasedDataStores !== undefined && (this.baseSnapshot as any)?.omitted === true) {\n\t\t\treturn aliasedDataStores.has(this.id);\n\t\t}\n\n\t\tconst snapshotDetails = await this.getInitialSnapshotDetails();\n\t\treturn snapshotDetails.isRootDataStore;\n\t}\n\n\t/**\n\t * There are 3 states where isInMemoryRoot needs to be true\n\t * 1. when a datastore becomes aliased. This can happen for both remote and local datastores\n\t * 2. when a datastore is created locally as root\n\t * 3. when a datastore is created locally as root and is rehydrated\n\t * @returns whether a datastore is root in memory\n\t */\n\tprotected isInMemoryRoot(): boolean {\n\t\treturn this._isInMemoryRoot;\n\t}\n\n\t/**\n\t * Returns the count of pending messages that are stored until the data store is realized.\n\t */\n\tpublic get pendingCount(): number {\n\t\treturn this.pendingMessagesState?.pendingCount ?? 0;\n\t}\n\n\tprotected registry: IFluidDataStoreRegistry | undefined;\n\n\tprotected detachedRuntimeCreation = false;\n\tprotected channel: IFluidDataStoreChannel | undefined;\n\tprivate loaded = false;\n\t/**\n\t * Tracks the messages for this data store that are sent while it's not loaded\n\t */\n\tprivate pendingMessagesState: IPendingMessagesState | undefined = {\n\t\tmessageCollections: [],\n\t\tpendingCount: 0,\n\t};\n\tprotected channelP: Promise<IFluidDataStoreChannel> | undefined;\n\tprotected _baseSnapshot: ISnapshotTree | undefined;\n\tprotected _attachState: AttachState;\n\tprivate _isInMemoryRoot: boolean = false;\n\tprotected readonly summarizerNode: ISummarizerNodeWithGC;\n\tprotected readonly mc: MonitoringContext;\n\tprivate readonly thresholdOpsCounter: ThresholdCounter;\n\tprivate static readonly pendingOpsCountThreshold = 1000;\n\n\t/**\n\t * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.\n\t * So, adding a count of how many telemetry events are logged per data store context. This can be\n\t * controlled via feature flags.\n\t */\n\tprivate localChangesTelemetryCount: number;\n\n\tpublic readonly id: string;\n\tprivate readonly _containerRuntime: IContainerRuntimeBase;\n\t/**\n\t * Information for this data store from its parent.\n\t *\n\t * @remarks\n\t * The parent which provided this information currently can be the container runtime or a datastore (if the datastore this context is for is nested under another one).\n\t */\n\tprivate readonly parentContext: IFluidParentContextPrivate;\n\tpublic readonly storage: IRuntimeStorageService;\n\tpublic readonly scope: FluidObject;\n\t/**\n\t * The loading group to which the data store belongs to.\n\t */\n\tpublic readonly loadingGroupId: string | undefined;\n\t/**\n\t * {@link PackagePath} of this data store.\n\t *\n\t * This can be undefined when a data store is delay loaded, i.e., the attributes of this data store in the snapshot are not fetched until this data store is actually used.\n\t * At that time, the attributes blob is fetched and the pkg is updated from it.\n\t *\n\t * @see {@link PackagePath}.\n\t * @see {@link IFluidDataStoreContext.packagePath}.\n\t * @see {@link factoryFromPackagePath}.\n\t */\n\tprotected pkg?: PackagePath;\n\n\tpublic constructor(\n\t\tprops: IFluidDataStoreContextProps,\n\t\tprivate readonly existing: boolean,\n\t\tpublic readonly isLocalDataStore: boolean,\n\t\tprivate readonly makeLocallyVisibleFn: () => void,\n\t) {\n\t\tsuper();\n\n\t\tthis._containerRuntime = props.parentContext.containerRuntime;\n\t\tthis.parentContext = props.parentContext;\n\t\tthis.minVersionForCollab = props.parentContext.minVersionForCollab;\n\t\tthis.id = props.id;\n\t\tthis.storage = props.storage;\n\t\tthis.scope = props.scope;\n\t\tthis.pkg = props.pkg;\n\t\tthis.loadingGroupId = props.loadingGroupId;\n\n\t\t// URIs use slashes as delimiters. Handles use URIs.\n\t\t// Thus having slashes in types almost guarantees trouble down the road!\n\t\tassert(!this.id.includes(\"/\"), 0x13a /* Data store ID contains slash */);\n\n\t\tthis._attachState =\n\t\t\tthis.parentContext.attachState !== AttachState.Detached && this.existing\n\t\t\t\t? this.parentContext.attachState\n\t\t\t\t: AttachState.Detached;\n\n\t\tthis.summarizerNode = props.createSummarizerNodeFn(\n\t\t\tasync (fullTree, trackState, telemetryContext) =>\n\t\t\t\tthis.summarizeInternal(fullTree, trackState, telemetryContext),\n\t\t\tasync (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n\t\t);\n\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: this.baseLogger,\n\t\t\tnamespace: \"FluidDataStoreContext\",\n\t\t\tproperties: {\n\t\t\t\tall: tagCodeArtifacts({\n\t\t\t\t\tfluidDataStoreId: this.id,\n\t\t\t\t\t// The package name is a getter because `this.pkg` may not be initialized during construction.\n\t\t\t\t\t// For data stores loaded from summary, it is initialized during data store realization.\n\t\t\t\t\tfullPackageName: () => this.pkg?.join(\"/\"),\n\t\t\t\t}),\n\t\t\t},\n\t\t});\n\t\tthis.thresholdOpsCounter = new ThresholdCounter(\n\t\t\tFluidDataStoreContext.pendingOpsCountThreshold,\n\t\t\tthis.mc.logger,\n\t\t);\n\n\t\t// By default, a data store can log maximum 10 local changes telemetry in summarizer.\n\t\tthis.localChangesTelemetryCount =\n\t\t\tthis.mc.config.getNumber(\"Fluid.Telemetry.LocalChangesTelemetryCount\") ?? 10;\n\n\t\tassert(\n\t\t\tisIDeltaManagerFull(this.parentContext.deltaManager),\n\t\t\t0xb83 /* Invalid delta manager */,\n\t\t);\n\n\t\tthis._contextDeltaManagerProxy = new ContextDeltaManagerProxy(\n\t\t\tthis.parentContext.deltaManager,\n\t\t\t() => this.isReadOnly(),\n\t\t);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._disposed = true;\n\n\t\t// Dispose any pending runtime after it gets fulfilled\n\t\t// Errors are logged where this.channelP is consumed/generated (realizeCore(), bindRuntime())\n\t\tif (this.channelP) {\n\t\t\tthis.channelP\n\t\t\t\t.then((runtime) => {\n\t\t\t\t\truntime.dispose();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {});\n\t\t}\n\t\tthis._contextDeltaManagerProxy.dispose();\n\t}\n\n\t/**\n\t * When delete is called, that means that the data store is permanently removed from the runtime, and will not show up in future summaries\n\t * This function is called to prevent ops from being generated from this data store once it has been deleted. Furthermore, this data store\n\t * should not receive any ops/signals.\n\t */\n\tpublic delete(): void {\n\t\tthis.deleted = true;\n\t}\n\n\tpublic setTombstone(tombstone: boolean): void {\n\t\tif (this.tombstoned === tombstone) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tombstoned = tombstone;\n\t}\n\n\tpublic abstract setAttachState(\n\t\tattachState: AttachState.Attaching | AttachState.Attached,\n\t): void;\n\n\t/**\n\t * Throw a {@link LoggingError} indicating that {@link factoryFromPackagePath} failed.\n\t */\n\tprivate factoryFromPackagePathError(\n\t\treason: string,\n\t\tfailedPkgPath?: string,\n\t\tfullPackageName?: PackagePath,\n\t): never {\n\t\tthrow new LoggingError(\n\t\t\treason,\n\t\t\ttagCodeArtifacts({\n\t\t\t\tfailedPkgPath,\n\t\t\t\tpackagePath: fullPackageName?.join(\"/\"),\n\t\t\t}),\n\t\t);\n\t}\n\n\tpublic async realize(): Promise<IFluidDataStoreChannel> {\n\t\tassert(\n\t\t\t!this.detachedRuntimeCreation,\n\t\t\t0x13d /* \"Detached runtime creation on realize()\" */,\n\t\t);\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy\n\t\tif (!this.channelP) {\n\t\t\tthis.channelP = this.realizeCore(this.existing).catch((error) => {\n\t\t\t\tconst errorWrapped = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\t\terror,\n\t\t\t\t\t\"realizeFluidDataStoreContext\",\n\t\t\t\t);\n\t\t\t\terrorWrapped.addTelemetryProperties(\n\t\t\t\t\ttagCodeArtifacts({\n\t\t\t\t\t\tfullPackageName: this.pkg?.join(\"/\"),\n\t\t\t\t\t\tfluidDataStoreId: this.id,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthis.mc.logger.sendErrorEvent({ eventName: \"RealizeError\" }, errorWrapped);\n\t\t\t\tthrow errorWrapped;\n\t\t\t});\n\t\t}\n\t\treturn this.channelP;\n\t}\n\n\t/**\n\t * Gets the factory that would be used to instantiate this data store by calling `instantiateDataStore` based on {@link pkg}.\n\t * @remarks\n\t * Also populates {@link registry}.\n\t *\n\t * Must be called after {@link pkg} is set, and only called once.\n\t *\n\t * @see {@link @fluidframework/container-runtime-definitions#IContainerRuntimeBase.createDataStore}.\n\t * @see {@link FluidDataStoreContext.pkg}.\n\t */\n\tprotected async factoryFromPackagePath(): Promise<IFluidDataStoreFactory> {\n\t\tconst path = this.pkg;\n\t\tif (path === undefined) {\n\t\t\tthis.factoryFromPackagePathError(\"packages is undefined\");\n\t\t}\n\n\t\tlet entry: FluidDataStoreRegistryEntry | undefined;\n\t\tlet registry: IFluidDataStoreRegistry | undefined =\n\t\t\tthis.parentContext.IFluidDataStoreRegistry;\n\t\tlet lastIdentifier: string | undefined;\n\t\t// Follow the path, looking up each identifier in the registry along the way:\n\t\tfor (const identifier of path) {\n\t\t\tif (!registry) {\n\t\t\t\tthis.factoryFromPackagePathError(\"No registry for package\", lastIdentifier, path);\n\t\t\t}\n\t\t\tlastIdentifier = identifier;\n\t\t\tentry = registry.getSync?.(identifier) ?? (await registry.get(identifier));\n\t\t\tif (!entry) {\n\t\t\t\tthis.factoryFromPackagePathError(\n\t\t\t\t\t\"Registry does not contain entry for the package\",\n\t\t\t\t\tidentifier,\n\t\t\t\t\tpath,\n\t\t\t\t);\n\t\t\t}\n\t\t\tregistry = entry.IFluidDataStoreRegistry;\n\t\t}\n\t\tconst factory = entry?.IFluidDataStoreFactory;\n\t\tif (factory === undefined) {\n\t\t\tthis.factoryFromPackagePathError(\"Can't find factory for package\", lastIdentifier, path);\n\t\t}\n\n\t\tassert(this.registry === undefined, 0x157 /* \"datastore registry already attached\" */);\n\t\tthis.registry = registry;\n\n\t\treturn factory;\n\t}\n\n\tpublic createChildDataStore<T extends IFluidDataStoreFactory>(\n\t\tchildFactory: T,\n\t): ReturnType<Exclude<T[\"createDataStore\"], undefined>> {\n\t\tconst maybe = this.registry?.getSync?.(childFactory.type);\n\n\t\tconst isUndefined = maybe === undefined;\n\t\tconst diffInstance = maybe?.IFluidDataStoreFactory !== childFactory;\n\n\t\tif (isUndefined || diffInstance) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"The provided factory instance must be synchronously available as a child of this datastore\",\n\t\t\t\t{ isUndefined, diffInstance },\n\t\t\t);\n\t\t}\n\t\tif (childFactory?.createDataStore === undefined) {\n\t\t\tthrow new UsageError(\"createDataStore must exist on the provided factory\", {\n\t\t\t\tnoCreateDataStore: true,\n\t\t\t});\n\t\t}\n\n\t\tconst context = this._containerRuntime.createDetachedDataStore([\n\t\t\t...this.packagePath,\n\t\t\tchildFactory.type,\n\t\t]);\n\t\tassert(\n\t\t\tcontext instanceof LocalDetachedFluidDataStoreContext,\n\t\t\t0xa89 /* must be a LocalDetachedFluidDataStoreContext */,\n\t\t);\n\n\t\tconst created = childFactory.createDataStore(context) as ReturnType<\n\t\t\tExclude<T[\"createDataStore\"], undefined>\n\t\t>;\n\t\tcontext.unsafe_AttachRuntimeSync(created.runtime);\n\t\treturn created;\n\t}\n\n\tprivate async realizeCore(existing: boolean): Promise<IFluidDataStoreChannel> {\n\t\tconst details = await this.getInitialSnapshotDetails();\n\t\t// Base snapshot is the baseline where pending ops are applied to.\n\t\t// It is important that this be in sync with the pending ops, and also\n\t\t// that it is set here, before bindRuntime is called.\n\t\tthis._baseSnapshot = details.snapshot;\n\t\tthis.baseSnapshotSequenceNumber = details.sequenceNumber;\n\t\tassert(this.pkg === details.pkg, 0x13e /* \"Unexpected package path\" */);\n\n\t\tconst factory = await this.factoryFromPackagePath();\n\n\t\tconst channel = await factory.instantiateDataStore(this, existing);\n\t\tassert(channel !== undefined, 0x140 /* \"undefined channel on datastore context\" */);\n\n\t\tawait this.bindRuntime(channel, existing);\n\t\t// This data store may have been disposed before the channel is created during realization. If so,\n\t\t// dispose the channel now.\n\t\tif (this.disposed) {\n\t\t\tchannel.dispose();\n\t\t}\n\n\t\treturn channel;\n\t}\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. Its old ID when in disconnected state and\n\t * its new client ID when we are connecting or connected.\n\t */\n\tpublic setConnectionState(connected: boolean, clientId?: string): void {\n\t\t// ConnectionState should not fail in tombstone mode as this is internally run\n\t\tthis.verifyNotClosed(\"setConnectionState\", false /* checkTombstone */);\n\n\t\t// Connection events are ignored if the store is not yet loaded\n\t\tif (!this.loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tassert(this.connected === connected, 0x141 /* \"Unexpected connected state\" */);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tthis.channel!.setConnectionState(connected, clientId);\n\t}\n\n\tpublic notifyReadOnlyState(): void {\n\t\tthis.verifyNotClosed(\"notifyReadOnlyState\", false /* checkTombstone */);\n\n\t\t// These two calls achieve the same purpose, and are both needed for a time for back compat\n\t\tthis.channel?.notifyReadOnlyState?.(this.isReadOnly());\n\t\tthis._contextDeltaManagerProxy.emitReadonly();\n\t}\n\n\t/**\n\t * Updates the readonly state of the data store based on the staging mode.\n\t *\n\t * @param staging - A boolean indicating whether the container is in staging mode.\n\t * If true, the data store is set to readonly unless explicitly allowed by its policies.\n\t */\n\tpublic notifyStagingMode(staging: boolean): void {\n\t\t// If the `readonlyInStagingMode` policy is not explicitly set to `false`,\n\t\t// the data store is treated as readonly in staging mode.\n\t\tconst oldReadOnlyState = this.isReadOnly();\n\t\tthis.isStagingMode = staging;\n\t\tif (this.isReadOnly() !== oldReadOnlyState) {\n\t\t\tthis.notifyReadOnlyState();\n\t\t}\n\t}\n\n\t/**\n\t * Process messages for this data store. The messages here are contiguous messages for this data store in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tpublic processMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tconst safeTelemetryProps = extractSafePropertiesFromMessage(envelope);\n\t\t// Tombstone error is logged in garbage collector. So, set \"checkTombstone\" to false when calling\n\t\t// \"verifyNotClosed\" which logs tombstone errors.\n\t\tthis.verifyNotClosed(\"process\", false /* checkTombstone */, safeTelemetryProps);\n\n\t\tthis.summarizerNode.recordChange(envelope as ISequencedDocumentMessage);\n\n\t\tif (this.loaded) {\n\t\t\tassert(this.channel !== undefined, 0xa68 /* Channel is not loaded */);\n\t\t\tthis.channel.processMessages(messageCollection);\n\t\t} else {\n\t\t\tassert(!local, 0x142 /* \"local store channel is not loaded\" */);\n\t\t\tassert(\n\t\t\t\tthis.pendingMessagesState !== undefined,\n\t\t\t\t0xa69 /* pending messages queue is undefined */,\n\t\t\t);\n\t\t\tthis.pendingMessagesState.messageCollections.push({\n\t\t\t\t...messageCollection,\n\t\t\t\tmessagesContent: [...messagesContent],\n\t\t\t});\n\t\t\tthis.pendingMessagesState.pendingCount += messagesContent.length;\n\t\t\tthis.thresholdOpsCounter.sendIfMultiple(\n\t\t\t\t\"StorePendingOps\",\n\t\t\t\tthis.pendingMessagesState.pendingCount,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic processSignal(message: IInboundSignalMessage, local: boolean): void {\n\t\tthis.verifyNotClosed(\"processSignal\");\n\n\t\t// Signals are ignored if the store is not yet loaded\n\t\tif (!this.loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.channel?.processSignal(message, local);\n\t}\n\n\tpublic getQuorum(): IQuorumClients {\n\t\treturn this.parentContext.getQuorum();\n\t}\n\n\tpublic getAudience(): IAudience {\n\t\treturn this.parentContext.getAudience();\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\treturn this.summarizerNode.summarize(fullTree, trackState, telemetryContext);\n\t}\n\n\tprivate async summarizeInternal(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeInternalResult> {\n\t\tawait this.realize();\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst summarizeResult = await this.channel!.summarize(\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t);\n\n\t\t// Wrap dds summaries in .channels subtree.\n\t\twrapSummaryInChannelsTree(summarizeResult);\n\t\tconst pathPartsForChildren = [channelsTreeName];\n\n\t\t// Add data store's attributes to the summary.\n\t\tconst { pkg } = await this.getInitialSnapshotDetails();\n\t\tconst isRoot = await this.isRoot();\n\t\tconst attributes = createAttributes(pkg, isRoot);\n\t\taddBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));\n\n\t\t// If we are not referenced, mark the summary tree as unreferenced. Also, update unreferenced blob\n\t\t// size in the summary stats with the blobs size of this data store.\n\t\tif (!this.summarizerNode.isReferenced()) {\n\t\t\tsummarizeResult.summary.unreferenced = true;\n\t\t\tsummarizeResult.stats.unreferencedBlobSize = summarizeResult.stats.totalBlobSize;\n\t\t}\n\n\t\t// Add loadingGroupId to the summary\n\t\tif (this.loadingGroupId !== undefined) {\n\t\t\tsummarizeResult.summary.groupId = this.loadingGroupId;\n\t\t}\n\n\t\treturn {\n\t\t\t...summarizeResult,\n\t\t\tid: this.id,\n\t\t\tpathPartsForChildren,\n\t\t};\n\t}\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this data store\n\t * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the\n\t * document.\n\t * If there is no new data in this data store since the last summary, previous GC data is used.\n\t * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\treturn this.summarizerNode.getGCData(fullGC);\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. This is called when there is new data since last summary. It\n\t * realizes the data store and calls into each channel context to get its GC data.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tprivate async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tawait this.realize();\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x143 /* \"Channel should not be undefined when running GC\" */,\n\t\t);\n\n\t\treturn this.channel.getGCData(fullGC);\n\t}\n\n\t/**\n\t * After GC has run, called to notify the data store of routes used in it. These are used for the following:\n\t * 1. To identify if this data store is being referenced in the document or not.\n\t * 2. To determine if it needs to re-summarize in case used routes changed since last summary.\n\t * 3. To notify child contexts of their used routes. This is done immediately if the data store is loaded.\n\t * Else, it is done by the data stores's summarizer node when child summarizer nodes are created.\n\t *\n\t * @param usedRoutes - The routes that are used in this data store.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: string[]): void {\n\t\t// Update the used routes in this data store's summarizer node.\n\t\tthis.summarizerNode.updateUsedRoutes(usedRoutes);\n\n\t\t// If the channel doesn't exist yet (data store is not realized), the summarizer node will update it\n\t\t// when it creates child nodes.\n\t\tif (!this.channel) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the route to this data store, if it exists.\n\t\tconst usedChannelRoutes = usedRoutes.filter((id: string) => {\n\t\t\treturn id !== \"/\" && id !== \"\";\n\t\t});\n\t\tthis.channel.updateUsedRoutes(usedChannelRoutes);\n\t}\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t *\n\t * @param fromPath - The absolute path of the node that added the reference.\n\t * @param toPath - The absolute path of the outbound node that is referenced.\n\t * @param messageTimestampMs - The timestamp of the message that added the reference.\n\t */\n\tpublic addedGCOutboundRoute(\n\t\tfromPath: string,\n\t\ttoPath: string,\n\t\tmessageTimestampMs?: number,\n\t): void {\n\t\tthis.parentContext.addedGCOutboundRoute(fromPath, toPath, messageTimestampMs);\n\t}\n\n\tpublic submitMessage(type: string, content: unknown, localOpMetadata: unknown): void {\n\t\tthis.verifyNotClosed(\"submitMessage\");\n\t\tassert(!!this.channel, 0x146 /* \"Channel must exist when submitting message\" */);\n\t\t// Readonly clients should not submit messages.\n\t\tthis.identifyLocalChangeIfReadonly(\"DataStoreMessageWhileReadonly\", type);\n\n\t\tthis.parentContext.submitMessage(type, content, localOpMetadata);\n\t}\n\n\t/**\n\t * This is called from a SharedSummaryBlock that does not generate ops but only wants to be part of the summary.\n\t * It indicates that there is data in the object that needs to be summarized.\n\t * We will update the latestSequenceNumber of the summary tracker of this\n\t * store and of the object's channel.\n\t *\n\t * @param address - The address of the channel that is dirty.\n\t *\n\t */\n\tpublic setChannelDirty(address: string): void {\n\t\tthis.verifyNotClosed(\"setChannelDirty\");\n\n\t\t// Get the latest sequence number.\n\t\tconst latestSequenceNumber = this.deltaManager.lastSequenceNumber;\n\n\t\tthis.summarizerNode.invalidate(latestSequenceNumber);\n\n\t\tconst channelSummarizerNode = this.summarizerNode.getChild(address);\n\n\t\tif (channelSummarizerNode) {\n\t\t\tchannelSummarizerNode.invalidate(latestSequenceNumber); // TODO: lazy load problem?\n\t\t}\n\t}\n\n\tpublic submitSignal(type: string, content: unknown, targetClientId?: string): void {\n\t\tthis.verifyNotClosed(\"submitSignal\");\n\n\t\tassert(!!this.channel, 0x147 /* \"Channel must exist on submitting signal\" */);\n\t\treturn this.parentContext.submitSignal(type, content, targetClientId);\n\t}\n\n\t/**\n\t * This is called by the data store channel when it becomes locally visible indicating that it is ready to become\n\t * globally visible now.\n\t */\n\tpublic makeLocallyVisible(): void {\n\t\tassert(this.channel !== undefined, 0x2cf /* \"undefined channel on datastore context\" */);\n\t\tthis.makeLocallyVisibleFn();\n\t}\n\n\tprotected processPendingOps(channel: IFluidDataStoreChannel): void {\n\t\tconst baseSequenceNumber = this.baseSnapshotSequenceNumber ?? -1;\n\n\t\tassert(\n\t\t\tthis.pendingMessagesState !== undefined,\n\t\t\t0xa6a /* pending messages queue is undefined */,\n\t\t);\n\t\tfor (const messageCollection of this.pendingMessagesState.messageCollections) {\n\t\t\t// Only process ops whose seq number is greater than snapshot sequence number from which it loaded.\n\t\t\tif (messageCollection.envelope.sequenceNumber > baseSequenceNumber) {\n\t\t\t\tchannel.processMessages(messageCollection);\n\t\t\t}\n\t\t}\n\n\t\tthis.thresholdOpsCounter.send(\"ProcessPendingOps\", this.pendingMessagesState.pendingCount);\n\t\tthis.pendingMessagesState = undefined;\n\t}\n\n\tprotected completeBindingRuntime(channel: IFluidDataStoreChannel): void {\n\t\t// Validate that the DataStore is compatible with this Runtime.\n\t\tconst maybeDataStoreCompatDetails = channel as FluidObject<ILayerCompatDetails>;\n\t\tvalidateDatastoreCompatibility(\n\t\t\tmaybeDataStoreCompatDetails.ILayerCompatDetails,\n\t\t\tthis.dispose.bind(this),\n\t\t\tthis.mc,\n\t\t);\n\n\t\t// And now mark the runtime active\n\t\tthis.loaded = true;\n\t\tthis.channel = channel;\n\n\t\t// Channel does not know when it's \"live\" (as in - starts to receive events in the system)\n\t\t// It may read current state of the system when channel was created, but it was not getting any updates\n\t\t// through creation process and could have missed events. So update it on current state.\n\t\t// Once this.loaded is set (above), it will stat receiving events.\n\t\tchannel.setConnectionState(this.connected, this.clientId);\n\n\t\t// Freeze the package path to ensure that someone doesn't modify it when it is\n\t\t// returned in packagePath().\n\t\tObject.freeze(this.pkg);\n\t}\n\n\tprotected async bindRuntime(\n\t\tchannel: IFluidDataStoreChannel,\n\t\texisting: boolean,\n\t): Promise<void> {\n\t\tif (this.channel) {\n\t\t\tthrow new Error(\"Runtime already bound\");\n\t\t}\n\n\t\tassert(\n\t\t\t!this.detachedRuntimeCreation,\n\t\t\t0x148 /* \"Detached runtime creation on runtime bind\" */,\n\t\t);\n\t\tassert(this.pkg !== undefined, 0x14a /* \"Undefined package path\" */);\n\n\t\tif (!existing) {\n\t\t\t// Execute data store's entry point to make sure that for a local (aka detached from container) data store, the\n\t\t\t// entryPoint initialization function is called before the data store gets attached and potentially connected to\n\t\t\t// the delta stream, so it gets a chance to do things while the data store is still \"purely local\".\n\t\t\t// This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method\n\t\t\t// of data store factories tends to construct the data object (at least kick off an async method that returns\n\t\t\t// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes\n\t\t\t// before the data store is attached.\n\t\t\tawait channel.entryPoint.get();\n\t\t}\n\n\t\tthis.processPendingOps(channel);\n\t\tthis.completeBindingRuntime(channel);\n\t}\n\n\tpublic async getAbsoluteUrl(relativeUrl: string): Promise<string | undefined> {\n\t\tif (this.attachState !== AttachState.Attached) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.parentContext.getAbsoluteUrl(relativeUrl);\n\t}\n\n\t/**\n\t * Get the summary required when attaching this context's DataStore.\n\t * Used for both Container Attach and DataStore Attach.\n\t */\n\tpublic abstract getAttachSummary(\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats;\n\n\t/**\n\t * Get the GC Data for the initial state being attached so remote clients can learn of this DataStore's\n\t * outbound routes.\n\t */\n\tpublic abstract getAttachGCData(\n\t\ttelemetryContext?: ITelemetryContext,\n\t): IGarbageCollectionData;\n\n\tpublic abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;\n\n\t// eslint-disable-next-line jsdoc/require-description\n\t/**\n\t * @deprecated Sets the datastore as root, for aliasing purposes: #7948\n\t * This method should not be used outside of the aliasing context.\n\t * It will be removed, as the source of truth for this flag will be the aliasing blob.\n\t */\n\tpublic setInMemoryRoot(): void {\n\t\tthis._isInMemoryRoot = true;\n\t}\n\n\t// eslint-disable-next-line jsdoc/require-description\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tpublic async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {\n\t\treturn {};\n\t}\n\n\tpublic reSubmit(\n\t\tmessage: FluidDataStoreMessage,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash: boolean,\n\t): void {\n\t\tassert(!!this.channel, 0x14b /* \"Channel must exist when resubmitting ops\" */);\n\t\tthis.channel.reSubmit(message.type, message.content, localOpMetadata, squash);\n\t}\n\n\tpublic rollback(message: FluidDataStoreMessage, localOpMetadata: unknown): void {\n\t\tif (!this.channel) {\n\t\t\tthrow new Error(\"Channel must exist when rolling back ops\");\n\t\t}\n\t\tif (!this.channel.rollback) {\n\t\t\tthrow new Error(\"Channel doesn't support rollback\");\n\t\t}\n\t\tthis.channel.rollback(message.type, message.content, localOpMetadata);\n\t}\n\n\tpublic async applyStashedOp(contents: unknown): Promise<unknown> {\n\t\tif (!this.channel) {\n\t\t\tawait this.realize();\n\t\t}\n\t\tassert(!!this.channel, 0x14c /* \"Channel must exist when rebasing ops\" */);\n\t\treturn this.channel.applyStashedOp(contents);\n\t}\n\n\tprivate verifyNotClosed(\n\t\tcallSite: string,\n\t\tcheckTombstone = true,\n\t\tsafeTelemetryProps: ITelemetryBaseProperties = {},\n\t): void {\n\t\tif (this.deleted) {\n\t\t\tconst messageString = `Context is deleted! Call site [${callSite}]`;\n\t\t\tconst error = DataProcessingError.create(\n\t\t\t\tmessageString,\n\t\t\t\tcallSite,\n\t\t\t\tundefined /* sequencedMessage */,\n\t\t\t\tsafeTelemetryProps,\n\t\t\t);\n\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"GC_Deleted_DataStore_Changed\",\n\t\t\t\t\tcallSite,\n\t\t\t\t},\n\t\t\t\terror,\n\t\t\t);\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this._disposed) {\n\t\t\tthrow new Error(`Context is closed! Call site [${callSite}]`);\n\t\t}\n\n\t\tif (checkTombstone && this.tombstoned) {\n\t\t\tconst messageString = `Context is tombstoned! Call site [${callSite}]`;\n\t\t\tconst error = DataProcessingError.create(\n\t\t\t\tmessageString,\n\t\t\t\tcallSite,\n\t\t\t\tundefined /* sequencedMessage */,\n\t\t\t\tsafeTelemetryProps,\n\t\t\t\t30 /* stackTraceLimit */,\n\t\t\t);\n\n\t\t\tthis.mc.logger.sendTelemetryEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"GC_Tombstone_DataStore_Changed\",\n\t\t\t\t\tcategory: \"generic\",\n\t\t\t\t\tcallSite,\n\t\t\t\t},\n\t\t\t\terror,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Readonly client, including summarizer, should not have local changes. These changes can become part of the summary and can break\n\t * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas\n\t * other clients that are up-to-date till seq# 100 may not have them yet.\n\t */\n\tprotected identifyLocalChangeIfReadonly(eventName: string, type?: string): void {\n\t\tif (!this.isReadOnly() || this.localChangesTelemetryCount <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Log a telemetry if there are local changes in readonly. This will give us data on how often\n\t\t// this is happening and which data stores do this. The eventual goal is to disallow local changes\n\t\t// in the summarizer and the data will help us plan this.\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName,\n\t\t\ttype,\n\t\t\tisSummaryInProgress: this.summarizerNode.isSummaryInProgress?.(),\n\t\t\tstack: generateStack(30),\n\t\t\treadonly: this.isReadOnly(),\n\t\t\tisStagingMode: this.isStagingMode,\n\t\t});\n\t\tthis.localChangesTelemetryCount--;\n\t}\n\n\tpublic getCreateChildSummarizerNodeFn(\n\t\tid: string,\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t) {\n\t\treturn (\n\t\t\tsummarizeInternal: SummarizeInternalFn,\n\t\t\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\t): ISummarizerNodeWithGC =>\n\t\t\tthis.summarizerNode.createChild(\n\t\t\t\tsummarizeInternal,\n\t\t\t\tid,\n\t\t\t\tcreateParam,\n\t\t\t\tundefined /* config */,\n\t\t\t\tgetGCDataFn,\n\t\t\t);\n\t}\n\n\tpublic deleteChildSummarizerNode(id: string): void {\n\t\tthis.summarizerNode.deleteChild(id);\n\t}\n\n\tpublic async uploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternal<ArrayBufferLike>> {\n\t\treturn this.parentContext.uploadBlob(blob, signal);\n\t}\n\n\tpublic getExtension<TInterface, TUseContext extends unknown[] = []>(\n\t\tid: ContainerExtensionId,\n\t\trequirements: ContainerExtensionExpectations,\n\t\t...context: TUseContext\n\t): TInterface {\n\t\treturn this.parentContext.getExtension(id, requirements, ...context);\n\t}\n}\n\n/**\n * @internal\n */\nexport class RemoteFluidDataStoreContext extends FluidDataStoreContext {\n\t// Tells whether we need to fetch the snapshot before use. This is to support Data Virtualization.\n\tprivate snapshotFetchRequired: boolean | undefined;\n\tprivate readonly runtime: IContainerRuntimeBase;\n\tprivate readonly blobContents: Map<string, ArrayBuffer> | undefined;\n\tprivate readonly isSnapshotInISnapshotFormat: boolean;\n\n\tconstructor(props: IRemoteFluidDataStoreContextProps) {\n\t\tsuper(props, true /* existing */, false /* isLocalDataStore */, () => {\n\t\t\tthrow new Error(\"Already attached\");\n\t\t});\n\n\t\tthis.runtime = props.parentContext.containerRuntime;\n\t\tif (isInstanceOfISnapshot(props.snapshot)) {\n\t\t\tthis.blobContents = props.snapshot.blobContents;\n\t\t\tthis._baseSnapshot = props.snapshot.snapshotTree;\n\t\t\tthis.isSnapshotInISnapshotFormat = true;\n\t\t} else {\n\t\t\tthis._baseSnapshot = props.snapshot;\n\t\t\tthis.isSnapshotInISnapshotFormat = false;\n\t\t}\n\t}\n\n\t/**\n\t * This API should not be called for RemoteFluidDataStoreContext. But here is one scenario where it's not the case:\n\t * The scenario (hit by stashedOps.spec.ts, \"resends attach op\" UT is the following (as far as I understand):\n\t *\n\t * 1. data store is being attached in attached container\n\t *\n\t * 2. container state is serialized (stashed ops feature)\n\t *\n\t * 3. new container instance is rehydrated (from stashed ops) -\n\t * As result, we create RemoteFluidDataStoreContext for this data store that is actually in \"attaching\" state * (as of # 2).\n\t * But its state is set to attached when loading container from stashed ops.\n\t *\n\t * 4. attach op for this data store is processed - setAttachState() is called.\n\t */\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {}\n\n\t// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda\n\tprivate readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {\n\t\t// Sequence number of the snapshot.\n\t\tlet sequenceNumber: number | undefined;\n\t\t// Check whether we need to fetch the snapshot first to load. The snapshot should be in new format to see\n\t\t// whether we want to evaluate to fetch snapshot or not for loadingGroupId. Otherwise, the snapshot\n\t\t// will contain all the blobs.\n\t\tif (\n\t\t\tthis.snapshotFetchRequired === undefined &&\n\t\t\tthis._baseSnapshot?.groupId !== undefined &&\n\t\t\tthis.isSnapshotInISnapshotFormat\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.blobContents !== undefined,\n\t\t\t\t0x97a /* Blob contents should be present to evaluate */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tthis._baseSnapshot !== undefined,\n\t\t\t\t0x97b /* snapshotTree should be present to evaluate */,\n\t\t\t);\n\t\t\tthis.snapshotFetchRequired = isSnapshotFetchRequiredForLoadingGroupId(\n\t\t\t\tthis._baseSnapshot,\n\t\t\t\tthis.blobContents,\n\t\t\t);\n\t\t}\n\t\tif (this.snapshotFetchRequired === true) {\n\t\t\tassert(\n\t\t\t\tthis.loadingGroupId !== undefined,\n\t\t\t\t0x8f5 /* groupId should be present to fetch snapshot */,\n\t\t\t);\n\t\t\tconst snapshot = await this.runtime.getSnapshotForLoadingGroupId(\n\t\t\t\t[this.loadingGroupId],\n\t\t\t\t[this.id],\n\t\t\t);\n\t\t\tthis._baseSnapshot = snapshot.snapshotTree;\n\t\t\tsequenceNumber = snapshot.sequenceNumber;\n\t\t\tthis.snapshotFetchRequired = false;\n\t\t}\n\t\tlet tree = this.baseSnapshot;\n\t\tlet isRootDataStore = true;\n\n\t\tif (!!tree && tree.blobs[dataStoreAttributesBlobName] !== undefined) {\n\t\t\t// Need to get through snapshot and use that to populate extraBlobs\n\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\tconst attributes = await readAndParse<ReadFluidDataStoreAttributes>(\n\t\t\t\tthis.storage,\n\t\t\t\ttree.blobs[dataStoreAttributesBlobName],\n\t\t\t);\n\n\t\t\tlet pkgFromSnapshot: string[];\n\t\t\t// Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.\n\t\t\t// For snapshotFormatVersion = \"0.1\" (1) or above, pkg is jsonified, otherwise it is just a string.\n\t\t\tconst formatVersion = getAttributesFormatVersion(attributes);\n\t\t\tif (formatVersion < 1) {\n\t\t\t\tpkgFromSnapshot =\n\t\t\t\t\tattributes.pkg.startsWith('[\"') && attributes.pkg.endsWith('\"]')\n\t\t\t\t\t\t? (JSON.parse(attributes.pkg) as string[])\n\t\t\t\t\t\t: [attributes.pkg];\n\t\t\t} else {\n\t\t\t\tpkgFromSnapshot = JSON.parse(attributes.pkg) as string[];\n\t\t\t}\n\t\t\tthis.pkg = pkgFromSnapshot;\n\n\t\t\t/**\n\t\t\t * If there is no isRootDataStore in the attributes blob, set it to true. This will ensure that\n\t\t\t * data stores in older documents are not garbage collected incorrectly. This may lead to additional\n\t\t\t * roots in the document but they won't break.\n\t\t\t */\n\t\t\tisRootDataStore = attributes.isRootDataStore ?? true;\n\n\t\t\tif (hasIsolatedChannels(attributes)) {\n\t\t\t\ttree = tree.trees[channelsTreeName];\n\t\t\t\tassert(\n\t\t\t\t\ttree !== undefined,\n\t\t\t\t\t0x1fe /* \"isolated channels subtree should exist in remote datastore snapshot\" */,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tassert(\n\t\t\tthis.pkg !== undefined,\n\t\t\t0x8f6 /* The datastore context package should be defined */,\n\t\t);\n\t\treturn {\n\t\t\tpkg: this.pkg,\n\t\t\tisRootDataStore,\n\t\t\tsnapshot: tree,\n\t\t\tsequenceNumber,\n\t\t};\n\t});\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\treturn this.initialSnapshotDetailsP;\n\t}\n\n\t/**\n\t * {@inheritDoc FluidDataStoreContext.getAttachSummary}\n\t */\n\tpublic getAttachSummary(): ISummaryTreeWithStats {\n\t\tthrow new Error(\"Cannot attach remote store\");\n\t}\n\n\t/**\n\t * {@inheritDoc FluidDataStoreContext.getAttachGCData}\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tthrow new Error(\"Cannot attach remote store\");\n\t}\n}\n\n/**\n * Base class for detached & attached context classes\n * @internal\n */\nexport class LocalFluidDataStoreContextBase extends FluidDataStoreContext {\n\tprivate readonly snapshotTree: ISnapshotTree | undefined;\n\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(\n\t\t\tprops,\n\t\t\tprops.snapshotTree !== undefined /* existing */,\n\t\t\ttrue /* isLocalDataStore */,\n\t\t\tprops.makeLocallyVisibleFn,\n\t\t);\n\n\t\t// Summarizer client should not create local data stores.\n\t\tthis.identifyLocalChangeIfReadonly(\"DataStoreCreatedWhileReadonly\");\n\n\t\tthis.snapshotTree = props.snapshotTree;\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tswitch (attachState) {\n\t\t\tcase AttachState.Attaching: {\n\t\t\t\tassert(\n\t\t\t\t\tthis.attachState === AttachState.Detached,\n\t\t\t\t\t0x14d /* \"Should move from detached to attaching\" */,\n\t\t\t\t);\n\t\t\t\tthis._attachState = AttachState.Attaching;\n\t\t\t\tif (this.channel?.setAttachState) {\n\t\t\t\t\tthis.channel.setAttachState(attachState);\n\t\t\t\t} else if (this.channel) {\n\t\t\t\t\t// back-compat! To be removed in the future\n\t\t\t\t\t// Added in \"2.0.0-rc.2.0.0\" timeframe.\n\t\t\t\t\tthis.emit(\"attaching\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase AttachState.Attached: {\n\t\t\t\t// We can get called into here twice, as result of both container and data store being attached, if\n\t\t\t\t// those processes overlapped, for example, in a flow like that one:\n\t\t\t\t// 1. Container attach started\n\t\t\t\t// 2. data store attachment started\n\t\t\t\t// 3. container attached\n\t\t\t\t// 4. data store attached.\n\t\t\t\tif (this.attachState !== AttachState.Attached) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.attachState === AttachState.Attaching,\n\t\t\t\t\t\t0x14e /* \"Should move from attaching to attached\" */,\n\t\t\t\t\t);\n\t\t\t\t\tthis._attachState = AttachState.Attached;\n\t\t\t\t\tthis.channel?.setAttachState?.(attachState);\n\t\t\t\t\tif (this.channel?.setAttachState) {\n\t\t\t\t\t\tthis.channel.setAttachState(attachState);\n\t\t\t\t\t} else if (this.channel) {\n\t\t\t\t\t\t// back-compat! To be removed in the future\n\t\t\t\t\t\t// Added in \"2.0.0-rc.2.0.0\" timeframe.\n\t\t\t\t\t\tthis.emit(\"attached\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(attachState, \"unreached\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc FluidDataStoreContext.getAttachSummary}\n\t */\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x14f /* \"There should be a channel when generating attach message\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.pkg !== undefined,\n\t\t\t0x150 /* \"pkg should be available in local data store context\" */,\n\t\t);\n\n\t\tconst attachSummary = this.channel.getAttachSummary(telemetryContext);\n\n\t\t// Wrap dds summaries in .channels subtree.\n\t\twrapSummaryInChannelsTree(attachSummary);\n\n\t\t// Add data store's attributes to the summary.\n\t\tconst attributes = createAttributes(this.pkg, this.isInMemoryRoot());\n\t\taddBlobToSummary(attachSummary, dataStoreAttributesBlobName, JSON.stringify(attributes));\n\n\t\t// Add loadingGroupId to the summary\n\t\tif (this.loadingGroupId !== undefined) {\n\t\t\tattachSummary.summary.groupId = this.loadingGroupId;\n\t\t}\n\n\t\treturn attachSummary;\n\t}\n\n\t/**\n\t * {@inheritDoc FluidDataStoreContext.getAttachGCData}\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x9a6 /* There should be a channel when generating attach GC data */,\n\t\t);\n\t\treturn this.channel.getAttachGCData(telemetryContext);\n\t}\n\n\t// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda\n\tprivate readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {\n\t\tlet snapshot = this.snapshotTree;\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tlet attributes: ReadFluidDataStoreAttributes;\n\t\tlet isRootDataStore = false;\n\t\tif (snapshot !== undefined) {\n\t\t\t// Get the dataStore attributes.\n\t\t\t// Note: storage can be undefined in special case while detached.\n\t\t\tattributes = await getFluidDataStoreAttributes(this.storage, snapshot);\n\t\t\tif (hasIsolatedChannels(attributes)) {\n\t\t\t\tsnapshot = snapshot.trees[channelsTreeName];\n\t\t\t\tassert(\n\t\t\t\t\tsnapshot !== undefined,\n\t\t\t\t\t0x1ff /* \"isolated channels subtree should exist in local datastore snapshot\" */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.pkg === undefined) {\n\t\t\t\tthis.pkg = JSON.parse(attributes.pkg) as string[];\n\t\t\t\t// If there is no isRootDataStore in the attributes blob, set it to true. This ensures that data\n\t\t\t\t// stores in older documents are not garbage collected incorrectly. This may lead to additional\n\t\t\t\t// roots in the document but they won't break.\n\t\t\t\tif (attributes.isRootDataStore ?? true) {\n\t\t\t\t\tisRootDataStore = true;\n\t\t\t\t\tthis.setInMemoryRoot();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassert(this.pkg !== undefined, 0x152 /* \"pkg should be available in local data store\" */);\n\n\t\treturn {\n\t\t\tpkg: this.pkg,\n\t\t\tisRootDataStore,\n\t\t\tsnapshot,\n\t\t};\n\t});\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\treturn this.initialSnapshotDetailsP;\n\t}\n\n\t/**\n\t * A context should only be marked as deleted when its a remote context.\n\t * Session Expiry at the runtime level should have closed the container creating the local data store context\n\t * before delete is even possible. Session Expiry is at 30 days, and sweep is done 36+ days later from the time\n\t * it was unreferenced. Thus the sweeping container should have loaded from a snapshot and thus creating a remote\n\t * context.\n\t */\n\tpublic delete(): void {\n\t\t// TODO: GC:Validation - potentially prevent this from happening or asserting. Maybe throw here.\n\t\tthis.mc.logger.sendErrorEvent({\n\t\t\teventName: \"GC_Deleted_DataStore_Unexpected_Delete\",\n\t\t\tmessage: \"Unexpected deletion of a local data store context\",\n\t\t});\n\t\tsuper.delete();\n\t}\n}\n\n/**\n * context implementation for \"attached\" data store runtime.\n * Various workflows (snapshot creation, requests) result in .realize() being called\n * on context, resulting in instantiation and attachment of runtime.\n * Runtime is created using data store factory that is associated with this context.\n * @internal\n */\nexport class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(props);\n\t}\n}\n\n/**\n * Detached context. Data Store runtime will be attached to it by attachRuntime() call\n * Before attachment happens, this context is not associated with particular type of runtime\n * or factory, i.e. it's package path is undefined.\n * Attachment process provides all missing parts - package path, data store runtime, and data store factory\n */\nexport class LocalDetachedFluidDataStoreContext\n\textends LocalFluidDataStoreContextBase\n\timplements IFluidDataStoreContextDetached\n{\n\tconstructor(props: ILocalDetachedFluidDataStoreContextProps) {\n\t\tsuper(props);\n\t\tthis.detachedRuntimeCreation = true;\n\t\tthis.channelToDataStoreFn = props.channelToDataStoreFn;\n\t}\n\tprivate readonly channelToDataStoreFn: (channel: IFluidDataStoreChannel) => IDataStore;\n\n\tpublic async attachRuntime(\n\t\tregistry: IProvideFluidDataStoreFactory,\n\t\tdataStoreChannel: IFluidDataStoreChannel,\n\t): Promise<IDataStore> {\n\t\tassert(this.detachedRuntimeCreation, 0x154 /* \"runtime creation is already attached\" */);\n\t\tthis.detachedRuntimeCreation = false;\n\n\t\tassert(this.channelP === undefined, 0x155 /* \"channel deferral is already set\" */);\n\n\t\tthis.channelP = Promise.resolve()\n\t\t\t.then(async () => {\n\t\t\t\tconst factory = registry.IFluidDataStoreFactory;\n\n\t\t\t\tconst factory2 = await this.factoryFromPackagePath();\n\t\t\t\tassert(factory2 === factory, 0x156 /* \"Unexpected factory for package path\" */);\n\n\t\t\t\tawait super.bindRuntime(dataStoreChannel, false /* existing */);\n\n\t\t\t\tassert(\n\t\t\t\t\t!(await this.isRoot()),\n\t\t\t\t\t0x8f7 /* there are no more createRootDataStore() kind of APIs! */,\n\t\t\t\t);\n\n\t\t\t\treturn dataStoreChannel;\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.mc.logger.sendErrorEvent({ eventName: \"AttachRuntimeError\" }, error);\n\t\t\t\t// The following two lines result in same exception thrown.\n\t\t\t\t// But we need to ensure that this.channelDeferred.promise is \"observed\", as otherwise\n\t\t\t\t// out UT reports unhandled exception\n\t\t\t\tthrow error;\n\t\t\t});\n\n\t\treturn this.channelToDataStoreFn(await this.channelP);\n\t}\n\n\t/**\n\t * This method provides a synchronous path for binding a runtime to the context.\n\t *\n\t * Due to its synchronous nature, it is unable to validate that the runtime\n\t * represents a datastore which is instantiable by remote clients. This could\n\t * happen if the runtime's package path does not return a factory when looked up\n\t * in the container runtime's registry, or if the runtime's entrypoint is not\n\t * properly initialized. As both of these validation's are asynchronous to preform.\n\t *\n\t * If used incorrectly, this function can result in permanent data corruption.\n\t */\n\tpublic unsafe_AttachRuntimeSync(channel: IFluidDataStoreChannel): IDataStore {\n\t\tthis.channelP = Promise.resolve(channel);\n\t\tthis.processPendingOps(channel);\n\t\tthis.completeBindingRuntime(channel);\n\t\treturn this.channelToDataStoreFn(channel);\n\t}\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\tif (this.detachedRuntimeCreation) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Detached Fluid Data Store context can't be realized! Please attach runtime first!\",\n\t\t\t);\n\t\t}\n\t\treturn super.getInitialSnapshotDetails();\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"deltaScheduler.d.ts","sourceRoot":"","sources":["../src/deltaScheduler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAExF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,0CAA0C,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAc;IA4BzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM;IA5BxB,gBAAuB,cAAc,MAAM;IAG3C,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAM;IAE9C,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,mCAAmC,CAAyC;IAKpF,OAAO,CAAC,eAAe,CAAa;IAEpC,OAAO,CAAC,aAAa,CAUR;gBAGK,YAAY,EAAE,iBAAiB,EAC/B,oBAAoB,EAAE,iBAAiB,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IAEF;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAK1B"}
@@ -30,6 +30,7 @@ export class DeltaScheduler {
30
30
  // to process the ops.
31
31
  this.schedulingCount = 0;
32
32
  this.batchBegin = (message) => {
33
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy
33
34
  if (this.processingStartTime === undefined) {
34
35
  this.processingStartTime = performanceNow();
35
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"deltaScheduler.js","sourceRoot":"","sources":["../src/deltaScheduler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAA0B,MAAM,8BAA8B,CAAC;AAItF,OAAO,EAEN,UAAU,GACV,MAAM,0CAA0C,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IA2B1B,YACkB,YAA+B,EAC/B,oBAAoE,EACpE,MAA2B;QAF3B,iBAAY,GAAZ,YAAY,CAAmB;QAC/B,yBAAoB,GAApB,oBAAoB,CAAgD;QACpE,WAAM,GAAN,MAAM,CAAqB;QA1B7C,2DAA2D;QAC1C,4BAAuB,GAAG,EAAE,CAAC;QAGtC,wCAAmC,GAAW,cAAc,CAAC,cAAc,CAAC;QAEpF,+FAA+F;QAC/F,gGAAgG;QAChG,sBAAsB;QACd,oBAAe,GAAW,CAAC,CAAC;QA8BnB,eAAU,GAAG,CAAC,OAAkC,EAAQ,EAAE;YAC1E,IAAI,IAAI,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;gBAC5C,IAAI,CAAC,mBAAmB,GAAG,cAAc,EAAE,CAAC;YAC7C,CAAC;YACD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC;gBAC1E,iFAAiF;gBACjF,oFAAoF;gBACpF,IAAI,CAAC,aAAa,GAAG;oBACpB,qBAAqB,EAAE,CAAC;oBACxB,aAAa,EAAE,CAA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AC,MAAM,GAAG,CAAC,CAAC;IAC7C,CAAC;;AAzJD,gDAAgD;AACzB,6BAAc,GAAG,EAAE,AAAL,CAAM","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow, type TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type { IDeltaManagerFull } from \"@fluidframework/container-definitions/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type { IContainerRuntimeBaseEvents } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\tformatTick,\n} from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * DeltaScheduler is responsible for the scheduling of inbound delta queue in cases where there\n * is more than one op a particular run of the queue. It does not schedule if there is just one\n * op or just one batch in the run. It does the following two things:\n *\n * 1. If the ops have been processed for more than a specific amount of time, it pauses the queue\n * and calls setTimeout to schedule a resume of the queue. This ensures that we don't block\n * the JS thread for a long time processing ops synchronously (for example, when catching up\n * ops right after boot or catching up ops / delayed realizing data stores by summarizer).\n *\n * 2. If we scheduled a particular run of the queue, it logs telemetry for the number of ops\n * processed, the time and number of turns it took to process the ops.\n */\nexport class DeltaScheduler {\n\t// The time for processing ops in a single turn.\n\tpublic static readonly processingTime = 50;\n\n\t// The increase in time for processing ops after each turn.\n\tprivate readonly processingTimeIncrement = 10;\n\n\tprivate processingStartTime: number | undefined;\n\tprivate currentAllowedProcessingTimeForTurn: number = DeltaScheduler.processingTime;\n\n\t// This keeps track of the number of times inbound queue has been scheduled. After a particular\n\t// count, we log telemetry for the number of ops processed, the time and number of turns it took\n\t// to process the ops.\n\tprivate schedulingCount: number = 0;\n\n\tprivate schedulingLog:\n\t\t| {\n\t\t\t\topsRemainingToProcess: number;\n\t\t\t\ttotalProcessingTime: number;\n\t\t\t\tnumberOfTurns: number;\n\t\t\t\tnumberOfBatchesProcessed: number;\n\t\t\t\tlastSequenceNumber: number;\n\t\t\t\tfirstSequenceNumber: number;\n\t\t\t\tstartTime: number;\n\t\t }\n\t\t| undefined;\n\n\tconstructor(\n\t\tprivate readonly deltaManager: IDeltaManagerFull,\n\t\tprivate readonly runtimeEventsEmitter: TypedEventEmitter<IContainerRuntimeBaseEvents>,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.deltaManager.inbound.on(\"idle\", this.inboundQueueIdle);\n\t\truntimeEventsEmitter.on(\"batchBegin\", this.batchBegin);\n\t\truntimeEventsEmitter.on(\"batchEnd\", this.batchEnd);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.deltaManager.inbound.off(\"idle\", this.inboundQueueIdle);\n\t\tthis.runtimeEventsEmitter.off(\"batchBegin\", this.batchBegin);\n\t\tthis.runtimeEventsEmitter.off(\"batchEnd\", this.batchEnd);\n\t}\n\n\tprivate readonly batchBegin = (message: ISequencedDocumentMessage): void => {\n\t\tif (this.processingStartTime === undefined) {\n\t\t\tthis.processingStartTime = performanceNow();\n\t\t}\n\t\tif (this.schedulingLog === undefined && this.schedulingCount % 500 === 0) {\n\t\t\t// Every 500th time we are scheduling the inbound queue, we log telemetry for the\n\t\t\t// number of ops processed, the time and number of turns it took to process the ops.\n\t\t\tthis.schedulingLog = {\n\t\t\t\topsRemainingToProcess: 0,\n\t\t\t\tnumberOfTurns: 1,\n\t\t\t\ttotalProcessingTime: 0,\n\t\t\t\tnumberOfBatchesProcessed: 0,\n\t\t\t\tfirstSequenceNumber: message.sequenceNumber,\n\t\t\t\tlastSequenceNumber: message.sequenceNumber,\n\t\t\t\tstartTime: performanceNow(),\n\t\t\t};\n\t\t}\n\t};\n\n\tprivate readonly batchEnd = (error: unknown, message: ISequencedDocumentMessage): void => {\n\t\tif (this.schedulingLog) {\n\t\t\tthis.schedulingLog.numberOfBatchesProcessed++;\n\t\t\tthis.schedulingLog.lastSequenceNumber = message.sequenceNumber;\n\t\t\tthis.schedulingLog.opsRemainingToProcess = this.deltaManager.inbound.length;\n\t\t}\n\n\t\tif (this.shouldRunScheduler()) {\n\t\t\tconst currentTime = performanceNow();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst elapsedTime = currentTime - this.processingStartTime!;\n\t\t\tif (elapsedTime > this.currentAllowedProcessingTimeForTurn) {\n\t\t\t\t// We have processed ops for more than the total processing time. So, pause the\n\t\t\t\t// queue, yield the thread and schedule a resume.\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tthis.deltaManager.inbound.pause();\n\n\t\t\t\t// Increase the total processing time. Keep doing this after each turn until all the ops have\n\t\t\t\t// been processed. This way we keep the responsiveness at the beginning while also making sure\n\t\t\t\t// that all the ops process fairly quickly.\n\t\t\t\tthis.currentAllowedProcessingTimeForTurn += this.processingTimeIncrement;\n\n\t\t\t\t// If we are logging the telemetry this time, update the telemetry log object.\n\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\tthis.schedulingLog.numberOfTurns++;\n\t\t\t\t\tthis.schedulingLog.totalProcessingTime += elapsedTime;\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\t\teventName: \"InboundOpsPartialProcessingTime\",\n\t\t\t\t\t\t\tduration: formatTick(elapsedTime),\n\t\t\t\t\t\t\topsProcessed:\n\t\t\t\t\t\t\t\tthis.schedulingLog.lastSequenceNumber -\n\t\t\t\t\t\t\t\tthis.schedulingLog.firstSequenceNumber +\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\topsRemainingToProcess: this.deltaManager.inbound.length,\n\t\t\t\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\t\t\t\ttimeToResume: formatTick(performanceNow() - currentTime),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.deltaManager.inbound.resume();\n\t\t\t\t});\n\n\t\t\t\tthis.processingStartTime = undefined;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate readonly inboundQueueIdle = (): void => {\n\t\tif (this.schedulingLog) {\n\t\t\t// Add the time taken for processing the final ops to the total processing time in the\n\t\t\t// telemetry log object.\n\t\t\tconst currentTime = performanceNow();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tthis.schedulingLog.totalProcessingTime += currentTime - this.processingStartTime!;\n\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"InboundOpsProcessingTime\",\n\t\t\t\topsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,\n\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\topsProcessed:\n\t\t\t\t\tthis.schedulingLog.lastSequenceNumber - this.schedulingLog.firstSequenceNumber + 1,\n\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\tduration: formatTick(currentTime - this.schedulingLog.startTime),\n\t\t\t\tschedulingCount: this.schedulingCount,\n\t\t\t});\n\n\t\t\tthis.schedulingLog = undefined;\n\t\t}\n\n\t\t// If we scheduled this batch of the inbound queue, increment the counter that tracks the\n\t\t// number of times we have done this.\n\t\tthis.schedulingCount++;\n\n\t\t// Reset the processing times.\n\t\tthis.processingStartTime = undefined;\n\t\tthis.currentAllowedProcessingTimeForTurn = DeltaScheduler.processingTime;\n\t};\n\n\t/**\n\t * This function tells whether we should run the scheduler.\n\t */\n\tprivate shouldRunScheduler(): boolean {\n\t\t// If there are still ops in the queue after the one we are processing now, we should\n\t\t// run the scheduler.\n\t\treturn this.deltaManager.inbound.length > 0;\n\t}\n}\n"]}
1
+ {"version":3,"file":"deltaScheduler.js","sourceRoot":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AC,CAAC;gBAEH,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;YAChC,CAAC;YAED,yFAAyF;YACzF,qCAAqC;YACrC,IAAI,CAAC,eAAe,EAAE,CAAC;YAEvB,8BAA8B;YAC9B,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACrC,IAAI,CAAC,mCAAmC,GAAG,cAAc,CAAC,cAAc,CAAC;QAC1E,CAAC,CAAC;QAlHD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC5D,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACvD,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;IAEM,OAAO;QACb,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7D,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;IA2GD;;OAEG;IACK,kBAAkB;QACzB,qFAAqF;QACrF,qBAAqB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,CAAC;;AA1JD,gDAAgD;AACzB,6BAAc,GAAG,EAAE,AAAL,CAAM","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow, type TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type { IDeltaManagerFull } from \"@fluidframework/container-definitions/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type { IContainerRuntimeBaseEvents } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\tformatTick,\n} from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * DeltaScheduler is responsible for the scheduling of inbound delta queue in cases where there\n * is more than one op a particular run of the queue. It does not schedule if there is just one\n * op or just one batch in the run. It does the following two things:\n *\n * 1. If the ops have been processed for more than a specific amount of time, it pauses the queue\n * and calls setTimeout to schedule a resume of the queue. This ensures that we don't block\n * the JS thread for a long time processing ops synchronously (for example, when catching up\n * ops right after boot or catching up ops / delayed realizing data stores by summarizer).\n *\n * 2. If we scheduled a particular run of the queue, it logs telemetry for the number of ops\n * processed, the time and number of turns it took to process the ops.\n */\nexport class DeltaScheduler {\n\t// The time for processing ops in a single turn.\n\tpublic static readonly processingTime = 50;\n\n\t// The increase in time for processing ops after each turn.\n\tprivate readonly processingTimeIncrement = 10;\n\n\tprivate processingStartTime: number | undefined;\n\tprivate currentAllowedProcessingTimeForTurn: number = DeltaScheduler.processingTime;\n\n\t// This keeps track of the number of times inbound queue has been scheduled. After a particular\n\t// count, we log telemetry for the number of ops processed, the time and number of turns it took\n\t// to process the ops.\n\tprivate schedulingCount: number = 0;\n\n\tprivate schedulingLog:\n\t\t| {\n\t\t\t\topsRemainingToProcess: number;\n\t\t\t\ttotalProcessingTime: number;\n\t\t\t\tnumberOfTurns: number;\n\t\t\t\tnumberOfBatchesProcessed: number;\n\t\t\t\tlastSequenceNumber: number;\n\t\t\t\tfirstSequenceNumber: number;\n\t\t\t\tstartTime: number;\n\t\t }\n\t\t| undefined;\n\n\tconstructor(\n\t\tprivate readonly deltaManager: IDeltaManagerFull,\n\t\tprivate readonly runtimeEventsEmitter: TypedEventEmitter<IContainerRuntimeBaseEvents>,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.deltaManager.inbound.on(\"idle\", this.inboundQueueIdle);\n\t\truntimeEventsEmitter.on(\"batchBegin\", this.batchBegin);\n\t\truntimeEventsEmitter.on(\"batchEnd\", this.batchEnd);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.deltaManager.inbound.off(\"idle\", this.inboundQueueIdle);\n\t\tthis.runtimeEventsEmitter.off(\"batchBegin\", this.batchBegin);\n\t\tthis.runtimeEventsEmitter.off(\"batchEnd\", this.batchEnd);\n\t}\n\n\tprivate readonly batchBegin = (message: ISequencedDocumentMessage): void => {\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy\n\t\tif (this.processingStartTime === undefined) {\n\t\t\tthis.processingStartTime = performanceNow();\n\t\t}\n\t\tif (this.schedulingLog === undefined && this.schedulingCount % 500 === 0) {\n\t\t\t// Every 500th time we are scheduling the inbound queue, we log telemetry for the\n\t\t\t// number of ops processed, the time and number of turns it took to process the ops.\n\t\t\tthis.schedulingLog = {\n\t\t\t\topsRemainingToProcess: 0,\n\t\t\t\tnumberOfTurns: 1,\n\t\t\t\ttotalProcessingTime: 0,\n\t\t\t\tnumberOfBatchesProcessed: 0,\n\t\t\t\tfirstSequenceNumber: message.sequenceNumber,\n\t\t\t\tlastSequenceNumber: message.sequenceNumber,\n\t\t\t\tstartTime: performanceNow(),\n\t\t\t};\n\t\t}\n\t};\n\n\tprivate readonly batchEnd = (error: unknown, message: ISequencedDocumentMessage): void => {\n\t\tif (this.schedulingLog) {\n\t\t\tthis.schedulingLog.numberOfBatchesProcessed++;\n\t\t\tthis.schedulingLog.lastSequenceNumber = message.sequenceNumber;\n\t\t\tthis.schedulingLog.opsRemainingToProcess = this.deltaManager.inbound.length;\n\t\t}\n\n\t\tif (this.shouldRunScheduler()) {\n\t\t\tconst currentTime = performanceNow();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst elapsedTime = currentTime - this.processingStartTime!;\n\t\t\tif (elapsedTime > this.currentAllowedProcessingTimeForTurn) {\n\t\t\t\t// We have processed ops for more than the total processing time. So, pause the\n\t\t\t\t// queue, yield the thread and schedule a resume.\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tthis.deltaManager.inbound.pause();\n\n\t\t\t\t// Increase the total processing time. Keep doing this after each turn until all the ops have\n\t\t\t\t// been processed. This way we keep the responsiveness at the beginning while also making sure\n\t\t\t\t// that all the ops process fairly quickly.\n\t\t\t\tthis.currentAllowedProcessingTimeForTurn += this.processingTimeIncrement;\n\n\t\t\t\t// If we are logging the telemetry this time, update the telemetry log object.\n\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\tthis.schedulingLog.numberOfTurns++;\n\t\t\t\t\tthis.schedulingLog.totalProcessingTime += elapsedTime;\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\t\teventName: \"InboundOpsPartialProcessingTime\",\n\t\t\t\t\t\t\tduration: formatTick(elapsedTime),\n\t\t\t\t\t\t\topsProcessed:\n\t\t\t\t\t\t\t\tthis.schedulingLog.lastSequenceNumber -\n\t\t\t\t\t\t\t\tthis.schedulingLog.firstSequenceNumber +\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\topsRemainingToProcess: this.deltaManager.inbound.length,\n\t\t\t\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\t\t\t\ttimeToResume: formatTick(performanceNow() - currentTime),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.deltaManager.inbound.resume();\n\t\t\t\t});\n\n\t\t\t\tthis.processingStartTime = undefined;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate readonly inboundQueueIdle = (): void => {\n\t\tif (this.schedulingLog) {\n\t\t\t// Add the time taken for processing the final ops to the total processing time in the\n\t\t\t// telemetry log object.\n\t\t\tconst currentTime = performanceNow();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tthis.schedulingLog.totalProcessingTime += currentTime - this.processingStartTime!;\n\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"InboundOpsProcessingTime\",\n\t\t\t\topsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,\n\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\topsProcessed:\n\t\t\t\t\tthis.schedulingLog.lastSequenceNumber - this.schedulingLog.firstSequenceNumber + 1,\n\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\tduration: formatTick(currentTime - this.schedulingLog.startTime),\n\t\t\t\tschedulingCount: this.schedulingCount,\n\t\t\t});\n\n\t\t\tthis.schedulingLog = undefined;\n\t\t}\n\n\t\t// If we scheduled this batch of the inbound queue, increment the counter that tracks the\n\t\t// number of times we have done this.\n\t\tthis.schedulingCount++;\n\n\t\t// Reset the processing times.\n\t\tthis.processingStartTime = undefined;\n\t\tthis.currentAllowedProcessingTimeForTurn = DeltaScheduler.processingTime;\n\t};\n\n\t/**\n\t * This function tells whether we should run the scheduler.\n\t */\n\tprivate shouldRunScheduler(): boolean {\n\t\t// If there are still ops in the queue after the one we are processing now, we should\n\t\t// run the scheduler.\n\t\treturn this.deltaManager.inbound.length > 0;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"gcHelpers.d.ts","sourceRoot":"","sources":["../../src/gc/gcHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EACN,KAAK,6BAA6B,EAIlC,KAAK,sBAAsB,EAC3B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,eA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,GAAG,sBAAsB,CAQlF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,sBAAsB,EAC/B,OAAO,EAAE,sBAAsB,GAC7B,sBAAsB,CAWxB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAC1C,cAAc,EAAE,aAAa,EAC7B,gBAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,8BAA8B,CAAC,CAgCzC;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACxC,SAAS,EAAE,6BAA6B,GACtC,GAAG,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAiE5C;AAWD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAChD,qBAAqB,EAAE,KAAK,EAC5B,cAAc,EAAE,QAAQ,GAAG,eAAe,GAAG,SAAS,GACpD,OAAO,CAGT"}
@@ -185,6 +185,7 @@ export function unpackChildNodesGCDetails(gcDetails) {
185
185
  childGCNodeId = "/";
186
186
  }
187
187
  let childGCDetails = childGCDetailsMap.get(childId);
188
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy
188
189
  if (childGCDetails === undefined) {
189
190
  childGCDetails = { gcData: { gcNodes: {} }, usedRoutes: [] };
190
191
  }