@fluidframework/container-runtime 2.74.0 → 2.80.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 (103) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/blobManager/blobManager.d.ts +0 -2
  4. package/dist/blobManager/blobManager.d.ts.map +1 -1
  5. package/dist/blobManager/blobManager.js +4 -5
  6. package/dist/blobManager/blobManager.js.map +1 -1
  7. package/dist/channelCollection.d.ts +3 -3
  8. package/dist/channelCollection.d.ts.map +1 -1
  9. package/dist/channelCollection.js.map +1 -1
  10. package/dist/containerRuntime.d.ts +5 -0
  11. package/dist/containerRuntime.d.ts.map +1 -1
  12. package/dist/containerRuntime.js +13 -7
  13. package/dist/containerRuntime.js.map +1 -1
  14. package/dist/dataStoreContext.d.ts +1 -1
  15. package/dist/dataStoreContext.d.ts.map +1 -1
  16. package/dist/dataStoreContext.js +1 -1
  17. package/dist/dataStoreContext.js.map +1 -1
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/packageVersion.js +1 -1
  20. package/dist/packageVersion.js.map +1 -1
  21. package/dist/runtimeLayerCompatState.d.ts +9 -5
  22. package/dist/runtimeLayerCompatState.d.ts.map +1 -1
  23. package/dist/runtimeLayerCompatState.js +16 -6
  24. package/dist/runtimeLayerCompatState.js.map +1 -1
  25. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  26. package/dist/summary/summarizerClientElection.js +1 -0
  27. package/dist/summary/summarizerClientElection.js.map +1 -1
  28. package/dist/summary/summarizerTypes.d.ts +5 -0
  29. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  30. package/dist/summary/summarizerTypes.js.map +1 -1
  31. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts +3 -1
  32. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
  33. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js +39 -18
  34. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
  35. package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts +1 -1
  36. package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
  37. package/dist/summary/summaryDelayLoadedModule/summarizer.js +13 -11
  38. package/dist/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
  39. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.d.ts +4 -1
  40. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.d.ts.map +1 -1
  41. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js +30 -9
  42. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  43. package/dist/summary/summaryManager.d.ts +1 -1
  44. package/dist/summary/summaryManager.d.ts.map +1 -1
  45. package/dist/summary/summaryManager.js +10 -9
  46. package/dist/summary/summaryManager.js.map +1 -1
  47. package/lib/blobManager/blobManager.d.ts +0 -2
  48. package/lib/blobManager/blobManager.d.ts.map +1 -1
  49. package/lib/blobManager/blobManager.js +4 -5
  50. package/lib/blobManager/blobManager.js.map +1 -1
  51. package/lib/channelCollection.d.ts +3 -3
  52. package/lib/channelCollection.d.ts.map +1 -1
  53. package/lib/channelCollection.js.map +1 -1
  54. package/lib/containerRuntime.d.ts +5 -0
  55. package/lib/containerRuntime.d.ts.map +1 -1
  56. package/lib/containerRuntime.js +13 -7
  57. package/lib/containerRuntime.js.map +1 -1
  58. package/lib/dataStoreContext.d.ts +1 -1
  59. package/lib/dataStoreContext.d.ts.map +1 -1
  60. package/lib/dataStoreContext.js +1 -1
  61. package/lib/dataStoreContext.js.map +1 -1
  62. package/lib/packageVersion.d.ts +1 -1
  63. package/lib/packageVersion.js +1 -1
  64. package/lib/packageVersion.js.map +1 -1
  65. package/lib/runtimeLayerCompatState.d.ts +9 -5
  66. package/lib/runtimeLayerCompatState.d.ts.map +1 -1
  67. package/lib/runtimeLayerCompatState.js +15 -5
  68. package/lib/runtimeLayerCompatState.js.map +1 -1
  69. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  70. package/lib/summary/summarizerClientElection.js +1 -0
  71. package/lib/summary/summarizerClientElection.js.map +1 -1
  72. package/lib/summary/summarizerTypes.d.ts +5 -0
  73. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  74. package/lib/summary/summarizerTypes.js.map +1 -1
  75. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts +3 -1
  76. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
  77. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js +39 -18
  78. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
  79. package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts +1 -1
  80. package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
  81. package/lib/summary/summaryDelayLoadedModule/summarizer.js +13 -11
  82. package/lib/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
  83. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.d.ts +4 -1
  84. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.d.ts.map +1 -1
  85. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js +26 -5
  86. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  87. package/lib/summary/summaryManager.d.ts +1 -1
  88. package/lib/summary/summaryManager.d.ts.map +1 -1
  89. package/lib/summary/summaryManager.js +10 -9
  90. package/lib/summary/summaryManager.js.map +1 -1
  91. package/package.json +26 -26
  92. package/src/blobManager/blobManager.ts +3 -7
  93. package/src/channelCollection.ts +3 -3
  94. package/src/containerRuntime.ts +19 -6
  95. package/src/dataStoreContext.ts +2 -2
  96. package/src/packageVersion.ts +1 -1
  97. package/src/runtimeLayerCompatState.ts +25 -9
  98. package/src/summary/summarizerClientElection.ts +1 -0
  99. package/src/summary/summarizerTypes.ts +5 -0
  100. package/src/summary/summaryDelayLoadedModule/runningSummarizer.ts +54 -26
  101. package/src/summary/summaryDelayLoadedModule/summarizer.ts +13 -11
  102. package/src/summary/summaryDelayLoadedModule/summaryGenerator.ts +35 -5
  103. package/src/summary/summaryManager.ts +11 -10
@@ -1 +1 @@
1
- {"version":3,"file":"channelCollection.js","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAYpE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAMvE,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,qBAAqB,GACrB,MAAM,uCAAuC,CAAC;AAwB/C,OAAO,EACN,0BAA0B,EAC1B,gBAAgB,EAChB,aAAa,GACb,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,0BAA0B,GAC1B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EAEZ,iBAAiB,EACjB,4BAA4B,EAC5B,gCAAgC,EAChC,gBAAgB,GAEhB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EACN,wBAAwB,EAExB,wBAAwB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEN,kBAAkB,EAClB,uBAAuB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,qBAAqB,EAGrB,kCAAkC,EAClC,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,uBAAuB,CAAC;A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":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tISignalEnvelope,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, Lazy, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\nimport type {\n\tISnapshot,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tbuildSnapshotTree,\n\tgetSnapshotTree,\n\tisInstanceOfISnapshot,\n} from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tAliasResult,\n\tContainerExtensionProvider,\n\tFluidDataStoreMessage,\n\tIAttachMessage,\n\tIEnvelope,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIFluidParentContext,\n\tIGarbageCollectionData,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tMinimumVersionForCollab,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tCreateSummarizerNodeSource,\n\tchannelsTreeName,\n\tgcDataBlobKey,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tGCDataBuilder,\n\tRequestParser,\n\tRuntimeHeaders,\n\tSummaryTreeBuilder,\n\taddBlobToSummary,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tcreate404Response,\n\tcreateResponseError,\n\tencodeCompactIdToString,\n\tisSerializedHandle,\n\tprocessAttachMessageGCData,\n\tresponseToException,\n\tunpackChildNodesUsedRoutes,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\tLoggingError,\n\ttype MonitoringContext,\n\tcreateChildLogger,\n\tcreateChildMonitoringContext,\n\textractSafePropertiesFromMessage,\n\ttagCodeArtifacts,\n\ttype ITelemetryPropertiesExt,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n\tDeletedResponseHeaderKey,\n\ttype RuntimeHeaderData,\n\tdefaultRuntimeHeaderData,\n} from \"./containerRuntime.js\";\nimport {\n\ttype IDataStoreAliasMessage,\n\tchannelToDataStore,\n\tisDataStoreAliasMessage,\n} from \"./dataStore.js\";\nimport {\n\tFluidDataStoreContext,\n\ttype IFluidDataStoreContextPrivate,\n\ttype ILocalDetachedFluidDataStoreContextProps,\n\tLocalDetachedFluidDataStoreContext,\n\tLocalFluidDataStoreContext,\n\tRemoteFluidDataStoreContext,\n\tcreateAttributesBlob,\n} from \"./dataStoreContext.js\";\nimport { DataStoreContexts } from \"./dataStoreContexts.js\";\nimport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nimport { GCNodeType, type IGCNodeUpdatedProps, urlToGCNodePath } from \"./gc/index.js\";\nimport type {\n\tContainerRuntimeAliasMessage,\n\tContainerRuntimeDataStoreOpMessage,\n\tOutboundContainerRuntimeAttachMessage,\n} from \"./messageTypes.js\";\nimport { ContainerMessageType, type LocalContainerRuntimeMessage } from \"./messageTypes.js\";\nimport { StorageServiceWithAttachBlobs } from \"./storageServiceWithAttachBlobs.js\";\nimport {\n\ttype IContainerRuntimeMetadata,\n\tnonDataStorePaths,\n\trootHasIsolatedChannels,\n} from \"./summary/index.js\";\n\n/**\n * True if a tombstoned object should be returned without erroring\n * @legacy @beta\n */\nexport const AllowTombstoneRequestHeaderKey = \"allowTombstone\"; // Belongs in the enum above, but avoiding the breaking change\n\ntype PendingAliasResolve = (success: boolean) => void;\n\n/**\n * Envelope for signals not intended for the container.\n *\n * @privateRemarks\n * `clientBroadcastSignalSequenceNumber` might be added to the envelope by the container runtime.\n * But it should not be provided to start with.\n *\n * Equivalent to `Required<Omit<ISignalEnvelope, \"clientBroadcastSignalSequenceNumber\">>`.\n */\nexport type AddressedUnsequencedSignalEnvelope = IEnvelope<ISignalEnvelope[\"contents\"]>;\n\n/**\n * This version of the interface is private to this the package. It should never be exported under any tag.\n * It is used to manage interactions within the container-runtime package. If something is needed\n * cross package, it is likely it is also being used cross layer (ContainerRuntime * DataStoreRuntime).\n * If that is the case, the change likely needs to be staged directly on IFluidParentContext. Changes\n * being staged on IFluidParentContext can be added here as well, likely with optionality removed,\n * to ease interactions within this package.\n */\nexport interface IFluidParentContextPrivate\n\textends IFluidParentContext,\n\t\tContainerExtensionProvider {\n\treadonly isReadOnly: () => boolean;\n\treadonly minVersionForCollab: MinimumVersionForCollab;\n}\n\n/**\n * Kin of {@link @fluidframework/runtime-definitions#IFluidParentContext} with alternate\n * `submitMessage` and `submitSignal` methods that are typed specifically for the\n * root context (aka {@link ContainerRuntime} provided context).\n *\n * @privateRemarks\n * These replacements might be able to get cleaned up if the future suggestions\n * found in {@link @fluidframework/runtime-definitions#FluidDataStoreMessage}\n * `@privateRemarks` section are implemented.\n */\nexport interface IFluidRootParentContextPrivate\n\textends Omit<IFluidParentContextPrivate, \"submitMessage\" | \"submitSignal\"> {\n\t/**\n\t * Submits the message to be sent to other clients.\n\t * @param containerRuntimeMessage - The message.\n\t * @param localOpMetadata - The local metadata associated with the message.\n\t * This is kept locally and not sent to the server. This will be sent back\n\t * when this message is received back from the server. This is also sent if\n\t * we are asked to resubmit the message.\n\t */\n\treadonly submitMessage: (\n\t\tcontainerRuntimeMessage:\n\t\t\t| ContainerRuntimeDataStoreOpMessage\n\t\t\t| OutboundContainerRuntimeAttachMessage\n\t\t\t| ContainerRuntimeAliasMessage,\n\t\tlocalOpMetadata: unknown,\n\t) => void;\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param envelope - {@link IEnvelope} containing the signal address and contents.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\treadonly submitSignal: (\n\t\tenvelope: AddressedUnsequencedSignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n}\n\ntype SubmitKeys = \"submitMessage\" | \"submitSignal\";\n\n/**\n * Creates a shallow wrapper of {@link IFluidParentContextPrivate} or\n * {@link IFluidRootParentContextPrivate} with `submitMessage` and `submitSignal`\n * methods replaced with the provided overrides.\n */\nexport function formParentContext<\n\tT extends IFluidParentContextPrivate | IFluidRootParentContextPrivate,\n>(\n\tcontext: Omit<IFluidParentContextPrivate & IFluidRootParentContextPrivate, SubmitKeys>,\n\toverrides: Pick<T, SubmitKeys>,\n): Omit<IFluidParentContextPrivate & IFluidRootParentContextPrivate, SubmitKeys> &\n\tPick<T, SubmitKeys> {\n\treturn {\n\t\tget IFluidDataStoreRegistry() {\n\t\t\treturn context.IFluidDataStoreRegistry;\n\t\t},\n\t\tIFluidHandleContext: context.IFluidHandleContext,\n\t\toptions: context.options,\n\t\tget clientId() {\n\t\t\treturn context.clientId;\n\t\t},\n\t\tget connected() {\n\t\t\treturn context.connected;\n\t\t},\n\t\tdeltaManager: context.deltaManager,\n\t\tstorage: context.storage,\n\t\tbaseLogger: context.baseLogger,\n\t\tget clientDetails() {\n\t\t\treturn context.clientDetails;\n\t\t},\n\t\tget idCompressor() {\n\t\t\treturn context.idCompressor;\n\t\t},\n\t\tloadingGroupId: context.loadingGroupId,\n\t\tget attachState() {\n\t\t\treturn context.attachState;\n\t\t},\n\t\tisReadOnly: () => context.isReadOnly(),\n\t\tcontainerRuntime: context.containerRuntime,\n\t\tscope: context.scope,\n\t\tgcThrowOnTombstoneUsage: context.gcThrowOnTombstoneUsage,\n\t\tgcTombstoneEnforcementAllowed: context.gcTombstoneEnforcementAllowed,\n\t\tgetAbsoluteUrl: async (...args) => {\n\t\t\treturn context.getAbsoluteUrl(...args);\n\t\t},\n\t\tgetQuorum: (...args) => {\n\t\t\treturn context.getQuorum(...args);\n\t\t},\n\t\tgetAudience: (...args) => {\n\t\t\treturn context.getAudience(...args);\n\t\t},\n\t\tsubmitMessage: overrides.submitMessage.bind(overrides),\n\t\tsubmitSignal: overrides.submitSignal,\n\t\tmakeLocallyVisible: (...args) => {\n\t\t\treturn context.makeLocallyVisible(...args);\n\t\t},\n\t\tuploadBlob: async (...args) => {\n\t\t\treturn context.uploadBlob(...args);\n\t\t},\n\t\taddedGCOutboundRoute: (...args) => {\n\t\t\treturn context.addedGCOutboundRoute(...args);\n\t\t},\n\t\tgetCreateChildSummarizerNodeFn: (...args) => {\n\t\t\treturn context.getCreateChildSummarizerNodeFn?.(...args);\n\t\t},\n\t\tdeleteChildSummarizerNode: (...args) => {\n\t\t\treturn context.deleteChildSummarizerNode(...args);\n\t\t},\n\t\tsetChannelDirty: (address: string) => {\n\t\t\treturn context.setChannelDirty(address);\n\t\t},\n\t\tminVersionForCollab: context.minVersionForCollab,\n\t\tgetExtension: context.getExtension.bind(context),\n\t};\n}\n\n/**\n * Creates a wrapper of a {@link IFluidRootParentContextPrivate} to be provided to the inner datastore channels.\n * The wrapper will have the submit methods overwritten with the appropriate id as the destination address.\n *\n * @param id - the id of the channel\n * @param parentContext - the {@link IFluidRootParentContextPrivate} to wrap\n * @returns A wrapped {@link IFluidParentContext}\n */\nfunction wrapContextForInnerChannel(\n\tid: string,\n\tparentContext: IFluidRootParentContextPrivate,\n): IFluidParentContextPrivate {\n\tconst context = formParentContext<IFluidParentContextPrivate>(parentContext, {\n\t\tsubmitMessage: (type: string, content: unknown, localOpMetadata: unknown) => {\n\t\t\tconst fluidDataStoreContent: FluidDataStoreMessage = {\n\t\t\t\tcontent,\n\t\t\t\ttype,\n\t\t\t};\n\t\t\tconst envelope = {\n\t\t\t\taddress: id,\n\t\t\t\tcontents: fluidDataStoreContent,\n\t\t\t};\n\t\t\tparentContext.submitMessage(\n\t\t\t\t{ type: ContainerMessageType.FluidDataStoreOp, contents: envelope },\n\t\t\t\tlocalOpMetadata,\n\t\t\t);\n\t\t},\n\t\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => {\n\t\t\tparentContext.submitSignal({ address: id, contents: { type, content } }, targetClientId);\n\t\t},\n\t});\n\n\treturn context;\n}\n\n/**\n * Returns the type of the given local data store from its package path.\n */\nexport function getLocalDataStoreType(localDataStore: LocalFluidDataStoreContext): string {\n\treturn localDataStore.packagePath[localDataStore.packagePath.length - 1];\n}\n\n/**\n * This class encapsulates data store handling. Currently it is only used by the container runtime,\n * but eventually could be hosted on any channel once we formalize the channel api boundary.\n * @internal\n */\nexport class ChannelCollection\n\timplements Omit<IFluidDataStoreChannel, \"entryPoint\" | \"reSubmit\" | \"rollback\">, IDisposable\n{\n\t// Stores tracked by the Domain\n\tprivate readonly pendingAttach = new Map<string, IAttachMessage>();\n\t// 0.24 back-compat attachingBeforeSummary\n\tpublic readonly attachOpFiredForDataStore = new Set<string>();\n\n\tprotected readonly mc: MonitoringContext;\n\n\t// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda\n\tprivate readonly disposeOnce = new Lazy<void>(() => this.contexts.dispose());\n\n\tpublic readonly containerLoadStats: {\n\t\t// number of dataStores during loadContainer\n\t\treadonly containerLoadDataStoreCount: number;\n\t\t// number of unreferenced dataStores during loadContainer\n\t\treadonly referencedDataStoreCount: number;\n\t};\n\n\tprivate readonly pendingAliasMap: Map<string, Promise<AliasResult>> = new Map<\n\t\tstring,\n\t\tPromise<AliasResult>\n\t>();\n\n\tprotected readonly contexts: DataStoreContexts;\n\tprivate readonly aliasedDataStores: Set<string>;\n\n\tconstructor(\n\t\tprotected readonly baseSnapshot: ISnapshotTree | ISnapshot | undefined,\n\t\tpublic readonly parentContext: IFluidRootParentContextPrivate,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly gcNodeUpdated: (props: IGCNodeUpdatedProps) => void,\n\t\tprivate readonly isDataStoreDeleted: (nodePath: string) => boolean,\n\t\tprivate readonly aliasMap: Map<string, string>,\n\t) {\n\t\tthis.mc = createChildMonitoringContext({ logger: baseLogger });\n\t\tthis.contexts = new DataStoreContexts(baseLogger);\n\t\tthis.aliasedDataStores = new Set(aliasMap.values());\n\n\t\t// Extract stores stored inside the snapshot\n\t\tconst fluidDataStores = new Map<string, ISnapshotTree>();\n\t\tif (baseSnapshot) {\n\t\t\tconst baseSnapshotTree = getSnapshotTree(baseSnapshot);\n\t\t\tfor (const [key, value] of Object.entries(baseSnapshotTree.trees)) {\n\t\t\t\tfluidDataStores.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\tlet unreferencedDataStoreCount = 0;\n\t\t// Create a context for each of them\n\t\tfor (const [key, value] of fluidDataStores) {\n\t\t\tlet dataStoreContext: FluidDataStoreContext;\n\n\t\t\t// counting number of unreferenced data stores\n\t\t\tif (value.unreferenced) {\n\t\t\t\tunreferencedDataStoreCount++;\n\t\t\t}\n\t\t\t// If we have a detached container, then create local data store contexts.\n\t\t\tif (this.parentContext.attachState === AttachState.Detached) {\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tthrow new LoggingError(\"Snapshot should be there to load from!!\");\n\t\t\t\t}\n\t\t\t\tconst snapshotTree = value;\n\t\t\t\tdataStoreContext = new LocalFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tpkg: undefined,\n\t\t\t\t\tparentContext: this.wrapContextForInnerChannel(key),\n\t\t\t\t\tstorage: this.parentContext.storage,\n\t\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),\n\t\t\t\t\tsnapshotTree,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlet snapshotForRemoteFluidDatastoreContext: ISnapshot | ISnapshotTree = value;\n\t\t\t\tif (isInstanceOfISnapshot(baseSnapshot)) {\n\t\t\t\t\tsnapshotForRemoteFluidDatastoreContext = {\n\t\t\t\t\t\t...baseSnapshot,\n\t\t\t\t\t\tsnapshotTree: value,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tsnapshot: snapshotForRemoteFluidDatastoreContext,\n\t\t\t\t\tparentContext: this.wrapContextForInnerChannel(key),\n\t\t\t\t\tstorage: this.parentContext.storage,\n\t\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tloadingGroupId: value.groupId,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\t\t}\n\t\tthis.containerLoadStats = {\n\t\t\tcontainerLoadDataStoreCount: fluidDataStores.size,\n\t\t\treferencedDataStoreCount: fluidDataStores.size - unreferencedDataStoreCount,\n\t\t};\n\t}\n\n\tpublic get aliases(): ReadonlyMap<string, string> {\n\t\treturn this.aliasMap;\n\t}\n\n\tpublic get pendingAliases(): Map<string, Promise<AliasResult>> {\n\t\treturn this.pendingAliasMap;\n\t}\n\n\tpublic async waitIfPendingAlias(maybeAlias: string): Promise<AliasResult> {\n\t\tconst pendingAliasPromise = this.pendingAliases.get(maybeAlias);\n\t\treturn pendingAliasPromise ?? \"Success\";\n\t}\n\n\t/**\n\t * For sampling. Only log once per container\n\t */\n\tprivate shouldSendAttachLog = true;\n\n\tprotected wrapContextForInnerChannel(id: string): IFluidParentContextPrivate {\n\t\treturn wrapContextForInnerChannel(id, this.parentContext);\n\t}\n\n\t/**\n\t * IFluidDataStoreChannel.makeVisibleAndAttachGraph implementation\n\t * Not clear when it would be called and what it should do.\n\t * Currently this API is called by context only for root data stores.\n\t */\n\tpublic makeVisibleAndAttachGraph(): void {\n\t\tthis.parentContext.makeLocallyVisible();\n\t}\n\n\tprivate processAttachMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tfor (const { contents } of messagesContent) {\n\t\t\tconst attachMessage = contents as InboundAttachMessage;\n\t\t\t// We need to process the GC Data for both local and remote attach messages\n\t\t\tconst foundGCData = processAttachMessageGCData(\n\t\t\t\tattachMessage.snapshot ?? undefined,\n\t\t\t\t(nodeId, toPath) => {\n\t\t\t\t\t// nodeId is the relative path under the node being attached. Always starts with \"/\", but no trailing \"/\" after an id\n\t\t\t\t\tconst fromPath = `/${attachMessage.id}${nodeId === \"/\" ? \"\" : nodeId}`;\n\t\t\t\t\tthis.parentContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp);\n\t\t\t\t},\n\t\t\t);\n\n\t\t\t// Only log once per container to avoid noise/cost.\n\t\t\t// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details\n\t\t\tif (this.shouldSendAttachLog) {\n\t\t\t\tthis.shouldSendAttachLog = false;\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"dataStoreAttachMessage_sampled\",\n\t\t\t\t\t...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\tsnapshot: !!attachMessage.snapshot,\n\t\t\t\t\t\tfoundGCData,\n\t\t\t\t\t},\n\t\t\t\t\t...extractSafePropertiesFromMessage(envelope),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// The local object has already been attached\n\t\t\tif (local) {\n\t\t\t\tassert(\n\t\t\t\t\tthis.pendingAttach.has(attachMessage.id),\n\t\t\t\t\t0x15e /* \"Local object does not have matching attach message id\" */,\n\t\t\t\t);\n\t\t\t\tthis.contexts.get(attachMessage.id)?.setAttachState(AttachState.Attached);\n\t\t\t\tthis.pendingAttach.delete(attachMessage.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check for collision with local (not yet live / known to other clients) DataStore\n\t\t\t// This is not a DataCorruption case if we crash the container before the DataStore becomes visible to others (it's a DataProcessingError instead)\n\t\t\t//\n\t\t\t// POSSIBLE CAUSES:\n\t\t\t// - Something with ID creation, e.g. a bug in shortID logic, or somehow a generated ID matches an existing alias.\n\t\t\t// - An invalid operation by the application or service where an existing container is returned to a new container attach call,\n\t\t\t// resulting in duplicate accounting for objects that were supposed to be local-only. e.g. if the application patches in custom\n\t\t\t// logic not supported by Fluid's API.\n\t\t\tif (this.contexts.getUnbound(attachMessage.id) !== undefined) {\n\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\"Local DataStore matches remote DataStore id\",\n\t\t\t\t\t\"DataStoreAttach\",\n\t\t\t\t\tenvelope,\n\t\t\t\t\t{ ...tagCodeArtifacts({ dataStoreId: attachMessage.id }) },\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\t// Check for collision with already processed (attaching/attached or aliased) DataStore\n\t\t\t// This is presumed to indicate a corrupted op stream, where we'd expect all future sessions to fail here too.\n\t\t\t//\n\t\t\t// POSSIBLE CAUSES:\n\t\t\t// - A bug in the service or driver that results in ops being duplicated\n\t\t\t// - Similar to above, an existing container being returned to a new container attach call,\n\t\t\t// where the DataStore in question was already made locally visible before container attach.\n\t\t\t// (Perhaps future sessions would not fail in this case, but it's hypothetical and hard to differentiate)\n\t\t\tif (this.alreadyProcessed(attachMessage.id)) {\n\t\t\t\tconst error = new DataCorruptionError(\n\t\t\t\t\t// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId\n\t\t\t\t\t\"Duplicate DataStore created with existing id\",\n\t\t\t\t\t{\n\t\t\t\t\t\t...extractSafePropertiesFromMessage(envelope),\n\t\t\t\t\t\t...tagCodeArtifacts({ dataStoreId: attachMessage.id }),\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\t\tlet snapshot: ISnapshotTree | ISnapshot | undefined;\n\t\t\tif (attachMessage.snapshot) {\n\t\t\t\tsnapshot = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);\n\t\t\t\tif (isInstanceOfISnapshot(this.baseSnapshot)) {\n\t\t\t\t\tsnapshot = { ...this.baseSnapshot, snapshotTree: snapshot };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Include the type of attach message which is the pkg of the store to be\n\t\t\t// used by RemoteFluidDataStoreContext in case it is not in the snapshot.\n\t\t\tconst pkg = [attachMessage.type];\n\t\t\tconst remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\tid: attachMessage.id,\n\t\t\t\tsnapshot,\n\t\t\t\tparentContext: this.wrapContextForInnerChannel(attachMessage.id),\n\t\t\t\tstorage: new StorageServiceWithAttachBlobs(\n\t\t\t\t\tthis.parentContext.storage,\n\t\t\t\t\tflatAttachBlobs,\n\t\t\t\t),\n\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\tloadingGroupId: attachMessage.snapshot?.groupId,\n\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(\n\t\t\t\t\tattachMessage.id,\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromAttach,\n\t\t\t\t\t\tsequenceNumber: envelope.sequenceNumber,\n\t\t\t\t\t\tsnapshot: attachMessage.snapshot ?? {\n\t\t\t\t\t\t\tentries: [createAttributesBlob(pkg, true /* isRootDataStore */)],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\tpkg,\n\t\t\t});\n\n\t\t\tthis.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);\n\t\t}\n\t}\n\n\tprivate processAliasMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tfor (const { contents, localOpMetadata } of messagesContent) {\n\t\t\tconst aliasMessage = contents as IDataStoreAliasMessage;\n\t\t\tif (!isDataStoreAliasMessage(aliasMessage)) {\n\t\t\t\tthrow new DataCorruptionError(\"malformedDataStoreAliasMessage\", {\n\t\t\t\t\t...extractSafePropertiesFromMessage(envelope),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst resolve = localOpMetadata as PendingAliasResolve;\n\t\t\tconst aliasResult = this.processAliasMessageCore(\n\t\t\t\taliasMessage.internalId,\n\t\t\t\taliasMessage.alias,\n\t\t\t\tenvelope.timestamp,\n\t\t\t);\n\t\t\tif (local) {\n\t\t\t\tresolve(aliasResult);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic processAliasMessageCore(\n\t\tinternalId: string,\n\t\talias: string,\n\t\tmessageTimestampMs?: number,\n\t): boolean {\n\t\tif (this.alreadyProcessed(alias)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst context = this.contexts.get(internalId);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted a signal.\n\t\tif (this.checkAndLogIfDeleted(internalId, context, \"Changed\", \"processAliasMessageCore\")) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (context === undefined) {\n\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\teventName: \"AliasFluidDataStoreNotFound\",\n\t\t\t\tfluidDataStoreId: internalId,\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\t// If message timestamp doesn't exist, this is called in a detached container. Don't notify GC in that case\n\t\t// because it doesn't run in detached container and doesn't need to know about this route.\n\t\tif (messageTimestampMs !== undefined) {\n\t\t\tthis.parentContext.addedGCOutboundRoute(\"/\", `/${internalId}`, messageTimestampMs);\n\t\t}\n\n\t\tthis.aliasMap.set(alias, context.id);\n\t\tthis.aliasedDataStores.add(context.id);\n\t\tcontext.setInMemoryRoot();\n\t\treturn true;\n\t}\n\n\tprivate alreadyProcessed(id: string): boolean {\n\t\treturn this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;\n\t}\n\n\t/**\n\t * Package up the context's attach summary etc into an IAttachMessage\n\t */\n\tprivate generateAttachMessage(localContext: LocalFluidDataStoreContext): IAttachMessage {\n\t\t// Get the attach summary.\n\t\tconst attachSummary = localContext.getAttachSummary();\n\n\t\t// Get the GC data and add it to the attach summary.\n\t\tconst attachGCData = localContext.getAttachGCData();\n\t\taddBlobToSummary(attachSummary, gcDataBlobKey, JSON.stringify(attachGCData));\n\n\t\t// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.\n\t\tconst snapshot = convertSummaryTreeToITree(attachSummary.summary);\n\n\t\treturn {\n\t\t\tid: localContext.id,\n\t\t\tsnapshot,\n\t\t\ttype: getLocalDataStoreType(localContext),\n\t\t} satisfies IAttachMessage;\n\t}\n\n\t/**\n\t * Make the data store locally visible in the container graph by moving the data store context from unbound to\n\t * bound list and submitting the attach message. This data store can now be reached from the root.\n\t * @param id - The id of the data store context to make visible.\n\t */\n\tprivate makeDataStoreLocallyVisible(id: string): void {\n\t\tconst localContext = this.contexts.getUnbound(id);\n\t\tassert(!!localContext, 0x15f /* \"Could not find unbound context to bind\" */);\n\n\t\t/**\n\t\t * If the container is not detached, it is globally visible to all clients. This data store should also be\n\t\t * globally visible. Move it to attaching state and send an \"attach\" op for it.\n\t\t * If the container is detached, this data store will be part of the summary that makes the container attached.\n\t\t */\n\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\tthis.submitAttachChannelOp(localContext);\n\t\t\tlocalContext.setAttachState(AttachState.Attaching);\n\t\t}\n\n\t\tthis.contexts.bind(id);\n\t}\n\n\tprotected submitAttachChannelOp(localContext: LocalFluidDataStoreContext): void {\n\t\tconst message = this.generateAttachMessage(localContext);\n\t\tthis.pendingAttach.set(localContext.id, message);\n\t\tthis.parentContext.submitMessage(\n\t\t\t{ type: ContainerMessageType.Attach, contents: message },\n\t\t\tundefined,\n\t\t);\n\t\tthis.attachOpFiredForDataStore.add(localContext.id);\n\t}\n\n\t/**\n\t * Generate compact internal DataStore ID.\n\t *\n\t * A note about namespace and name collisions:\n\t * This code assumes that that's the only way to generate internal IDs, and that it's Ok for this namespace to overlap with\n\t * user-provided alias names namespace.\n\t * There are two scenarios where it could cause trouble:\n\t * 1) Old files, where (already removed) CreateRoot*DataStore*() API was used, and thus internal name of data store\n\t * was provided by user. Such files may experience name collision with future data stores that receive a name generated\n\t * by this function.\n\t * 2) Much less likely, but if it happen that internal ID (generated by this function) is exactly the same as alias name\n\t * that user might use in the future, them ContainerRuntime.getAliasedDataStoreEntryPoint() or\n\t * ContainerRuntime.getDataStoreFromRequest() could return a data store with internalID matching user request, even though\n\t * user expected some other data store (that would receive alias later).\n\t * Please note that above mentioned functions have the implementation they have (allowing #2) due to #1.\n\t */\n\tprotected createDataStoreId(): string {\n\t\t/**\n\t\t * Return uuid if short-ids are explicitly disabled via feature flags.\n\t\t */\n\t\tif (this.mc.config.getBoolean(\"Fluid.Runtime.DisableShortIds\") === true) {\n\t\t\treturn uuid();\n\t\t} else {\n\t\t\t// We use three non-overlapping namespaces:\n\t\t\t// - detached state: even numbers\n\t\t\t// - attached state: odd numbers\n\t\t\t// - uuids\n\t\t\t// In first two cases we will encode result as strings in more compact form.\n\t\t\tif (this.parentContext.attachState === AttachState.Detached) {\n\t\t\t\t// container is detached, only one client observes content, no way to hit collisions with other clients.\n\t\t\t\treturn encodeCompactIdToString(2 * this.contexts.size);\n\t\t\t}\n\t\t\tconst id = this.parentContext.containerRuntime.generateDocumentUniqueId();\n\t\t\tif (typeof id === \"number\") {\n\t\t\t\treturn encodeCompactIdToString(2 * id + 1);\n\t\t\t}\n\t\t\treturn id;\n\t\t}\n\t}\n\n\tpublic createDetachedDataStore(\n\t\tpkg: readonly string[],\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextDetached {\n\t\treturn this.createContext(\n\t\t\tthis.createDataStoreId(),\n\t\t\tpkg,\n\t\t\tLocalDetachedFluidDataStoreContext,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\tpublic createDataStoreContext(\n\t\tpkg: readonly string[],\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextPrivate {\n\t\treturn this.createContext(\n\t\t\tthis.createDataStoreId(),\n\t\t\tpkg,\n\t\t\tLocalFluidDataStoreContext,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\tprotected createContext<T extends LocalFluidDataStoreContext>(\n\t\tid: string,\n\t\tpkg: readonly string[],\n\t\tcontextCtor: new (props: ILocalDetachedFluidDataStoreContextProps) => T,\n\t\tloadingGroupId?: string,\n\t): T {\n\t\tassert(loadingGroupId !== \"\", 0x974 /* loadingGroupId should not be the empty string */);\n\t\tconst context = new contextCtor({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage: this.parentContext.storage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tloadingGroupId,\n\t\t\tchannelToDataStoreFn: (channel: IFluidDataStoreChannel) =>\n\t\t\t\tchannelToDataStore(\n\t\t\t\t\tchannel,\n\t\t\t\t\tid,\n\t\t\t\t\tthis,\n\t\t\t\t\tcreateChildLogger({ logger: this.parentContext.baseLogger }),\n\t\t\t\t),\n\t\t});\n\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic get disposed(): boolean {\n\t\treturn this.disposeOnce.evaluated;\n\t}\n\tpublic dispose(): void {\n\t\treturn this.disposeOnce.value;\n\t}\n\n\tpublic readonly reSubmitContainerMessage = (\n\t\tmessage:\n\t\t\t| ContainerRuntimeDataStoreOpMessage\n\t\t\t| OutboundContainerRuntimeAttachMessage\n\t\t\t| ContainerRuntimeAliasMessage,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash: boolean | undefined,\n\t): void => {\n\t\tswitch (message.type) {\n\t\t\tcase ContainerMessageType.Attach:\n\t\t\tcase ContainerMessageType.Alias: {\n\t\t\t\tthis.parentContext.submitMessage(message, localOpMetadata);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase ContainerMessageType.FluidDataStoreOp: {\n\t\t\t\treturn this.resubmitDataStoreOp(message.contents, localOpMetadata, squash);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tassert(false, 0x907 /* unknown op type */);\n\t\t\t}\n\t\t}\n\t};\n\n\tprotected readonly resubmitDataStoreOp = (\n\t\tenvelope: IEnvelope<FluidDataStoreMessage>,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash: boolean | undefined,\n\t): void => {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and throw an error. If there are local changes for a\n\t\t// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"resubmitDataStoreOp\")\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"Context is deleted!\", {\n\t\t\t\tcallSite: \"resubmitDataStoreOp\",\n\t\t\t\t...tagCodeArtifacts({ id: envelope.address }),\n\t\t\t});\n\t\t}\n\t\tassert(!!context, 0x160 /* \"There should be a store context for the op\" */);\n\t\tcontext.reSubmit(envelope.contents, localOpMetadata, squash);\n\t};\n\n\tpublic readonly rollbackDataStoreOp = (\n\t\tenvelope: IEnvelope<FluidDataStoreMessage>,\n\t\tlocalOpMetadata: unknown,\n\t): void => {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and throw an error. If there are local changes for a\n\t\t// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"rollbackDataStoreOp\")\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"Context is deleted!\", {\n\t\t\t\tcallSite: \"rollbackDataStoreOp\",\n\t\t\t\t...tagCodeArtifacts({ id: envelope.address }),\n\t\t\t});\n\t\t}\n\t\tassert(!!context, 0x2e8 /* \"There should be a store context for the op\" */);\n\t\tcontext.rollback(envelope.contents, localOpMetadata);\n\t};\n\n\tpublic async applyStashedOp(content: unknown): Promise<unknown> {\n\t\tconst opContents = content as LocalContainerRuntimeMessage;\n\t\tswitch (opContents.type) {\n\t\t\tcase ContainerMessageType.Attach: {\n\t\t\t\treturn this.applyStashedAttachOp(opContents.contents);\n\t\t\t}\n\t\t\tcase ContainerMessageType.Alias: {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase ContainerMessageType.FluidDataStoreOp: {\n\t\t\t\treturn this.applyStashedChannelChannelOp(opContents.contents);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tassert(false, 0x908 /* unknon type of op */);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected async applyStashedChannelChannelOp(envelope: IEnvelope): Promise<unknown> {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case the data store that stashed the op is deleted.\n\t\tif (this.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"applyStashedOp\")) {\n\t\t\treturn undefined;\n\t\t}\n\t\tassert(!!context, 0x161 /* \"There should be a store context for the op\" */);\n\t\treturn context.applyStashedOp(envelope.contents);\n\t}\n\n\tprivate async applyStashedAttachOp(message: IAttachMessage): Promise<void> {\n\t\tconst { id, snapshot } = message;\n\n\t\t// build the snapshot from the summary in the attach message\n\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\tconst snapshotTree = buildSnapshotTree(snapshot.entries, flatAttachBlobs);\n\t\tconst storage = new StorageServiceWithAttachBlobs(\n\t\t\tthis.parentContext.storage,\n\t\t\tflatAttachBlobs,\n\t\t);\n\n\t\t// create a local datastore context for the data store context,\n\t\t// which this message represents. All newly created data store\n\t\t// contexts start as a local context on the client that created\n\t\t// them, and for stashed ops, the client that applies it plays\n\t\t// the role of creating client.\n\t\tconst dataStoreContext = new LocalFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg: undefined,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree,\n\t\t});\n\t\t// add to the list of bound or remoted, as this context must be bound\n\t\t// to had an attach message sent, and is the non-detached case is remoted.\n\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\n\t\t// realize the local context, as local contexts shouldn't be delay\n\t\t// loaded, as this client is playing the role of creating client,\n\t\t// and creating clients always create realized data store contexts.\n\t\tconst channel = await dataStoreContext.realize();\n\t\tawait channel.entryPoint.get();\n\n\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\t// if the client is not detached put in the pending attach list\n\t\t\t// so that on ack of the stashed op, the context is found.\n\t\t\t// detached client don't send ops, so should not expect and ack.\n\t\t\tthis.pendingAttach.set(id, message);\n\t\t}\n\t}\n\n\t/**\n\t * Process messages for this channel collection. The messages here are contiguous messages in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tpublic processMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tswitch (messageCollection.envelope.type) {\n\t\t\tcase ContainerMessageType.FluidDataStoreOp: {\n\t\t\t\tthis.processChannelMessages(messageCollection);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ContainerMessageType.Attach: {\n\t\t\t\tthis.processAttachMessages(messageCollection);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ContainerMessageType.Alias: {\n\t\t\t\tthis.processAliasMessages(messageCollection);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tassert(false, 0x8e9 /* unreached */);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process channel messages. The messages here are contiguous channel type messages in a batch. Bunch\n\t * of contiguous messages for a data store should be sent to it together.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tprivate processChannelMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tlet currentMessageState: { address: string; type: string } | undefined;\n\t\tlet currentMessagesContent: IRuntimeMessagesContent[] = [];\n\n\t\t// Helper that sends the current bunch of messages to the data store. It validates that the data stores exists.\n\t\tconst sendBunchedMessages = (): void => {\n\t\t\t// Current message state will be undefined for the first message in the list.\n\t\t\tif (currentMessageState === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst currentContext = this.contexts.get(currentMessageState.address);\n\t\t\tassert(!!currentContext, 0xa66 /* Context not found */);\n\n\t\t\tcurrentContext.processMessages({\n\t\t\t\tenvelope: { ...envelope, type: currentMessageState.type },\n\t\t\t\tmessagesContent: currentMessagesContent,\n\t\t\t\tlocal,\n\t\t\t});\n\t\t\tcurrentMessagesContent = [];\n\t\t};\n\n\t\t/**\n\t\t * Bunch contiguous messages for the same data store and send them together.\n\t\t * This is an optimization mainly for DDSes, where it can process a bunch of ops together. DDSes\n\t\t * like merge tree or shared tree can process ops more efficiently when they are bunched together.\n\t\t */\n\t\tfor (const { contents, ...restOfMessagesContent } of messagesContent) {\n\t\t\tconst contentsEnvelope = contents as IEnvelope<FluidDataStoreMessage>;\n\t\t\tconst address = contentsEnvelope.address;\n\t\t\tconst context = this.contexts.get(address);\n\n\t\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t\t// corruption in case a deleted data store accidentally submitted an op.\n\t\t\tif (this.checkAndLogIfDeleted(address, context, \"Changed\", \"processFluidDataStoreOp\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (context === undefined) {\n\t\t\t\t// Former assert 0x162\n\t\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\t\"No context for op\",\n\t\t\t\t\t\"processFluidDataStoreOp\",\n\t\t\t\t\tenvelope as ISequencedDocumentMessage,\n\t\t\t\t\t{\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\tmessageDetails: JSON.stringify({\n\t\t\t\t\t\t\ttype: envelope.type,\n\t\t\t\t\t\t\tcontentType: typeof contents,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t...tagCodeArtifacts({ address }),\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst { type: contextType, content: contextContents } = contentsEnvelope.contents;\n\t\t\t// If the address or type of the message changes while processing the message, send the current bunch.\n\t\t\tif (\n\t\t\t\tcurrentMessageState?.address !== address ||\n\t\t\t\tcurrentMessageState?.type !== contextType\n\t\t\t) {\n\t\t\t\tsendBunchedMessages();\n\t\t\t}\n\t\t\tcurrentMessagesContent.push({\n\t\t\t\tcontents: contextContents,\n\t\t\t\t...restOfMessagesContent,\n\t\t\t});\n\t\t\tcurrentMessageState = { address, type: contextType };\n\n\t\t\t// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is\n\t\t\t// being used.\n\t\t\tthis.gcNodeUpdated({\n\t\t\t\tnode: { type: \"DataStore\", path: `/${address}` },\n\t\t\t\treason: \"Changed\",\n\t\t\t\ttimestampMs: envelope.timestamp,\n\t\t\t\tpackagePath: context.isLoaded ? context.packagePath : undefined,\n\t\t\t});\n\n\t\t\tdetectOutboundReferences(address, contextContents, (fromPath: string, toPath: string) =>\n\t\t\t\tthis.parentContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp),\n\t\t\t);\n\t\t}\n\n\t\t// Process the last bunch of messages, if any. Note that there may not be any messages in case all of them are\n\t\t// ignored because the data store is deleted.\n\t\tsendBunchedMessages();\n\t}\n\n\tprivate async getDataStore(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t\toriginalRequest: IRequest,\n\t): Promise<IFluidDataStoreContextPrivate> {\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tid,\n\t\t\t\tthis.contexts.get(id),\n\t\t\t\t\"Requested\",\n\t\t\t\t\"getDataStore\",\n\t\t\t\trequestHeaderData,\n\t\t\t\toriginalRequest,\n\t\t\t)\n\t\t) {\n\t\t\t// The requested data store has been deleted by gc. Create a 404 response exception.\n\t\t\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", originalRequest, {\n\t\t\t\t\t[DeletedResponseHeaderKey]: true,\n\t\t\t\t}),\n\t\t\t\toriginalRequest,\n\t\t\t);\n\t\t}\n\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\t// The requested data store does not exits. Throw a 404 response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(create404Response(request), request);\n\t\t}\n\t\treturn context;\n\t}\n\n\t/**\n\t * Returns the data store requested with the given id if available. Otherwise, returns undefined.\n\t */\n\tpublic async getDataStoreIfAvailable(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<IFluidDataStoreContextPrivate | undefined> {\n\t\t// If the data store has been deleted, log an error and return undefined.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tid,\n\t\t\t\tthis.contexts.get(id),\n\t\t\t\t\"Requested\",\n\t\t\t\t\"getDataStoreIfAvailable\",\n\t\t\t\trequestHeaderData,\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn context;\n\t}\n\n\t/**\n\t * Checks if the data store has been deleted by GC. If so, log an error.\n\t * @param id - The data store's id.\n\t * @param context - The data store context.\n\t * @param deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)\n\t * @param callSite - The function name this is called from.\n\t * @param requestHeaderData - The request header information to log if the data store is deleted.\n\t * @param originalRequest - The original request (could be for a child of the DataStore)\n\t * @returns true if the data store is deleted. Otherwise, returns false.\n\t */\n\tprivate checkAndLogIfDeleted(\n\t\tid: string,\n\t\tcontext: IFluidDataStoreContext | undefined,\n\t\tdeletedLogSuffix: \"Changed\" | \"Requested\",\n\t\tcallSite: string,\n\t\trequestHeaderData?: RuntimeHeaderData,\n\t\toriginalRequest?: IRequest,\n\t): boolean {\n\t\tconst dataStoreNodePath = `/${id}`;\n\t\tif (!this.isDataStoreDeleted(dataStoreNodePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst idToLog =\n\t\t\toriginalRequest === undefined ? dataStoreNodePath : urlToGCNodePath(originalRequest.url);\n\n\t\t// Log the package details asynchronously since getInitialSnapshotDetails is async\n\t\tconst recentlyDeletedContext = this.contexts.getRecentlyDeletedContext(id);\n\t\tif (recentlyDeletedContext !== undefined) {\n\t\t\trecentlyDeletedContext\n\t\t\t\t.getInitialSnapshotDetails()\n\t\t\t\t.then((details) => {\n\t\t\t\t\treturn details.pkg.join(\"/\");\n\t\t\t\t})\n\t\t\t\t.then(\n\t\t\t\t\t(pkg) => ({ pkg, error: undefined }),\n\t\t\t\t\t(error: Error) => ({ pkg: undefined, error }),\n\t\t\t\t)\n\t\t\t\t.then(({ pkg, error }) => {\n\t\t\t\t\tthis.mc.logger.sendTelemetryEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: `GC_DeletedDataStore_PathInfo`,\n\t\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\t\tid: idToLog,\n\t\t\t\t\t\t\t\tpkg,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcallSite,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t\t.catch(() => {});\n\t\t}\n\n\t\tthis.mc.logger.sendErrorEvent({\n\t\t\teventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,\n\t\t\t...tagCodeArtifacts({ id: idToLog }),\n\t\t\tcallSite,\n\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\texists: context !== undefined,\n\t\t\tdetails: {\n\t\t\t\turl: originalRequest?.url,\n\t\t\t\theaders: JSON.stringify(originalRequest?.headers),\n\t\t\t\taliased: this.aliasedDataStores.has(id),\n\t\t\t},\n\t\t});\n\t\treturn true;\n\t}\n\n\tpublic processSignal(messageArg: IInboundSignalMessage, local: boolean): void {\n\t\tconst envelope = messageArg.content as IEnvelope;\n\t\tconst fluidDataStoreId = envelope.address;\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\tconst message = { ...messageArg, content: envelope.contents };\n\t\tconst context = this.contexts.get(fluidDataStoreId);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted a signal.\n\t\tif (this.checkAndLogIfDeleted(fluidDataStoreId, context, \"Changed\", \"processSignal\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!context) {\n\t\t\t// Attach message may not have been processed yet\n\t\t\tassert(!local, 0x163 /* \"Missing datastore for local signal\" */);\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"SignalFluidDataStoreNotFound\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tcontext.processSignal(message, local);\n\t}\n\n\tpublic setConnectionState(canSendOps: boolean, clientId?: string): void {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.setConnectionState(canSendOps, clientId);\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"SetConnectionStateError\",\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\truntimeConnected: this.parentContext.connected,\n\t\t\t\t\t\t\tcanSendOps,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Enumerates the contexts and calls notifyReadOnlyState on them.\n\t */\n\tpublic notifyReadOnlyState(readonly: boolean): void {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.notifyReadOnlyState();\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"SetReadOnlyStateError\",\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\truntimeReadonly: this.parentContext.isReadOnly(),\n\t\t\t\t\t\t\treadonly,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Notifies all data store contexts about the current staging mode state.\n\t *\n\t * @param staging - A boolean indicating whether the container is in staging mode.\n\t */\n\tpublic notifyStagingMode(staging: boolean): void {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.notifyStagingMode(staging);\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"notifyStagingModeError\",\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\tstaging,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tfor (const [, context] of this.contexts) {\n\t\t\t// Fire only for bounded stores.\n\t\t\tif (!this.contexts.isNotBound(context.id)) {\n\t\t\t\tcontext.setAttachState(attachState);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.contexts.size;\n\t}\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t */\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tlet dataStoreSummary: ISummarizeResult;\n\t\t\t\tif (context.isLoaded) {\n\t\t\t\t\tdataStoreSummary = context.getAttachSummary(telemetryContext);\n\t\t\t\t} else {\n\t\t\t\t\t// If this data store is not yet loaded, then there should be no changes in the snapshot from\n\t\t\t\t\t// which it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!this.baseSnapshot,\n\t\t\t\t\t\t0x166 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t);\n\t\t\t\t\tdataStoreSummary = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\tgetSnapshotTree(this.baseSnapshot).trees[contextId],\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbuilder.addWithStats(contextId, dataStoreSummary);\n\t\t\t},\n\t\t);\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Gets the GC data. Used when attaching or serializing a detached container.\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tconst builder = new GCDataBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextGCData = context.getAttachGCData(telemetryContext);\n\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t},\n\t\t);\n\t\t// Get the outbound routes (aliased data stores) and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", [...this.aliasedDataStores]);\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * Helper method for preparing to attach this channel.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate visitLocalBoundContextsDuringAttach(\n\t\tvisitor: (contextId: string, context: FluidDataStoreContext) => void,\n\t): void {\n\t\tconst visitedContexts = new Set<string>();\n\t\tlet visitedLength = -1;\n\t\tlet notBoundContextsLength = -1;\n\t\twhile (\n\t\t\tvisitedLength !== visitedContexts.size &&\n\t\t\tnotBoundContextsLength !== this.contexts.notBoundLength()\n\t\t) {\n\t\t\t// detect changes in the visitedContexts set, as on visiting a context\n\t\t\t// it could could make contexts available by removing other contexts\n\t\t\t// from the not bound context list, so we need to ensure those get processed as well.\n\t\t\t// only once the loop can run with no new contexts added to the visitedContexts set do we\n\t\t\t// know for sure all possible contexts have been visited.\n\t\t\tvisitedLength = visitedContexts.size;\n\t\t\tnotBoundContextsLength = this.contexts.notBoundLength();\n\t\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\t\tif (\n\t\t\t\t\t!(\n\t\t\t\t\t\tvisitedContexts.has(contextId) ||\n\t\t\t\t\t\tthis.contexts.isNotBound(contextId) ||\n\t\t\t\t\t\tthis.attachOpFiredForDataStore.has(contextId)\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tvisitor(contextId, context);\n\t\t\t\t\tvisitedContexts.add(contextId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Helper method for preparing to summarize this channel.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate async visitContextsDuringSummary(\n\t\tvisitor: (contextId: string, context: FluidDataStoreContext) => Promise<void>,\n\t\ttelemetryProps: ITelemetryPropertiesExt,\n\t): Promise<void> {\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\t// Summarizer client and hence GC works only with clients with no local changes. A data store in\n\t\t\t// attaching state indicates an op was sent to attach a local data store, and the the attach op\n\t\t\t// had not yet round tripped back to the client.\n\t\t\t// Formerly assert 0x589\n\t\t\tif (context.attachState === AttachState.Attaching) {\n\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\"Local data store detected in attaching state\",\n\t\t\t\t\t\"summarize/getGCData\",\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tif (context.attachState === AttachState.Attached) {\n\t\t\t\t// If summary / getGCData results in this data store's realization, let GC know so that it can log in\n\t\t\t\t// case the data store is not referenced. This will help identifying scenarios that we see today where\n\t\t\t\t// unreferenced data stores are being loaded.\n\t\t\t\tconst contextLoadedBefore = context.isLoaded;\n\t\t\t\tconst trailingOpCount = context.pendingCount;\n\n\t\t\t\tawait visitor(contextId, context);\n\n\t\t\t\tif (!contextLoadedBefore && context.isLoaded) {\n\t\t\t\t\tthis.gcNodeUpdated({\n\t\t\t\t\t\tnode: { type: \"DataStore\", path: `/${context.id}` },\n\t\t\t\t\t\treason: \"Realized\",\n\t\t\t\t\t\tpackagePath: context.packagePath,\n\t\t\t\t\t\ttimestampMs: undefined, // This will be added by the parent context if needed.\n\t\t\t\t\t\tadditionalProps: { trailingOpCount, ...telemetryProps },\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextSummary = await context.summarize(fullTree, trackState, telemetryContext);\n\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t},\n\t\t\t{ fullTree, realizedDuring: \"summarize\" },\n\t\t);\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. It does the following:\n\t *\n\t * 1. Calls into each child data store context to get its GC data.\n\t *\n\t * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be\n\t * identified as belonging to the child.\n\t *\n\t * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent\n\t * the GC data of this channel.\n\t *\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\tconst builder = new GCDataBuilder();\n\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t},\n\t\t\t{ fullGC, realizedDuring: \"getGCData\" },\n\t\t);\n\n\t\t// Get the outbound routes and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", await this.getOutboundRoutes());\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * After GC has run, called to notify this Container's data stores of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in all data stores in this Container.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: readonly string[]): void {\n\t\t// Get a map of data store ids to routes used in it.\n\t\tconst usedDataStoreRoutes = unpackChildNodesUsedRoutes(usedRoutes);\n\n\t\t// Verify that the used routes are correct.\n\t\tfor (const [id] of usedDataStoreRoutes) {\n\t\t\tassert(\n\t\t\t\tthis.contexts.has(id),\n\t\t\t\t0x167 /* \"Used route does not belong to any known data store\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.updateUsedRoutes(usedDataStoreRoutes.get(contextId) ?? []);\n\t\t}\n\t}\n\n\tpublic deleteChild(dataStoreId: string): void {\n\t\tconst dataStoreContext = this.contexts.get(dataStoreId);\n\t\tassert(dataStoreContext !== undefined, 0x2d7 /* No data store with specified id */);\n\n\t\tif (dataStoreContext.isLoaded) {\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"GC_DeletingLoadedDataStore\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tid: `/${dataStoreId}`, // Make the id consistent with GC node path format by prefixing a slash.\n\t\t\t\t\tpkg: dataStoreContext.packagePath.join(\"/\"),\n\t\t\t\t}),\n\t\t\t\tdetails: {\n\t\t\t\t\taliased: this.aliasedDataStores.has(dataStoreId),\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tdataStoreContext.delete();\n\t\t// Delete the contexts of unused data stores.\n\t\tthis.contexts.delete(dataStoreId);\n\t\t// Delete the summarizer node of the unused data stores.\n\t\tthis.parentContext.deleteChildSummarizerNode(dataStoreId);\n\t}\n\n\t/**\n\t * Delete data stores and its objects that are sweep ready.\n\t * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should\n\t * be deleted.\n\t * @returns The routes of data stores and its objects that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(\n\t\tsweepReadyDataStoreRoutes: readonly string[],\n\t): readonly string[] {\n\t\tfor (const route of sweepReadyDataStoreRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tconst dataStoreId = pathParts[1];\n\n\t\t\t// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only\n\t\t\t// need to delete the data store.\n\t\t\t// These routes will still be returned below as among the deleted routes\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst dataStoreContext = this.contexts.get(dataStoreId);\n\t\t\tif (dataStoreContext === undefined) {\n\t\t\t\t// If the data store hasn't already been deleted, log an error because this should never happen.\n\t\t\t\t// If the data store has already been deleted, log a telemetry event. This can happen because multiple GC\n\t\t\t\t// sweep ops can contain the same data store. It would be interesting to track how often this happens.\n\t\t\t\tconst alreadyDeleted = this.isDataStoreDeleted(`/${dataStoreId}`);\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"DeletedDataStoreNotFound\",\n\t\t\t\t\tcategory: alreadyDeleted ? \"generic\" : \"error\",\n\t\t\t\t\t...tagCodeArtifacts({ id: dataStoreId }),\n\t\t\t\t\tdetails: { alreadyDeleted },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.deleteChild(dataStoreId);\n\t\t}\n\t\treturn [...sweepReadyDataStoreRoutes];\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are tombstones.\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\t * @param tombstonedRoutes - The routes that are tombstones in all data stores in this Container.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: readonly string[]): void {\n\t\tconst tombstonedDataStoresSet: Set<string> = new Set();\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Tombstone data store only if its route (/datastoreId) is directly in tombstoneRoutes.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);\n\t\t\ttombstonedDataStoresSet.add(dataStoreId);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.setTombstone(tombstonedDataStoresSet.has(contextId));\n\t\t}\n\t}\n\n\t/**\n\t * Returns the outbound routes of this channel. Only root data stores are considered referenced and their paths are\n\t * part of outbound routes.\n\t */\n\tprivate async getOutboundRoutes(): Promise<string[]> {\n\t\tconst outboundRoutes: string[] = [];\n\t\t// Getting this information is a performance optimization that reduces network calls for virtualized datastores\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tconst isRootDataStore = await context.isRoot(this.aliasedDataStores);\n\t\t\tif (isRootDataStore) {\n\t\t\t\toutboundRoutes.push(`/${contextId}`);\n\t\t\t}\n\t\t}\n\t\treturn outboundRoutes;\n\t}\n\n\t/**\n\t * Called by GC to retrieve the package path of a data store node with the given path.\n\t */\n\tpublic async getDataStorePackagePath(\n\t\tnodePath: string,\n\t): Promise<readonly string[] | undefined> {\n\t\t// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the\n\t\t// data store that contains it.\n\t\tconst context = this.contexts.get(nodePath.split(\"/\")[1]);\n\t\tconst initialSnapshotDetails = await context?.getInitialSnapshotDetails();\n\t\treturn initialSnapshotDetails?.pkg;\n\t}\n\n\t/**\n\t * Called by GC to determine if a node is for a data store or for an object within a data store (for e.g. DDS).\n\t * @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.\n\t */\n\n\tpublic getGCNodeType(nodePath: string): GCNodeType | undefined {\n\t\tconst pathParts = nodePath.split(\"/\");\n\t\tif (!this.contexts.has(pathParts[1])) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Data stores paths are of the format \"/dataStoreId\".\n\t\t// Sub data store paths are of the format \"/dataStoreId/subPath/...\".\n\t\tif (pathParts.length === 2) {\n\t\t\treturn GCNodeType.DataStore;\n\t\t}\n\n\t\treturn GCNodeType.SubDataStore;\n\t}\n\n\tpublic internalId(maybeAlias: string): string {\n\t\treturn this.aliases.get(maybeAlias) ?? maybeAlias;\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\tconst requestParser = RequestParser.create(request);\n\t\tconst id = requestParser.pathParts[0];\n\n\t\t// Differentiate between requesting the dataStore directly, or one of its children\n\t\tconst requestForChild = requestParser.pathParts.length > 1;\n\n\t\tconst headerData: RuntimeHeaderData = {};\n\t\tif (typeof request.headers?.[RuntimeHeaders.wait] === \"boolean\") {\n\t\t\theaderData.wait = request.headers[RuntimeHeaders.wait];\n\t\t}\n\t\tif (typeof request.headers?.[RuntimeHeaders.viaHandle] === \"boolean\") {\n\t\t\theaderData.viaHandle = request.headers[RuntimeHeaders.viaHandle];\n\t\t}\n\t\tif (typeof request.headers?.[AllowTombstoneRequestHeaderKey] === \"boolean\") {\n\t\t\theaderData.allowTombstone = request.headers[AllowTombstoneRequestHeaderKey];\n\t\t}\n\n\t\t// We allow Tombstone requests for sub-DataStore objects\n\t\tif (requestForChild) {\n\t\t\theaderData.allowTombstone = true;\n\t\t}\n\n\t\tawait this.waitIfPendingAlias(id);\n\t\tconst internalId = this.internalId(id);\n\t\tconst dataStoreContext = await this.getDataStore(internalId, headerData, request);\n\n\t\t// Get the initial snapshot details which contain the data store package path.\n\t\tconst details = await dataStoreContext.getInitialSnapshotDetails();\n\n\t\t// When notifying GC of this node being loaded, we only indicate the DataStore itself, not the full subDataStore url if applicable.\n\t\t// This is in case the url is to a route that Fluid doesn't understand or track for GC (e.g. if suited for a custom request handler)\n\t\tthis.gcNodeUpdated({\n\t\t\tnode: { type: \"DataStore\", path: `/${id}` },\n\t\t\treason: \"Loaded\",\n\t\t\tpackagePath: details.pkg,\n\t\t\trequest,\n\t\t\theaderData,\n\t\t\ttimestampMs: undefined, // This will be added by the parent context if needed.\n\t\t});\n\n\t\tconst dataStore = await dataStoreContext.realize();\n\n\t\tconst subRequest = requestParser.createSubRequest(1);\n\t\t// We always expect createSubRequest to include a leading slash, but asserting here to protect against\n\t\t// unintentionally modifying the url if that changes.\n\t\tassert(\n\t\t\tsubRequest.url.startsWith(\"/\"),\n\t\t\t0x126 /* \"Expected createSubRequest url to include a leading slash\" */,\n\t\t);\n\n\t\treturn dataStore.request(subRequest);\n\t}\n}\n\nexport function getSummaryForDatastores(\n\tsnapshot: ISnapshotTree | undefined,\n\n\tmetadata?: IContainerRuntimeMetadata,\n): ISnapshotTree | undefined {\n\tif (!snapshot) {\n\t\treturn undefined;\n\t}\n\n\tif (rootHasIsolatedChannels(metadata)) {\n\t\tconst datastoresSnapshot: ISnapshotTree | undefined = snapshot.trees[channelsTreeName];\n\t\tassert(datastoresSnapshot !== undefined, 0x168 /* Expected tree in snapshot not found */);\n\t\treturn datastoresSnapshot;\n\t} else {\n\t\t// back-compat: strip out all non-datastore paths before giving to DataStores object.\n\t\tconst datastoresTrees: ISnapshotTree[\"trees\"] = {};\n\t\tfor (const [key, value] of Object.entries(snapshot.trees)) {\n\t\t\tif (!nonDataStorePaths.includes(key)) {\n\t\t\t\tdatastoresTrees[key] = value;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...snapshot,\n\t\t\ttrees: datastoresTrees,\n\t\t};\n\t}\n}\n\n/**\n * Traverse this op's contents and detect any outbound routes that were added by this op.\n *\n * @internal\n */\nexport function detectOutboundReferences(\n\taddress: string,\n\tcontents: unknown,\n\taddedOutboundReference: (fromNodePath: string, toNodePath: string) => void,\n): void {\n\t// These will be built up as we traverse the envelope contents\n\tconst outboundPaths: string[] = [];\n\tlet ddsAddress: string | undefined;\n\n\tfunction recursivelyFindHandles(obj: unknown): void {\n\t\tif (typeof obj === \"object\" && obj !== null) {\n\t\t\tfor (const [key, value] of Object.entries(obj)) {\n\t\t\t\t// If 'value' is a serialized IFluidHandle, it represents a new outbound route.\n\t\t\t\tif (isSerializedHandle(value)) {\n\t\t\t\t\toutboundPaths.push(value.url);\n\t\t\t\t}\n\n\t\t\t\t// NOTE: This is taking a hard dependency on the fact that in our DataStore implementation,\n\t\t\t\t// the address of the DDS is stored in a property called \"address\". This is not ideal.\n\t\t\t\t// An alternative would be for the op envelope to include the absolute path (built up as it is submitted)\n\t\t\t\tif (key === \"address\" && ddsAddress === undefined) {\n\t\t\t\t\tddsAddress = value as string | undefined;\n\t\t\t\t}\n\n\t\t\t\trecursivelyFindHandles(value);\n\t\t\t}\n\t\t}\n\t}\n\n\trecursivelyFindHandles(contents);\n\n\t// GC node paths are all absolute paths, hence the \"\" prefix.\n\t// e.g. this will yield \"/dataStoreId/ddsId\"\n\tconst fromPath = [\"\", address, ddsAddress].join(\"/\");\n\tfor (const toPath of outboundPaths) {\n\t\taddedOutboundReference(fromPath, toPath);\n\t}\n}\n\n// #region Experimentation\n// The code below here is for experimentation (and one test) only.\n\n/**\n * @privateRemarks This class is only used for experimentation/testing.\n */\nexport class ComposableChannelCollection\n\textends ChannelCollection\n\timplements IFluidDataStoreChannel\n{\n\tpublic readonly entryPoint: IFluidHandleInternal<FluidObject>;\n\n\tpublic constructor(\n\t\tbaseSnapshot: ISnapshotTree | ISnapshot | undefined,\n\t\tparentContext: IFluidParentContextPrivate,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tgcNodeUpdated: (props: IGCNodeUpdatedProps) => void,\n\t\tisDataStoreDeleted: (nodePath: string) => boolean,\n\t\taliasMap: Map<string, string>,\n\t\tprovideEntryPoint: (runtime: ComposableChannelCollection) => Promise<FluidObject>,\n\t) {\n\t\tsuper(\n\t\t\tbaseSnapshot,\n\t\t\t/* [root] parentContext */\n\t\t\tformParentContext<IFluidRootParentContextPrivate>(parentContext, {\n\t\t\t\tsubmitMessage: (\n\t\t\t\t\tcontainerRuntimeMessage:\n\t\t\t\t\t\t| ContainerRuntimeDataStoreOpMessage\n\t\t\t\t\t\t| OutboundContainerRuntimeAttachMessage\n\t\t\t\t\t\t| ContainerRuntimeAliasMessage,\n\t\t\t\t\tlocalOpMetadata: unknown,\n\t\t\t\t): void => {\n\t\t\t\t\t// Note that here our message format is reconfigured.\n\t\t\t\t\t// While `ContainerRuntime*Message`s use `contents`\n\t\t\t\t\t// as `FluidDataStoreMessage`s, the content is\n\t\t\t\t\t// stored in `content`.\n\t\t\t\t\tparentContext.submitMessage(\n\t\t\t\t\t\tcontainerRuntimeMessage.type,\n\t\t\t\t\t\tcontainerRuntimeMessage.contents,\n\t\t\t\t\t\tlocalOpMetadata,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tsubmitSignal: (\n\t\t\t\t\tenvelope: AddressedUnsequencedSignalEnvelope,\n\t\t\t\t\ttargetClientId?: string,\n\t\t\t\t): void => {\n\t\t\t\t\tparentContext.submitSignal(\n\t\t\t\t\t\tenvelope.contents.type,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taddress: envelope.address,\n\t\t\t\t\t\t\tcontents: envelope.contents.content,\n\t\t\t\t\t\t} satisfies IEnvelope<unknown>,\n\t\t\t\t\t\ttargetClientId,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tbaseLogger,\n\t\t\tgcNodeUpdated,\n\t\t\tisDataStoreDeleted,\n\t\t\taliasMap,\n\t\t);\n\t\tthis.entryPoint = new FluidObjectHandle<FluidObject>(\n\t\t\tnew LazyPromise(async () => provideEntryPoint(this)),\n\t\t\t\"\",\n\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t);\n\t}\n\n\tpublic reSubmit(\n\t\ttype: string,\n\t\tcontent: unknown,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash?: boolean,\n\t): void {\n\t\t// If the cast is incorrect and type is not one of the three supported,\n\t\t// reSubmitContainerMessage will assert.\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Need to force conversion\n\t\tconst message = {\n\t\t\ttype,\n\t\t\tcontents: content,\n\t\t} as\n\t\t\t| ContainerRuntimeDataStoreOpMessage\n\t\t\t| OutboundContainerRuntimeAttachMessage\n\t\t\t| ContainerRuntimeAliasMessage;\n\t\tthis.reSubmitContainerMessage(message, localOpMetadata, squash);\n\t}\n\n\tpublic rollback(type: string, content: unknown, localOpMetadata: unknown): void {\n\t\tassert(type === ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);\n\t\tthis.rollbackDataStoreOp(content as IEnvelope<FluidDataStoreMessage>, localOpMetadata);\n\t}\n}\n\n/**\n * @privateRemarks This factory is only used for experimentation/testing.\n *\n * @internal\n */\nexport class ChannelCollectionFactory implements IFluidDataStoreFactory {\n\tpublic readonly type = \"ChannelCollectionChannel\";\n\n\tpublic IFluidDataStoreRegistry: IFluidDataStoreRegistry;\n\n\tconstructor(\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\t// ADO:7302 We need a better type here\n\t\tprivate readonly provideEntryPoint: (\n\t\t\truntime: IFluidDataStoreChannel,\n\t\t) => Promise<FluidObject>,\n\t) {\n\t\tthis.IFluidDataStoreRegistry = new FluidDataStoreRegistry(registryEntries);\n\t}\n\n\tpublic get IFluidDataStoreFactory(): ChannelCollectionFactory {\n\t\treturn this;\n\t}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\t_existing: boolean,\n\t): Promise<IFluidDataStoreChannel> {\n\t\t// when work is done to complete nested datastores\n\t\t// this class should move to a new package\n\t\t// and IFluidDataStoreContext will need to support\n\t\t// all the cross layer needs of the channel context,\n\t\t// and the below assert should be removed.\n\t\t//\n\t\t// for now this will continue to work if both\n\t\t// this factory and the container runtime are\n\t\t// from the same package.\n\t\tassert(\n\t\t\tcontext instanceof FluidDataStoreContext,\n\t\t\t0xb8f /* we don't support the layer boundary here today */,\n\t\t);\n\n\t\tconst runtime = new ComposableChannelCollection(\n\t\t\tcontext.baseSnapshot,\n\t\t\t/* parentContext */ context,\n\t\t\tcontext.baseLogger,\n\t\t\t/* gcNodeUpdated */ () => {},\n\t\t\t/* isDataStoreDeleted */ (_nodePath: string) => false,\n\t\t\tnew Map(), // aliasMap\n\t\t\tthis.provideEntryPoint,\n\t\t);\n\n\t\treturn runtime;\n\t}\n\n\t// #endregion Experimentation\n}\n"]}
1
+ {"version":3,"file":"channelCollection.js","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAYpE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAMvE,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,qBAAqB,GACrB,MAAM,uCAAuC,CAAC;AAwB/C,OAAO,EACN,0BAA0B,EAC1B,gBAAgB,EAChB,aAAa,GACb,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,0BAA0B,GAC1B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EAEZ,iBAAiB,EACjB,4BAA4B,EAC5B,gCAAgC,EAChC,gBAAgB,GAEhB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EACN,wBAAwB,EAExB,wBAAwB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEN,kBAAkB,EAClB,uBAAuB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,qBAAqB,EAGrB,kCAAkC,EAClC,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,uBAAuB,CAAC;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\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tISignalEnvelope,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, Lazy, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\nimport type {\n\tISnapshot,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tbuildSnapshotTree,\n\tgetSnapshotTree,\n\tisInstanceOfISnapshot,\n} from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tAliasResult,\n\tContainerExtensionProvider,\n\tFluidDataStoreMessage,\n\tIAttachMessage,\n\tIEnvelope,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIFluidParentContext,\n\tIGarbageCollectionData,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tMinimumVersionForCollab,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tCreateSummarizerNodeSource,\n\tchannelsTreeName,\n\tgcDataBlobKey,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tGCDataBuilder,\n\tRequestParser,\n\tRuntimeHeaders,\n\tSummaryTreeBuilder,\n\taddBlobToSummary,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tcreate404Response,\n\tcreateResponseError,\n\tencodeCompactIdToString,\n\tisSerializedHandle,\n\tprocessAttachMessageGCData,\n\tresponseToException,\n\tunpackChildNodesUsedRoutes,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\tLoggingError,\n\ttype MonitoringContext,\n\tcreateChildLogger,\n\tcreateChildMonitoringContext,\n\textractSafePropertiesFromMessage,\n\ttagCodeArtifacts,\n\ttype ITelemetryPropertiesExt,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n\tDeletedResponseHeaderKey,\n\ttype RuntimeHeaderData,\n\tdefaultRuntimeHeaderData,\n} from \"./containerRuntime.js\";\nimport {\n\ttype IDataStoreAliasMessage,\n\tchannelToDataStore,\n\tisDataStoreAliasMessage,\n} from \"./dataStore.js\";\nimport {\n\tFluidDataStoreContext,\n\ttype IFluidDataStoreContextPrivate,\n\ttype ILocalDetachedFluidDataStoreContextProps,\n\tLocalDetachedFluidDataStoreContext,\n\tLocalFluidDataStoreContext,\n\tRemoteFluidDataStoreContext,\n\tcreateAttributesBlob,\n} from \"./dataStoreContext.js\";\nimport { DataStoreContexts } from \"./dataStoreContexts.js\";\nimport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nimport { GCNodeType, type IGCNodeUpdatedProps, urlToGCNodePath } from \"./gc/index.js\";\nimport type {\n\tContainerRuntimeAliasMessage,\n\tContainerRuntimeDataStoreOpMessage,\n\tOutboundContainerRuntimeAttachMessage,\n} from \"./messageTypes.js\";\nimport { ContainerMessageType, type LocalContainerRuntimeMessage } from \"./messageTypes.js\";\nimport { StorageServiceWithAttachBlobs } from \"./storageServiceWithAttachBlobs.js\";\nimport {\n\ttype IContainerRuntimeMetadata,\n\tnonDataStorePaths,\n\trootHasIsolatedChannels,\n} from \"./summary/index.js\";\n\n/**\n * True if a tombstoned object should be returned without erroring\n * @legacy @beta\n */\nexport const AllowTombstoneRequestHeaderKey = \"allowTombstone\"; // Belongs in the enum above, but avoiding the breaking change\n\ntype PendingAliasResolve = (success: boolean) => void;\n\n/**\n * Envelope for signals not intended for the container.\n *\n * @privateRemarks\n * `clientBroadcastSignalSequenceNumber` might be added to the envelope by the container runtime.\n * But it should not be provided to start with.\n *\n * Equivalent to `Required<Omit<ISignalEnvelope, \"clientBroadcastSignalSequenceNumber\">>`.\n */\nexport type AddressedUnsequencedSignalEnvelope = IEnvelope<ISignalEnvelope[\"contents\"]>;\n\n/**\n * This version of the interface is private to this the package. It should never be exported under any tag.\n * It is used to manage interactions within the container-runtime package. If something is needed\n * cross package, it is likely it is also being used cross layer (ContainerRuntime * DataStoreRuntime).\n * If that is the case, the change likely needs to be staged directly on IFluidParentContext. Changes\n * being staged on IFluidParentContext can be added here as well, likely with optionality removed,\n * to ease interactions within this package.\n */\nexport interface IFluidParentContextPrivate\n\textends IFluidParentContext,\n\t\tContainerExtensionProvider {\n\treadonly isReadOnly: () => boolean;\n\treadonly minVersionForCollab: MinimumVersionForCollab;\n}\n\n/**\n * Kin of {@link @fluidframework/runtime-definitions#IFluidParentContext} with alternate\n * `submitMessage` and `submitSignal` methods that are typed specifically for the\n * root context (aka {@link ContainerRuntime} provided context).\n *\n * @privateRemarks\n * These replacements might be able to get cleaned up if the future suggestions\n * found in {@link @fluidframework/runtime-definitions#FluidDataStoreMessage}\n * `@privateRemarks` section are implemented.\n */\nexport interface IFluidRootParentContextPrivate\n\textends Omit<IFluidParentContextPrivate, \"submitMessage\" | \"submitSignal\"> {\n\t/**\n\t * Submits the message to be sent to other clients.\n\t * @param containerRuntimeMessage - The message.\n\t * @param localOpMetadata - The local metadata associated with the message.\n\t * This is kept locally and not sent to the server. This will be sent back\n\t * when this message is received back from the server. This is also sent if\n\t * we are asked to resubmit the message.\n\t */\n\treadonly submitMessage: (\n\t\tcontainerRuntimeMessage:\n\t\t\t| ContainerRuntimeDataStoreOpMessage\n\t\t\t| OutboundContainerRuntimeAttachMessage\n\t\t\t| ContainerRuntimeAliasMessage,\n\t\tlocalOpMetadata: unknown,\n\t) => void;\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param envelope - {@link IEnvelope} containing the signal address and contents.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\treadonly submitSignal: (\n\t\tenvelope: AddressedUnsequencedSignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n}\n\ntype SubmitKeys = \"submitMessage\" | \"submitSignal\";\n\n/**\n * Creates a shallow wrapper of {@link IFluidParentContextPrivate} or\n * {@link IFluidRootParentContextPrivate} with `submitMessage` and `submitSignal`\n * methods replaced with the provided overrides.\n */\nexport function formParentContext<\n\tT extends IFluidParentContextPrivate | IFluidRootParentContextPrivate,\n>(\n\tcontext: Omit<IFluidParentContextPrivate & IFluidRootParentContextPrivate, SubmitKeys>,\n\toverrides: Pick<T, SubmitKeys>,\n): Omit<IFluidParentContextPrivate & IFluidRootParentContextPrivate, SubmitKeys> &\n\tPick<T, SubmitKeys> {\n\treturn {\n\t\tget IFluidDataStoreRegistry() {\n\t\t\treturn context.IFluidDataStoreRegistry;\n\t\t},\n\t\tIFluidHandleContext: context.IFluidHandleContext,\n\t\toptions: context.options,\n\t\tget clientId() {\n\t\t\treturn context.clientId;\n\t\t},\n\t\tget connected() {\n\t\t\treturn context.connected;\n\t\t},\n\t\tdeltaManager: context.deltaManager,\n\t\tstorage: context.storage,\n\t\tbaseLogger: context.baseLogger,\n\t\tget clientDetails() {\n\t\t\treturn context.clientDetails;\n\t\t},\n\t\tget idCompressor() {\n\t\t\treturn context.idCompressor;\n\t\t},\n\t\tloadingGroupId: context.loadingGroupId,\n\t\tget attachState() {\n\t\t\treturn context.attachState;\n\t\t},\n\t\tisReadOnly: () => context.isReadOnly(),\n\t\tcontainerRuntime: context.containerRuntime,\n\t\tscope: context.scope,\n\t\tgcThrowOnTombstoneUsage: context.gcThrowOnTombstoneUsage,\n\t\tgcTombstoneEnforcementAllowed: context.gcTombstoneEnforcementAllowed,\n\t\tgetAbsoluteUrl: async (...args) => {\n\t\t\treturn context.getAbsoluteUrl(...args);\n\t\t},\n\t\tgetQuorum: (...args) => {\n\t\t\treturn context.getQuorum(...args);\n\t\t},\n\t\tgetAudience: (...args) => {\n\t\t\treturn context.getAudience(...args);\n\t\t},\n\t\tsubmitMessage: overrides.submitMessage.bind(overrides),\n\t\tsubmitSignal: overrides.submitSignal,\n\t\tmakeLocallyVisible: (...args) => {\n\t\t\treturn context.makeLocallyVisible(...args);\n\t\t},\n\t\tuploadBlob: async (...args) => {\n\t\t\treturn context.uploadBlob(...args);\n\t\t},\n\t\taddedGCOutboundRoute: (...args) => {\n\t\t\treturn context.addedGCOutboundRoute(...args);\n\t\t},\n\t\tgetCreateChildSummarizerNodeFn: (...args) => {\n\t\t\treturn context.getCreateChildSummarizerNodeFn?.(...args);\n\t\t},\n\t\tdeleteChildSummarizerNode: (...args) => {\n\t\t\treturn context.deleteChildSummarizerNode(...args);\n\t\t},\n\t\tsetChannelDirty: (address: string) => {\n\t\t\treturn context.setChannelDirty(address);\n\t\t},\n\t\tminVersionForCollab: context.minVersionForCollab,\n\t\tgetExtension: context.getExtension.bind(context),\n\t};\n}\n\n/**\n * Creates a wrapper of a {@link IFluidRootParentContextPrivate} to be provided to the inner datastore channels.\n * The wrapper will have the submit methods overwritten with the appropriate id as the destination address.\n *\n * @param id - the id of the channel\n * @param parentContext - the {@link IFluidRootParentContextPrivate} to wrap\n * @returns A wrapped {@link IFluidParentContext}\n */\nfunction wrapContextForInnerChannel(\n\tid: string,\n\tparentContext: IFluidRootParentContextPrivate,\n): IFluidParentContextPrivate {\n\tconst context = formParentContext<IFluidParentContextPrivate>(parentContext, {\n\t\tsubmitMessage: (type: string, content: unknown, localOpMetadata: unknown) => {\n\t\t\tconst fluidDataStoreContent: FluidDataStoreMessage = {\n\t\t\t\tcontent,\n\t\t\t\ttype,\n\t\t\t};\n\t\t\tconst envelope = {\n\t\t\t\taddress: id,\n\t\t\t\tcontents: fluidDataStoreContent,\n\t\t\t};\n\t\t\tparentContext.submitMessage(\n\t\t\t\t{ type: ContainerMessageType.FluidDataStoreOp, contents: envelope },\n\t\t\t\tlocalOpMetadata,\n\t\t\t);\n\t\t},\n\t\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => {\n\t\t\tparentContext.submitSignal({ address: id, contents: { type, content } }, targetClientId);\n\t\t},\n\t});\n\n\treturn context;\n}\n\n/**\n * Returns the type of the given local data store from its package path.\n */\nexport function getLocalDataStoreType(localDataStore: LocalFluidDataStoreContext): string {\n\treturn localDataStore.packagePath[localDataStore.packagePath.length - 1];\n}\n\n/**\n * This class encapsulates data store handling. Currently it is only used by the container runtime,\n * but eventually could be hosted on any channel once we formalize the channel api boundary.\n * @internal\n */\nexport class ChannelCollection\n\timplements Omit<IFluidDataStoreChannel, \"entryPoint\" | \"reSubmit\" | \"rollback\">, IDisposable\n{\n\t// Stores tracked by the Domain\n\tprivate readonly pendingAttach = new Map<string, IAttachMessage>();\n\t// 0.24 back-compat attachingBeforeSummary\n\tpublic readonly attachOpFiredForDataStore = new Set<string>();\n\n\tprotected readonly mc: MonitoringContext;\n\n\t// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda\n\tprivate readonly disposeOnce = new Lazy<void>(() => this.contexts.dispose());\n\n\tpublic readonly containerLoadStats: {\n\t\t// number of dataStores during loadContainer\n\t\treadonly containerLoadDataStoreCount: number;\n\t\t// number of unreferenced dataStores during loadContainer\n\t\treadonly referencedDataStoreCount: number;\n\t};\n\n\tprivate readonly pendingAliasMap: Map<string, Promise<AliasResult>> = new Map<\n\t\tstring,\n\t\tPromise<AliasResult>\n\t>();\n\n\tprotected readonly contexts: DataStoreContexts;\n\tprivate readonly aliasedDataStores: Set<string>;\n\n\tconstructor(\n\t\tprotected readonly baseSnapshot: ISnapshotTree | ISnapshot | undefined,\n\t\tpublic readonly parentContext: IFluidRootParentContextPrivate,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly gcNodeUpdated: (props: IGCNodeUpdatedProps) => void,\n\t\tprivate readonly isDataStoreDeleted: (nodePath: string) => boolean,\n\t\tprivate readonly aliasMap: Map<string, string>,\n\t) {\n\t\tthis.mc = createChildMonitoringContext({ logger: baseLogger });\n\t\tthis.contexts = new DataStoreContexts(baseLogger);\n\t\tthis.aliasedDataStores = new Set(aliasMap.values());\n\n\t\t// Extract stores stored inside the snapshot\n\t\tconst fluidDataStores = new Map<string, ISnapshotTree>();\n\t\tif (baseSnapshot) {\n\t\t\tconst baseSnapshotTree = getSnapshotTree(baseSnapshot);\n\t\t\tfor (const [key, value] of Object.entries(baseSnapshotTree.trees)) {\n\t\t\t\tfluidDataStores.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\tlet unreferencedDataStoreCount = 0;\n\t\t// Create a context for each of them\n\t\tfor (const [key, value] of fluidDataStores) {\n\t\t\tlet dataStoreContext: FluidDataStoreContext;\n\n\t\t\t// counting number of unreferenced data stores\n\t\t\tif (value.unreferenced) {\n\t\t\t\tunreferencedDataStoreCount++;\n\t\t\t}\n\t\t\t// If we have a detached container, then create local data store contexts.\n\t\t\tif (this.parentContext.attachState === AttachState.Detached) {\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tthrow new LoggingError(\"Snapshot should be there to load from!!\");\n\t\t\t\t}\n\t\t\t\tconst snapshotTree = value;\n\t\t\t\tdataStoreContext = new LocalFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tpkg: undefined,\n\t\t\t\t\tparentContext: this.wrapContextForInnerChannel(key),\n\t\t\t\t\tstorage: this.parentContext.storage,\n\t\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),\n\t\t\t\t\tsnapshotTree,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlet snapshotForRemoteFluidDatastoreContext: ISnapshot | ISnapshotTree = value;\n\t\t\t\tif (isInstanceOfISnapshot(baseSnapshot)) {\n\t\t\t\t\tsnapshotForRemoteFluidDatastoreContext = {\n\t\t\t\t\t\t...baseSnapshot,\n\t\t\t\t\t\tsnapshotTree: value,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tsnapshot: snapshotForRemoteFluidDatastoreContext,\n\t\t\t\t\tparentContext: this.wrapContextForInnerChannel(key),\n\t\t\t\t\tstorage: this.parentContext.storage,\n\t\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tloadingGroupId: value.groupId,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\t\t}\n\t\tthis.containerLoadStats = {\n\t\t\tcontainerLoadDataStoreCount: fluidDataStores.size,\n\t\t\treferencedDataStoreCount: fluidDataStores.size - unreferencedDataStoreCount,\n\t\t};\n\t}\n\n\tpublic get aliases(): ReadonlyMap<string, string> {\n\t\treturn this.aliasMap;\n\t}\n\n\tpublic get pendingAliases(): Map<string, Promise<AliasResult>> {\n\t\treturn this.pendingAliasMap;\n\t}\n\n\tpublic async waitIfPendingAlias(maybeAlias: string): Promise<AliasResult> {\n\t\tconst pendingAliasPromise = this.pendingAliases.get(maybeAlias);\n\t\treturn pendingAliasPromise ?? \"Success\";\n\t}\n\n\t/**\n\t * For sampling. Only log once per container\n\t */\n\tprivate shouldSendAttachLog = true;\n\n\tprotected wrapContextForInnerChannel(id: string): IFluidParentContextPrivate {\n\t\treturn wrapContextForInnerChannel(id, this.parentContext);\n\t}\n\n\t/**\n\t * IFluidDataStoreChannel.makeVisibleAndAttachGraph implementation\n\t * Not clear when it would be called and what it should do.\n\t * Currently this API is called by context only for root data stores.\n\t */\n\tpublic makeVisibleAndAttachGraph(): void {\n\t\tthis.parentContext.makeLocallyVisible();\n\t}\n\n\tprivate processAttachMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tfor (const { contents } of messagesContent) {\n\t\t\tconst attachMessage = contents as InboundAttachMessage;\n\t\t\t// We need to process the GC Data for both local and remote attach messages\n\t\t\tconst foundGCData = processAttachMessageGCData(\n\t\t\t\tattachMessage.snapshot ?? undefined,\n\t\t\t\t(nodeId, toPath) => {\n\t\t\t\t\t// nodeId is the relative path under the node being attached. Always starts with \"/\", but no trailing \"/\" after an id\n\t\t\t\t\tconst fromPath = `/${attachMessage.id}${nodeId === \"/\" ? \"\" : nodeId}`;\n\t\t\t\t\tthis.parentContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp);\n\t\t\t\t},\n\t\t\t);\n\n\t\t\t// Only log once per container to avoid noise/cost.\n\t\t\t// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details\n\t\t\tif (this.shouldSendAttachLog) {\n\t\t\t\tthis.shouldSendAttachLog = false;\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"dataStoreAttachMessage_sampled\",\n\t\t\t\t\t...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\tsnapshot: !!attachMessage.snapshot,\n\t\t\t\t\t\tfoundGCData,\n\t\t\t\t\t},\n\t\t\t\t\t...extractSafePropertiesFromMessage(envelope),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// The local object has already been attached\n\t\t\tif (local) {\n\t\t\t\tassert(\n\t\t\t\t\tthis.pendingAttach.has(attachMessage.id),\n\t\t\t\t\t0x15e /* \"Local object does not have matching attach message id\" */,\n\t\t\t\t);\n\t\t\t\tthis.contexts.get(attachMessage.id)?.setAttachState(AttachState.Attached);\n\t\t\t\tthis.pendingAttach.delete(attachMessage.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check for collision with local (not yet live / known to other clients) DataStore\n\t\t\t// This is not a DataCorruption case if we crash the container before the DataStore becomes visible to others (it's a DataProcessingError instead)\n\t\t\t//\n\t\t\t// POSSIBLE CAUSES:\n\t\t\t// - Something with ID creation, e.g. a bug in shortID logic, or somehow a generated ID matches an existing alias.\n\t\t\t// - An invalid operation by the application or service where an existing container is returned to a new container attach call,\n\t\t\t// resulting in duplicate accounting for objects that were supposed to be local-only. e.g. if the application patches in custom\n\t\t\t// logic not supported by Fluid's API.\n\t\t\tif (this.contexts.getUnbound(attachMessage.id) !== undefined) {\n\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\"Local DataStore matches remote DataStore id\",\n\t\t\t\t\t\"DataStoreAttach\",\n\t\t\t\t\tenvelope,\n\t\t\t\t\t{ ...tagCodeArtifacts({ dataStoreId: attachMessage.id }) },\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\t// Check for collision with already processed (attaching/attached or aliased) DataStore\n\t\t\t// This is presumed to indicate a corrupted op stream, where we'd expect all future sessions to fail here too.\n\t\t\t//\n\t\t\t// POSSIBLE CAUSES:\n\t\t\t// - A bug in the service or driver that results in ops being duplicated\n\t\t\t// - Similar to above, an existing container being returned to a new container attach call,\n\t\t\t// where the DataStore in question was already made locally visible before container attach.\n\t\t\t// (Perhaps future sessions would not fail in this case, but it's hypothetical and hard to differentiate)\n\t\t\tif (this.alreadyProcessed(attachMessage.id)) {\n\t\t\t\tconst error = new DataCorruptionError(\n\t\t\t\t\t// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId\n\t\t\t\t\t\"Duplicate DataStore created with existing id\",\n\t\t\t\t\t{\n\t\t\t\t\t\t...extractSafePropertiesFromMessage(envelope),\n\t\t\t\t\t\t...tagCodeArtifacts({ dataStoreId: attachMessage.id }),\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\t\tlet snapshot: ISnapshotTree | ISnapshot | undefined;\n\t\t\tif (attachMessage.snapshot) {\n\t\t\t\tsnapshot = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);\n\t\t\t\tif (isInstanceOfISnapshot(this.baseSnapshot)) {\n\t\t\t\t\tsnapshot = { ...this.baseSnapshot, snapshotTree: snapshot };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Include the type of attach message which is the pkg of the store to be\n\t\t\t// used by RemoteFluidDataStoreContext in case it is not in the snapshot.\n\t\t\tconst pkg = [attachMessage.type];\n\t\t\tconst remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\tid: attachMessage.id,\n\t\t\t\tsnapshot,\n\t\t\t\tparentContext: this.wrapContextForInnerChannel(attachMessage.id),\n\t\t\t\tstorage: new StorageServiceWithAttachBlobs(\n\t\t\t\t\tthis.parentContext.storage,\n\t\t\t\t\tflatAttachBlobs,\n\t\t\t\t),\n\t\t\t\tscope: this.parentContext.scope,\n\t\t\t\tloadingGroupId: attachMessage.snapshot?.groupId,\n\t\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(\n\t\t\t\t\tattachMessage.id,\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromAttach,\n\t\t\t\t\t\tsequenceNumber: envelope.sequenceNumber,\n\t\t\t\t\t\tsnapshot: attachMessage.snapshot ?? {\n\t\t\t\t\t\t\tentries: [createAttributesBlob(pkg, true /* isRootDataStore */)],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\tpkg,\n\t\t\t});\n\n\t\t\tthis.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);\n\t\t}\n\t}\n\n\tprivate processAliasMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tfor (const { contents, localOpMetadata } of messagesContent) {\n\t\t\tconst aliasMessage = contents as IDataStoreAliasMessage;\n\t\t\tif (!isDataStoreAliasMessage(aliasMessage)) {\n\t\t\t\tthrow new DataCorruptionError(\"malformedDataStoreAliasMessage\", {\n\t\t\t\t\t...extractSafePropertiesFromMessage(envelope),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst resolve = localOpMetadata as PendingAliasResolve;\n\t\t\tconst aliasResult = this.processAliasMessageCore(\n\t\t\t\taliasMessage.internalId,\n\t\t\t\taliasMessage.alias,\n\t\t\t\tenvelope.timestamp,\n\t\t\t);\n\t\t\tif (local) {\n\t\t\t\tresolve(aliasResult);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic processAliasMessageCore(\n\t\tinternalId: string,\n\t\talias: string,\n\t\tmessageTimestampMs?: number,\n\t): boolean {\n\t\tif (this.alreadyProcessed(alias)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst context = this.contexts.get(internalId);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted a signal.\n\t\tif (this.checkAndLogIfDeleted(internalId, context, \"Changed\", \"processAliasMessageCore\")) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (context === undefined) {\n\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\teventName: \"AliasFluidDataStoreNotFound\",\n\t\t\t\tfluidDataStoreId: internalId,\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\t// If message timestamp doesn't exist, this is called in a detached container. Don't notify GC in that case\n\t\t// because it doesn't run in detached container and doesn't need to know about this route.\n\t\tif (messageTimestampMs !== undefined) {\n\t\t\tthis.parentContext.addedGCOutboundRoute(\"/\", `/${internalId}`, messageTimestampMs);\n\t\t}\n\n\t\tthis.aliasMap.set(alias, context.id);\n\t\tthis.aliasedDataStores.add(context.id);\n\t\tcontext.setInMemoryRoot();\n\t\treturn true;\n\t}\n\n\tprivate alreadyProcessed(id: string): boolean {\n\t\treturn this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;\n\t}\n\n\t/**\n\t * Package up the context's attach summary etc into an IAttachMessage\n\t */\n\tprivate generateAttachMessage(localContext: LocalFluidDataStoreContext): IAttachMessage {\n\t\t// Get the attach summary.\n\t\tconst attachSummary = localContext.getAttachSummary();\n\n\t\t// Get the GC data and add it to the attach summary.\n\t\tconst attachGCData = localContext.getAttachGCData();\n\t\taddBlobToSummary(attachSummary, gcDataBlobKey, JSON.stringify(attachGCData));\n\n\t\t// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.\n\t\tconst snapshot = convertSummaryTreeToITree(attachSummary.summary);\n\n\t\treturn {\n\t\t\tid: localContext.id,\n\t\t\tsnapshot,\n\t\t\ttype: getLocalDataStoreType(localContext),\n\t\t} satisfies IAttachMessage;\n\t}\n\n\t/**\n\t * Make the data store locally visible in the container graph by moving the data store context from unbound to\n\t * bound list and submitting the attach message. This data store can now be reached from the root.\n\t * @param id - The id of the data store context to make visible.\n\t */\n\tprivate makeDataStoreLocallyVisible(id: string): void {\n\t\tconst localContext = this.contexts.getUnbound(id);\n\t\tassert(!!localContext, 0x15f /* \"Could not find unbound context to bind\" */);\n\n\t\t/**\n\t\t * If the container is not detached, it is globally visible to all clients. This data store should also be\n\t\t * globally visible. Move it to attaching state and send an \"attach\" op for it.\n\t\t * If the container is detached, this data store will be part of the summary that makes the container attached.\n\t\t */\n\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\tthis.submitAttachChannelOp(localContext);\n\t\t\tlocalContext.setAttachState(AttachState.Attaching);\n\t\t}\n\n\t\tthis.contexts.bind(id);\n\t}\n\n\tprotected submitAttachChannelOp(localContext: LocalFluidDataStoreContext): void {\n\t\tconst message = this.generateAttachMessage(localContext);\n\t\tthis.pendingAttach.set(localContext.id, message);\n\t\tthis.parentContext.submitMessage(\n\t\t\t{ type: ContainerMessageType.Attach, contents: message },\n\t\t\tundefined,\n\t\t);\n\t\tthis.attachOpFiredForDataStore.add(localContext.id);\n\t}\n\n\t/**\n\t * Generate compact internal DataStore ID.\n\t *\n\t * A note about namespace and name collisions:\n\t * This code assumes that that's the only way to generate internal IDs, and that it's Ok for this namespace to overlap with\n\t * user-provided alias names namespace.\n\t * There are two scenarios where it could cause trouble:\n\t * 1) Old files, where (already removed) CreateRoot*DataStore*() API was used, and thus internal name of data store\n\t * was provided by user. Such files may experience name collision with future data stores that receive a name generated\n\t * by this function.\n\t * 2) Much less likely, but if it happen that internal ID (generated by this function) is exactly the same as alias name\n\t * that user might use in the future, them ContainerRuntime.getAliasedDataStoreEntryPoint() or\n\t * ContainerRuntime.getDataStoreFromRequest() could return a data store with internalID matching user request, even though\n\t * user expected some other data store (that would receive alias later).\n\t * Please note that above mentioned functions have the implementation they have (allowing #2) due to #1.\n\t */\n\tprotected createDataStoreId(): string {\n\t\t/**\n\t\t * Return uuid if short-ids are explicitly disabled via feature flags.\n\t\t */\n\t\tif (this.mc.config.getBoolean(\"Fluid.Runtime.DisableShortIds\") === true) {\n\t\t\treturn uuid();\n\t\t} else {\n\t\t\t// We use three non-overlapping namespaces:\n\t\t\t// - detached state: even numbers\n\t\t\t// - attached state: odd numbers\n\t\t\t// - uuids\n\t\t\t// In first two cases we will encode result as strings in more compact form.\n\t\t\tif (this.parentContext.attachState === AttachState.Detached) {\n\t\t\t\t// container is detached, only one client observes content, no way to hit collisions with other clients.\n\t\t\t\treturn encodeCompactIdToString(2 * this.contexts.size);\n\t\t\t}\n\t\t\tconst id = this.parentContext.containerRuntime.generateDocumentUniqueId();\n\t\t\tif (typeof id === \"number\") {\n\t\t\t\treturn encodeCompactIdToString(2 * id + 1);\n\t\t\t}\n\t\t\treturn id;\n\t\t}\n\t}\n\n\tpublic createDetachedDataStore(\n\t\tpkg: readonly string[],\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextDetached {\n\t\treturn this.createContext(\n\t\t\tthis.createDataStoreId(),\n\t\t\tpkg,\n\t\t\tLocalDetachedFluidDataStoreContext,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\tpublic createDataStoreContext(\n\t\tpkg: readonly string[],\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextPrivate {\n\t\treturn this.createContext(\n\t\t\tthis.createDataStoreId(),\n\t\t\tpkg,\n\t\t\tLocalFluidDataStoreContext,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\tprotected createContext<T extends LocalFluidDataStoreContext>(\n\t\tid: string,\n\t\tpkg: readonly string[],\n\t\tcontextCtor: new (props: ILocalDetachedFluidDataStoreContextProps) => T,\n\t\tloadingGroupId?: string,\n\t): T {\n\t\tassert(loadingGroupId !== \"\", 0x974 /* loadingGroupId should not be the empty string */);\n\t\tconst context = new contextCtor({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage: this.parentContext.storage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tloadingGroupId,\n\t\t\tchannelToDataStoreFn: (channel: IFluidDataStoreChannel) =>\n\t\t\t\tchannelToDataStore(\n\t\t\t\t\tchannel,\n\t\t\t\t\tid,\n\t\t\t\t\tthis,\n\t\t\t\t\tcreateChildLogger({ logger: this.parentContext.baseLogger }),\n\t\t\t\t),\n\t\t});\n\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic get disposed(): boolean {\n\t\treturn this.disposeOnce.evaluated;\n\t}\n\tpublic dispose(): void {\n\t\treturn this.disposeOnce.value;\n\t}\n\n\tpublic readonly reSubmitContainerMessage = (\n\t\tmessage:\n\t\t\t| ContainerRuntimeDataStoreOpMessage\n\t\t\t| OutboundContainerRuntimeAttachMessage\n\t\t\t| ContainerRuntimeAliasMessage,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash: boolean,\n\t): void => {\n\t\tswitch (message.type) {\n\t\t\tcase ContainerMessageType.Attach:\n\t\t\tcase ContainerMessageType.Alias: {\n\t\t\t\tthis.parentContext.submitMessage(message, localOpMetadata);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase ContainerMessageType.FluidDataStoreOp: {\n\t\t\t\treturn this.resubmitDataStoreOp(message.contents, localOpMetadata, squash);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tassert(false, 0x907 /* unknown op type */);\n\t\t\t}\n\t\t}\n\t};\n\n\tprotected readonly resubmitDataStoreOp = (\n\t\tenvelope: IEnvelope<FluidDataStoreMessage>,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash: boolean,\n\t): void => {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and throw an error. If there are local changes for a\n\t\t// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"resubmitDataStoreOp\")\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"Context is deleted!\", {\n\t\t\t\tcallSite: \"resubmitDataStoreOp\",\n\t\t\t\t...tagCodeArtifacts({ id: envelope.address }),\n\t\t\t});\n\t\t}\n\t\tassert(!!context, 0x160 /* \"There should be a store context for the op\" */);\n\t\tcontext.reSubmit(envelope.contents, localOpMetadata, squash);\n\t};\n\n\tpublic readonly rollbackDataStoreOp = (\n\t\tenvelope: IEnvelope<FluidDataStoreMessage>,\n\t\tlocalOpMetadata: unknown,\n\t): void => {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and throw an error. If there are local changes for a\n\t\t// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"rollbackDataStoreOp\")\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"Context is deleted!\", {\n\t\t\t\tcallSite: \"rollbackDataStoreOp\",\n\t\t\t\t...tagCodeArtifacts({ id: envelope.address }),\n\t\t\t});\n\t\t}\n\t\tassert(!!context, 0x2e8 /* \"There should be a store context for the op\" */);\n\t\tcontext.rollback(envelope.contents, localOpMetadata);\n\t};\n\n\tpublic async applyStashedOp(content: unknown): Promise<unknown> {\n\t\tconst opContents = content as LocalContainerRuntimeMessage;\n\t\tswitch (opContents.type) {\n\t\t\tcase ContainerMessageType.Attach: {\n\t\t\t\treturn this.applyStashedAttachOp(opContents.contents);\n\t\t\t}\n\t\t\tcase ContainerMessageType.Alias: {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase ContainerMessageType.FluidDataStoreOp: {\n\t\t\t\treturn this.applyStashedChannelChannelOp(opContents.contents);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tassert(false, 0x908 /* unknon type of op */);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected async applyStashedChannelChannelOp(envelope: IEnvelope): Promise<unknown> {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case the data store that stashed the op is deleted.\n\t\tif (this.checkAndLogIfDeleted(envelope.address, context, \"Changed\", \"applyStashedOp\")) {\n\t\t\treturn undefined;\n\t\t}\n\t\tassert(!!context, 0x161 /* \"There should be a store context for the op\" */);\n\t\treturn context.applyStashedOp(envelope.contents);\n\t}\n\n\tprivate async applyStashedAttachOp(message: IAttachMessage): Promise<void> {\n\t\tconst { id, snapshot } = message;\n\n\t\t// build the snapshot from the summary in the attach message\n\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\tconst snapshotTree = buildSnapshotTree(snapshot.entries, flatAttachBlobs);\n\t\tconst storage = new StorageServiceWithAttachBlobs(\n\t\t\tthis.parentContext.storage,\n\t\t\tflatAttachBlobs,\n\t\t);\n\n\t\t// create a local datastore context for the data store context,\n\t\t// which this message represents. All newly created data store\n\t\t// contexts start as a local context on the client that created\n\t\t// them, and for stashed ops, the client that applies it plays\n\t\t// the role of creating client.\n\t\tconst dataStoreContext = new LocalFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg: undefined,\n\t\t\tparentContext: this.wrapContextForInnerChannel(id),\n\t\t\tstorage,\n\t\t\tscope: this.parentContext.scope,\n\t\t\tcreateSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree,\n\t\t});\n\t\t// add to the list of bound or remoted, as this context must be bound\n\t\t// to had an attach message sent, and is the non-detached case is remoted.\n\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\n\t\t// realize the local context, as local contexts shouldn't be delay\n\t\t// loaded, as this client is playing the role of creating client,\n\t\t// and creating clients always create realized data store contexts.\n\t\tconst channel = await dataStoreContext.realize();\n\t\tawait channel.entryPoint.get();\n\n\t\tif (this.parentContext.attachState !== AttachState.Detached) {\n\t\t\t// if the client is not detached put in the pending attach list\n\t\t\t// so that on ack of the stashed op, the context is found.\n\t\t\t// detached client don't send ops, so should not expect and ack.\n\t\t\tthis.pendingAttach.set(id, message);\n\t\t}\n\t}\n\n\t/**\n\t * Process messages for this channel collection. The messages here are contiguous messages in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tpublic processMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tswitch (messageCollection.envelope.type) {\n\t\t\tcase ContainerMessageType.FluidDataStoreOp: {\n\t\t\t\tthis.processChannelMessages(messageCollection);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ContainerMessageType.Attach: {\n\t\t\t\tthis.processAttachMessages(messageCollection);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ContainerMessageType.Alias: {\n\t\t\t\tthis.processAliasMessages(messageCollection);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tassert(false, 0x8e9 /* unreached */);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process channel messages. The messages here are contiguous channel type messages in a batch. Bunch\n\t * of contiguous messages for a data store should be sent to it together.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tprivate processChannelMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tlet currentMessageState: { address: string; type: string } | undefined;\n\t\tlet currentMessagesContent: IRuntimeMessagesContent[] = [];\n\n\t\t// Helper that sends the current bunch of messages to the data store. It validates that the data stores exists.\n\t\tconst sendBunchedMessages = (): void => {\n\t\t\t// Current message state will be undefined for the first message in the list.\n\t\t\tif (currentMessageState === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst currentContext = this.contexts.get(currentMessageState.address);\n\t\t\tassert(!!currentContext, 0xa66 /* Context not found */);\n\n\t\t\tcurrentContext.processMessages({\n\t\t\t\tenvelope: { ...envelope, type: currentMessageState.type },\n\t\t\t\tmessagesContent: currentMessagesContent,\n\t\t\t\tlocal,\n\t\t\t});\n\t\t\tcurrentMessagesContent = [];\n\t\t};\n\n\t\t/**\n\t\t * Bunch contiguous messages for the same data store and send them together.\n\t\t * This is an optimization mainly for DDSes, where it can process a bunch of ops together. DDSes\n\t\t * like merge tree or shared tree can process ops more efficiently when they are bunched together.\n\t\t */\n\t\tfor (const { contents, ...restOfMessagesContent } of messagesContent) {\n\t\t\tconst contentsEnvelope = contents as IEnvelope<FluidDataStoreMessage>;\n\t\t\tconst address = contentsEnvelope.address;\n\t\t\tconst context = this.contexts.get(address);\n\n\t\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t\t// corruption in case a deleted data store accidentally submitted an op.\n\t\t\tif (this.checkAndLogIfDeleted(address, context, \"Changed\", \"processFluidDataStoreOp\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (context === undefined) {\n\t\t\t\t// Former assert 0x162\n\t\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\t\"No context for op\",\n\t\t\t\t\t\"processFluidDataStoreOp\",\n\t\t\t\t\tenvelope as ISequencedDocumentMessage,\n\t\t\t\t\t{\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\tmessageDetails: JSON.stringify({\n\t\t\t\t\t\t\ttype: envelope.type,\n\t\t\t\t\t\t\tcontentType: typeof contents,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t...tagCodeArtifacts({ address }),\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst { type: contextType, content: contextContents } = contentsEnvelope.contents;\n\t\t\t// If the address or type of the message changes while processing the message, send the current bunch.\n\t\t\tif (\n\t\t\t\tcurrentMessageState?.address !== address ||\n\t\t\t\tcurrentMessageState?.type !== contextType\n\t\t\t) {\n\t\t\t\tsendBunchedMessages();\n\t\t\t}\n\t\t\tcurrentMessagesContent.push({\n\t\t\t\tcontents: contextContents,\n\t\t\t\t...restOfMessagesContent,\n\t\t\t});\n\t\t\tcurrentMessageState = { address, type: contextType };\n\n\t\t\t// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is\n\t\t\t// being used.\n\t\t\tthis.gcNodeUpdated({\n\t\t\t\tnode: { type: \"DataStore\", path: `/${address}` },\n\t\t\t\treason: \"Changed\",\n\t\t\t\ttimestampMs: envelope.timestamp,\n\t\t\t\tpackagePath: context.isLoaded ? context.packagePath : undefined,\n\t\t\t});\n\n\t\t\tdetectOutboundReferences(address, contextContents, (fromPath: string, toPath: string) =>\n\t\t\t\tthis.parentContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp),\n\t\t\t);\n\t\t}\n\n\t\t// Process the last bunch of messages, if any. Note that there may not be any messages in case all of them are\n\t\t// ignored because the data store is deleted.\n\t\tsendBunchedMessages();\n\t}\n\n\tprivate async getDataStore(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t\toriginalRequest: IRequest,\n\t): Promise<IFluidDataStoreContextPrivate> {\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tid,\n\t\t\t\tthis.contexts.get(id),\n\t\t\t\t\"Requested\",\n\t\t\t\t\"getDataStore\",\n\t\t\t\trequestHeaderData,\n\t\t\t\toriginalRequest,\n\t\t\t)\n\t\t) {\n\t\t\t// The requested data store has been deleted by gc. Create a 404 response exception.\n\t\t\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", originalRequest, {\n\t\t\t\t\t[DeletedResponseHeaderKey]: true,\n\t\t\t\t}),\n\t\t\t\toriginalRequest,\n\t\t\t);\n\t\t}\n\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\t// The requested data store does not exits. Throw a 404 response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(create404Response(request), request);\n\t\t}\n\t\treturn context;\n\t}\n\n\t/**\n\t * Returns the data store requested with the given id if available. Otherwise, returns undefined.\n\t */\n\tpublic async getDataStoreIfAvailable(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<IFluidDataStoreContextPrivate | undefined> {\n\t\t// If the data store has been deleted, log an error and return undefined.\n\t\tif (\n\t\t\tthis.checkAndLogIfDeleted(\n\t\t\t\tid,\n\t\t\t\tthis.contexts.get(id),\n\t\t\t\t\"Requested\",\n\t\t\t\t\"getDataStoreIfAvailable\",\n\t\t\t\trequestHeaderData,\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn context;\n\t}\n\n\t/**\n\t * Checks if the data store has been deleted by GC. If so, log an error.\n\t * @param id - The data store's id.\n\t * @param context - The data store context.\n\t * @param deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)\n\t * @param callSite - The function name this is called from.\n\t * @param requestHeaderData - The request header information to log if the data store is deleted.\n\t * @param originalRequest - The original request (could be for a child of the DataStore)\n\t * @returns true if the data store is deleted. Otherwise, returns false.\n\t */\n\tprivate checkAndLogIfDeleted(\n\t\tid: string,\n\t\tcontext: IFluidDataStoreContext | undefined,\n\t\tdeletedLogSuffix: \"Changed\" | \"Requested\",\n\t\tcallSite: string,\n\t\trequestHeaderData?: RuntimeHeaderData,\n\t\toriginalRequest?: IRequest,\n\t): boolean {\n\t\tconst dataStoreNodePath = `/${id}`;\n\t\tif (!this.isDataStoreDeleted(dataStoreNodePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst idToLog =\n\t\t\toriginalRequest === undefined ? dataStoreNodePath : urlToGCNodePath(originalRequest.url);\n\n\t\t// Log the package details asynchronously since getInitialSnapshotDetails is async\n\t\tconst recentlyDeletedContext = this.contexts.getRecentlyDeletedContext(id);\n\t\tif (recentlyDeletedContext !== undefined) {\n\t\t\trecentlyDeletedContext\n\t\t\t\t.getInitialSnapshotDetails()\n\t\t\t\t.then((details) => {\n\t\t\t\t\treturn details.pkg.join(\"/\");\n\t\t\t\t})\n\t\t\t\t.then(\n\t\t\t\t\t(pkg) => ({ pkg, error: undefined }),\n\t\t\t\t\t(error: Error) => ({ pkg: undefined, error }),\n\t\t\t\t)\n\t\t\t\t.then(({ pkg, error }) => {\n\t\t\t\t\tthis.mc.logger.sendTelemetryEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: `GC_DeletedDataStore_PathInfo`,\n\t\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\t\tid: idToLog,\n\t\t\t\t\t\t\t\tpkg,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcallSite,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t\t.catch(() => {});\n\t\t}\n\n\t\tthis.mc.logger.sendErrorEvent({\n\t\t\teventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,\n\t\t\t...tagCodeArtifacts({ id: idToLog }),\n\t\t\tcallSite,\n\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\texists: context !== undefined,\n\t\t\tdetails: {\n\t\t\t\turl: originalRequest?.url,\n\t\t\t\theaders: JSON.stringify(originalRequest?.headers),\n\t\t\t\taliased: this.aliasedDataStores.has(id),\n\t\t\t},\n\t\t});\n\t\treturn true;\n\t}\n\n\tpublic processSignal(messageArg: IInboundSignalMessage, local: boolean): void {\n\t\tconst envelope = messageArg.content as IEnvelope;\n\t\tconst fluidDataStoreId = envelope.address;\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\tconst message = { ...messageArg, content: envelope.contents };\n\t\tconst context = this.contexts.get(fluidDataStoreId);\n\t\t// If the data store has been deleted, log an error and ignore this message. This helps prevent document\n\t\t// corruption in case a deleted data store accidentally submitted a signal.\n\t\tif (this.checkAndLogIfDeleted(fluidDataStoreId, context, \"Changed\", \"processSignal\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!context) {\n\t\t\t// Attach message may not have been processed yet\n\t\t\tassert(!local, 0x163 /* \"Missing datastore for local signal\" */);\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"SignalFluidDataStoreNotFound\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tcontext.processSignal(message, local);\n\t}\n\n\tpublic setConnectionState(canSendOps: boolean, clientId?: string): void {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.setConnectionState(canSendOps, clientId);\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"SetConnectionStateError\",\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\truntimeConnected: this.parentContext.connected,\n\t\t\t\t\t\t\tcanSendOps,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Enumerates the contexts and calls notifyReadOnlyState on them.\n\t */\n\tpublic notifyReadOnlyState(readonly: boolean): void {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.notifyReadOnlyState();\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"SetReadOnlyStateError\",\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\truntimeReadonly: this.parentContext.isReadOnly(),\n\t\t\t\t\t\t\treadonly,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Notifies all data store contexts about the current staging mode state.\n\t *\n\t * @param staging - A boolean indicating whether the container is in staging mode.\n\t */\n\tpublic notifyStagingMode(staging: boolean): void {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.notifyStagingMode(staging);\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"notifyStagingModeError\",\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\tstaging,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tfor (const [, context] of this.contexts) {\n\t\t\t// Fire only for bounded stores.\n\t\t\tif (!this.contexts.isNotBound(context.id)) {\n\t\t\t\tcontext.setAttachState(attachState);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.contexts.size;\n\t}\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t */\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tlet dataStoreSummary: ISummarizeResult;\n\t\t\t\tif (context.isLoaded) {\n\t\t\t\t\tdataStoreSummary = context.getAttachSummary(telemetryContext);\n\t\t\t\t} else {\n\t\t\t\t\t// If this data store is not yet loaded, then there should be no changes in the snapshot from\n\t\t\t\t\t// which it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!this.baseSnapshot,\n\t\t\t\t\t\t0x166 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t);\n\t\t\t\t\tdataStoreSummary = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\tgetSnapshotTree(this.baseSnapshot).trees[contextId],\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbuilder.addWithStats(contextId, dataStoreSummary);\n\t\t\t},\n\t\t);\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Gets the GC data. Used when attaching or serializing a detached container.\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tconst builder = new GCDataBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextGCData = context.getAttachGCData(telemetryContext);\n\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t},\n\t\t);\n\t\t// Get the outbound routes (aliased data stores) and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", [...this.aliasedDataStores]);\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * Helper method for preparing to attach this channel.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate visitLocalBoundContextsDuringAttach(\n\t\tvisitor: (contextId: string, context: FluidDataStoreContext) => void,\n\t): void {\n\t\tconst visitedContexts = new Set<string>();\n\t\tlet visitedLength = -1;\n\t\tlet notBoundContextsLength = -1;\n\t\twhile (\n\t\t\tvisitedLength !== visitedContexts.size &&\n\t\t\tnotBoundContextsLength !== this.contexts.notBoundLength()\n\t\t) {\n\t\t\t// detect changes in the visitedContexts set, as on visiting a context\n\t\t\t// it could could make contexts available by removing other contexts\n\t\t\t// from the not bound context list, so we need to ensure those get processed as well.\n\t\t\t// only once the loop can run with no new contexts added to the visitedContexts set do we\n\t\t\t// know for sure all possible contexts have been visited.\n\t\t\tvisitedLength = visitedContexts.size;\n\t\t\tnotBoundContextsLength = this.contexts.notBoundLength();\n\t\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\t\tif (\n\t\t\t\t\t!(\n\t\t\t\t\t\tvisitedContexts.has(contextId) ||\n\t\t\t\t\t\tthis.contexts.isNotBound(contextId) ||\n\t\t\t\t\t\tthis.attachOpFiredForDataStore.has(contextId)\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tvisitor(contextId, context);\n\t\t\t\t\tvisitedContexts.add(contextId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Helper method for preparing to summarize this channel.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate async visitContextsDuringSummary(\n\t\tvisitor: (contextId: string, context: FluidDataStoreContext) => Promise<void>,\n\t\ttelemetryProps: ITelemetryPropertiesExt,\n\t): Promise<void> {\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\t// Summarizer client and hence GC works only with clients with no local changes. A data store in\n\t\t\t// attaching state indicates an op was sent to attach a local data store, and the the attach op\n\t\t\t// had not yet round tripped back to the client.\n\t\t\t// Formerly assert 0x589\n\t\t\tif (context.attachState === AttachState.Attaching) {\n\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\"Local data store detected in attaching state\",\n\t\t\t\t\t\"summarize/getGCData\",\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tif (context.attachState === AttachState.Attached) {\n\t\t\t\t// If summary / getGCData results in this data store's realization, let GC know so that it can log in\n\t\t\t\t// case the data store is not referenced. This will help identifying scenarios that we see today where\n\t\t\t\t// unreferenced data stores are being loaded.\n\t\t\t\tconst contextLoadedBefore = context.isLoaded;\n\t\t\t\tconst trailingOpCount = context.pendingCount;\n\n\t\t\t\tawait visitor(contextId, context);\n\n\t\t\t\tif (!contextLoadedBefore && context.isLoaded) {\n\t\t\t\t\tthis.gcNodeUpdated({\n\t\t\t\t\t\tnode: { type: \"DataStore\", path: `/${context.id}` },\n\t\t\t\t\t\treason: \"Realized\",\n\t\t\t\t\t\tpackagePath: context.packagePath,\n\t\t\t\t\t\ttimestampMs: undefined, // This will be added by the parent context if needed.\n\t\t\t\t\t\tadditionalProps: { trailingOpCount, ...telemetryProps },\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextSummary = await context.summarize(fullTree, trackState, telemetryContext);\n\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t},\n\t\t\t{ fullTree, realizedDuring: \"summarize\" },\n\t\t);\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. It does the following:\n\t *\n\t * 1. Calls into each child data store context to get its GC data.\n\t *\n\t * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be\n\t * identified as belonging to the child.\n\t *\n\t * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent\n\t * the GC data of this channel.\n\t *\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\tconst builder = new GCDataBuilder();\n\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: FluidDataStoreContext) => {\n\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t},\n\t\t\t{ fullGC, realizedDuring: \"getGCData\" },\n\t\t);\n\n\t\t// Get the outbound routes and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", await this.getOutboundRoutes());\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * After GC has run, called to notify this Container's data stores of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in all data stores in this Container.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: readonly string[]): void {\n\t\t// Get a map of data store ids to routes used in it.\n\t\tconst usedDataStoreRoutes = unpackChildNodesUsedRoutes(usedRoutes);\n\n\t\t// Verify that the used routes are correct.\n\t\tfor (const [id] of usedDataStoreRoutes) {\n\t\t\tassert(\n\t\t\t\tthis.contexts.has(id),\n\t\t\t\t0x167 /* \"Used route does not belong to any known data store\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.updateUsedRoutes(usedDataStoreRoutes.get(contextId) ?? []);\n\t\t}\n\t}\n\n\tpublic deleteChild(dataStoreId: string): void {\n\t\tconst dataStoreContext = this.contexts.get(dataStoreId);\n\t\tassert(dataStoreContext !== undefined, 0x2d7 /* No data store with specified id */);\n\n\t\tif (dataStoreContext.isLoaded) {\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"GC_DeletingLoadedDataStore\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tid: `/${dataStoreId}`, // Make the id consistent with GC node path format by prefixing a slash.\n\t\t\t\t\tpkg: dataStoreContext.packagePath.join(\"/\"),\n\t\t\t\t}),\n\t\t\t\tdetails: {\n\t\t\t\t\taliased: this.aliasedDataStores.has(dataStoreId),\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tdataStoreContext.delete();\n\t\t// Delete the contexts of unused data stores.\n\t\tthis.contexts.delete(dataStoreId);\n\t\t// Delete the summarizer node of the unused data stores.\n\t\tthis.parentContext.deleteChildSummarizerNode(dataStoreId);\n\t}\n\n\t/**\n\t * Delete data stores and its objects that are sweep ready.\n\t * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should\n\t * be deleted.\n\t * @returns The routes of data stores and its objects that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(\n\t\tsweepReadyDataStoreRoutes: readonly string[],\n\t): readonly string[] {\n\t\tfor (const route of sweepReadyDataStoreRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tconst dataStoreId = pathParts[1];\n\n\t\t\t// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only\n\t\t\t// need to delete the data store.\n\t\t\t// These routes will still be returned below as among the deleted routes\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst dataStoreContext = this.contexts.get(dataStoreId);\n\t\t\tif (dataStoreContext === undefined) {\n\t\t\t\t// If the data store hasn't already been deleted, log an error because this should never happen.\n\t\t\t\t// If the data store has already been deleted, log a telemetry event. This can happen because multiple GC\n\t\t\t\t// sweep ops can contain the same data store. It would be interesting to track how often this happens.\n\t\t\t\tconst alreadyDeleted = this.isDataStoreDeleted(`/${dataStoreId}`);\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"DeletedDataStoreNotFound\",\n\t\t\t\t\tcategory: alreadyDeleted ? \"generic\" : \"error\",\n\t\t\t\t\t...tagCodeArtifacts({ id: dataStoreId }),\n\t\t\t\t\tdetails: { alreadyDeleted },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.deleteChild(dataStoreId);\n\t\t}\n\t\treturn [...sweepReadyDataStoreRoutes];\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are tombstones.\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\t * @param tombstonedRoutes - The routes that are tombstones in all data stores in this Container.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: readonly string[]): void {\n\t\tconst tombstonedDataStoresSet: Set<string> = new Set();\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Tombstone data store only if its route (/datastoreId) is directly in tombstoneRoutes.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);\n\t\t\ttombstonedDataStoresSet.add(dataStoreId);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.setTombstone(tombstonedDataStoresSet.has(contextId));\n\t\t}\n\t}\n\n\t/**\n\t * Returns the outbound routes of this channel. Only root data stores are considered referenced and their paths are\n\t * part of outbound routes.\n\t */\n\tprivate async getOutboundRoutes(): Promise<string[]> {\n\t\tconst outboundRoutes: string[] = [];\n\t\t// Getting this information is a performance optimization that reduces network calls for virtualized datastores\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tconst isRootDataStore = await context.isRoot(this.aliasedDataStores);\n\t\t\tif (isRootDataStore) {\n\t\t\t\toutboundRoutes.push(`/${contextId}`);\n\t\t\t}\n\t\t}\n\t\treturn outboundRoutes;\n\t}\n\n\t/**\n\t * Called by GC to retrieve the package path of a data store node with the given path.\n\t */\n\tpublic async getDataStorePackagePath(\n\t\tnodePath: string,\n\t): Promise<readonly string[] | undefined> {\n\t\t// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the\n\t\t// data store that contains it.\n\t\tconst context = this.contexts.get(nodePath.split(\"/\")[1]);\n\t\tconst initialSnapshotDetails = await context?.getInitialSnapshotDetails();\n\t\treturn initialSnapshotDetails?.pkg;\n\t}\n\n\t/**\n\t * Called by GC to determine if a node is for a data store or for an object within a data store (for e.g. DDS).\n\t * @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.\n\t */\n\n\tpublic getGCNodeType(nodePath: string): GCNodeType | undefined {\n\t\tconst pathParts = nodePath.split(\"/\");\n\t\tif (!this.contexts.has(pathParts[1])) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Data stores paths are of the format \"/dataStoreId\".\n\t\t// Sub data store paths are of the format \"/dataStoreId/subPath/...\".\n\t\tif (pathParts.length === 2) {\n\t\t\treturn GCNodeType.DataStore;\n\t\t}\n\n\t\treturn GCNodeType.SubDataStore;\n\t}\n\n\tpublic internalId(maybeAlias: string): string {\n\t\treturn this.aliases.get(maybeAlias) ?? maybeAlias;\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\tconst requestParser = RequestParser.create(request);\n\t\tconst id = requestParser.pathParts[0];\n\n\t\t// Differentiate between requesting the dataStore directly, or one of its children\n\t\tconst requestForChild = requestParser.pathParts.length > 1;\n\n\t\tconst headerData: RuntimeHeaderData = {};\n\t\tif (typeof request.headers?.[RuntimeHeaders.wait] === \"boolean\") {\n\t\t\theaderData.wait = request.headers[RuntimeHeaders.wait];\n\t\t}\n\t\tif (typeof request.headers?.[RuntimeHeaders.viaHandle] === \"boolean\") {\n\t\t\theaderData.viaHandle = request.headers[RuntimeHeaders.viaHandle];\n\t\t}\n\t\tif (typeof request.headers?.[AllowTombstoneRequestHeaderKey] === \"boolean\") {\n\t\t\theaderData.allowTombstone = request.headers[AllowTombstoneRequestHeaderKey];\n\t\t}\n\n\t\t// We allow Tombstone requests for sub-DataStore objects\n\t\tif (requestForChild) {\n\t\t\theaderData.allowTombstone = true;\n\t\t}\n\n\t\tawait this.waitIfPendingAlias(id);\n\t\tconst internalId = this.internalId(id);\n\t\tconst dataStoreContext = await this.getDataStore(internalId, headerData, request);\n\n\t\t// Get the initial snapshot details which contain the data store package path.\n\t\tconst details = await dataStoreContext.getInitialSnapshotDetails();\n\n\t\t// When notifying GC of this node being loaded, we only indicate the DataStore itself, not the full subDataStore url if applicable.\n\t\t// This is in case the url is to a route that Fluid doesn't understand or track for GC (e.g. if suited for a custom request handler)\n\t\tthis.gcNodeUpdated({\n\t\t\tnode: { type: \"DataStore\", path: `/${id}` },\n\t\t\treason: \"Loaded\",\n\t\t\tpackagePath: details.pkg,\n\t\t\trequest,\n\t\t\theaderData,\n\t\t\ttimestampMs: undefined, // This will be added by the parent context if needed.\n\t\t});\n\n\t\tconst dataStore = await dataStoreContext.realize();\n\n\t\tconst subRequest = requestParser.createSubRequest(1);\n\t\t// We always expect createSubRequest to include a leading slash, but asserting here to protect against\n\t\t// unintentionally modifying the url if that changes.\n\t\tassert(\n\t\t\tsubRequest.url.startsWith(\"/\"),\n\t\t\t0x126 /* \"Expected createSubRequest url to include a leading slash\" */,\n\t\t);\n\n\t\treturn dataStore.request(subRequest);\n\t}\n}\n\nexport function getSummaryForDatastores(\n\tsnapshot: ISnapshotTree | undefined,\n\n\tmetadata?: IContainerRuntimeMetadata,\n): ISnapshotTree | undefined {\n\tif (!snapshot) {\n\t\treturn undefined;\n\t}\n\n\tif (rootHasIsolatedChannels(metadata)) {\n\t\tconst datastoresSnapshot: ISnapshotTree | undefined = snapshot.trees[channelsTreeName];\n\t\tassert(datastoresSnapshot !== undefined, 0x168 /* Expected tree in snapshot not found */);\n\t\treturn datastoresSnapshot;\n\t} else {\n\t\t// back-compat: strip out all non-datastore paths before giving to DataStores object.\n\t\tconst datastoresTrees: ISnapshotTree[\"trees\"] = {};\n\t\tfor (const [key, value] of Object.entries(snapshot.trees)) {\n\t\t\tif (!nonDataStorePaths.includes(key)) {\n\t\t\t\tdatastoresTrees[key] = value;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...snapshot,\n\t\t\ttrees: datastoresTrees,\n\t\t};\n\t}\n}\n\n/**\n * Traverse this op's contents and detect any outbound routes that were added by this op.\n *\n * @internal\n */\nexport function detectOutboundReferences(\n\taddress: string,\n\tcontents: unknown,\n\taddedOutboundReference: (fromNodePath: string, toNodePath: string) => void,\n): void {\n\t// These will be built up as we traverse the envelope contents\n\tconst outboundPaths: string[] = [];\n\tlet ddsAddress: string | undefined;\n\n\tfunction recursivelyFindHandles(obj: unknown): void {\n\t\tif (typeof obj === \"object\" && obj !== null) {\n\t\t\tfor (const [key, value] of Object.entries(obj)) {\n\t\t\t\t// If 'value' is a serialized IFluidHandle, it represents a new outbound route.\n\t\t\t\tif (isSerializedHandle(value)) {\n\t\t\t\t\toutboundPaths.push(value.url);\n\t\t\t\t}\n\n\t\t\t\t// NOTE: This is taking a hard dependency on the fact that in our DataStore implementation,\n\t\t\t\t// the address of the DDS is stored in a property called \"address\". This is not ideal.\n\t\t\t\t// An alternative would be for the op envelope to include the absolute path (built up as it is submitted)\n\t\t\t\tif (key === \"address\" && ddsAddress === undefined) {\n\t\t\t\t\tddsAddress = value as string | undefined;\n\t\t\t\t}\n\n\t\t\t\trecursivelyFindHandles(value);\n\t\t\t}\n\t\t}\n\t}\n\n\trecursivelyFindHandles(contents);\n\n\t// GC node paths are all absolute paths, hence the \"\" prefix.\n\t// e.g. this will yield \"/dataStoreId/ddsId\"\n\tconst fromPath = [\"\", address, ddsAddress].join(\"/\");\n\tfor (const toPath of outboundPaths) {\n\t\taddedOutboundReference(fromPath, toPath);\n\t}\n}\n\n// #region Experimentation\n// The code below here is for experimentation (and one test) only.\n\n/**\n * @privateRemarks This class is only used for experimentation/testing.\n */\nexport class ComposableChannelCollection\n\textends ChannelCollection\n\timplements IFluidDataStoreChannel\n{\n\tpublic readonly entryPoint: IFluidHandleInternal<FluidObject>;\n\n\tpublic constructor(\n\t\tbaseSnapshot: ISnapshotTree | ISnapshot | undefined,\n\t\tparentContext: IFluidParentContextPrivate,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tgcNodeUpdated: (props: IGCNodeUpdatedProps) => void,\n\t\tisDataStoreDeleted: (nodePath: string) => boolean,\n\t\taliasMap: Map<string, string>,\n\t\tprovideEntryPoint: (runtime: ComposableChannelCollection) => Promise<FluidObject>,\n\t) {\n\t\tsuper(\n\t\t\tbaseSnapshot,\n\t\t\t/* [root] parentContext */\n\t\t\tformParentContext<IFluidRootParentContextPrivate>(parentContext, {\n\t\t\t\tsubmitMessage: (\n\t\t\t\t\tcontainerRuntimeMessage:\n\t\t\t\t\t\t| ContainerRuntimeDataStoreOpMessage\n\t\t\t\t\t\t| OutboundContainerRuntimeAttachMessage\n\t\t\t\t\t\t| ContainerRuntimeAliasMessage,\n\t\t\t\t\tlocalOpMetadata: unknown,\n\t\t\t\t): void => {\n\t\t\t\t\t// Note that here our message format is reconfigured.\n\t\t\t\t\t// While `ContainerRuntime*Message`s use `contents`\n\t\t\t\t\t// as `FluidDataStoreMessage`s, the content is\n\t\t\t\t\t// stored in `content`.\n\t\t\t\t\tparentContext.submitMessage(\n\t\t\t\t\t\tcontainerRuntimeMessage.type,\n\t\t\t\t\t\tcontainerRuntimeMessage.contents,\n\t\t\t\t\t\tlocalOpMetadata,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tsubmitSignal: (\n\t\t\t\t\tenvelope: AddressedUnsequencedSignalEnvelope,\n\t\t\t\t\ttargetClientId?: string,\n\t\t\t\t): void => {\n\t\t\t\t\tparentContext.submitSignal(\n\t\t\t\t\t\tenvelope.contents.type,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taddress: envelope.address,\n\t\t\t\t\t\t\tcontents: envelope.contents.content,\n\t\t\t\t\t\t} satisfies IEnvelope<unknown>,\n\t\t\t\t\t\ttargetClientId,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tbaseLogger,\n\t\t\tgcNodeUpdated,\n\t\t\tisDataStoreDeleted,\n\t\t\taliasMap,\n\t\t);\n\t\tthis.entryPoint = new FluidObjectHandle<FluidObject>(\n\t\t\tnew LazyPromise(async () => provideEntryPoint(this)),\n\t\t\t\"\",\n\t\t\tthis.parentContext.IFluidHandleContext,\n\t\t);\n\t}\n\n\tpublic reSubmit(\n\t\ttype: string,\n\t\tcontent: unknown,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash: boolean,\n\t): void {\n\t\t// If the cast is incorrect and type is not one of the three supported,\n\t\t// reSubmitContainerMessage will assert.\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Need to force conversion\n\t\tconst message = {\n\t\t\ttype,\n\t\t\tcontents: content,\n\t\t} as\n\t\t\t| ContainerRuntimeDataStoreOpMessage\n\t\t\t| OutboundContainerRuntimeAttachMessage\n\t\t\t| ContainerRuntimeAliasMessage;\n\t\tthis.reSubmitContainerMessage(message, localOpMetadata, squash);\n\t}\n\n\tpublic rollback(type: string, content: unknown, localOpMetadata: unknown): void {\n\t\tassert(type === ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);\n\t\tthis.rollbackDataStoreOp(content as IEnvelope<FluidDataStoreMessage>, localOpMetadata);\n\t}\n}\n\n/**\n * @privateRemarks This factory is only used for experimentation/testing.\n *\n * @internal\n */\nexport class ChannelCollectionFactory implements IFluidDataStoreFactory {\n\tpublic readonly type = \"ChannelCollectionChannel\";\n\n\tpublic IFluidDataStoreRegistry: IFluidDataStoreRegistry;\n\n\tconstructor(\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\t// ADO:7302 We need a better type here\n\t\tprivate readonly provideEntryPoint: (\n\t\t\truntime: IFluidDataStoreChannel,\n\t\t) => Promise<FluidObject>,\n\t) {\n\t\tthis.IFluidDataStoreRegistry = new FluidDataStoreRegistry(registryEntries);\n\t}\n\n\tpublic get IFluidDataStoreFactory(): ChannelCollectionFactory {\n\t\treturn this;\n\t}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\t_existing: boolean,\n\t): Promise<IFluidDataStoreChannel> {\n\t\t// when work is done to complete nested datastores\n\t\t// this class should move to a new package\n\t\t// and IFluidDataStoreContext will need to support\n\t\t// all the cross layer needs of the channel context,\n\t\t// and the below assert should be removed.\n\t\t//\n\t\t// for now this will continue to work if both\n\t\t// this factory and the container runtime are\n\t\t// from the same package.\n\t\tassert(\n\t\t\tcontext instanceof FluidDataStoreContext,\n\t\t\t0xb8f /* we don't support the layer boundary here today */,\n\t\t);\n\n\t\tconst runtime = new ComposableChannelCollection(\n\t\t\tcontext.baseSnapshot,\n\t\t\t/* parentContext */ context,\n\t\t\tcontext.baseLogger,\n\t\t\t/* gcNodeUpdated */ () => {},\n\t\t\t/* isDataStoreDeleted */ (_nodePath: string) => false,\n\t\t\tnew Map(), // aliasMap\n\t\t\tthis.provideEntryPoint,\n\t\t);\n\n\t\treturn runtime;\n\t}\n\n\t// #endregion Experimentation\n}\n"]}
@@ -17,6 +17,7 @@ import type { IIdCompressor } from "@fluidframework/id-compressor";
17
17
  import type { IIdCompressorCore, SerializedIdCompressorWithOngoingSession } from "@fluidframework/id-compressor/internal";
18
18
  import { FlushMode } from "@fluidframework/runtime-definitions/internal";
19
19
  import type { ISummaryTreeWithStats, ITelemetryContext, IGarbageCollectionData, CreateChildSummarizerNodeParam, IDataStore, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IFluidParentContext, NamedFluidDataStoreRegistryEntries, SummarizeInternalFn, ISummarizerNodeWithGC, StageControlsInternal, IContainerRuntimeBaseInternal, MinimumVersionForCollab, ContainerExtensionExpectations } from "@fluidframework/runtime-definitions/internal";
20
+ import { TelemetryContext } from "@fluidframework/runtime-utils/internal";
20
21
  import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
21
22
  import { type IPendingBlobs, type IBlobManagerLoadInfo } from "./blobManager/index.js";
22
23
  import type { ICompressionRuntimeOptions } from "./compressionDefinitions.js";
@@ -811,6 +812,10 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
811
812
  * True to run GC sweep phase after the mark phase
812
813
  */
813
814
  runSweep?: boolean;
815
+ /**
816
+ * Telemetry context to populate during summarization.
817
+ */
818
+ telemetryContext?: TelemetryContext;
814
819
  }): Promise<ISummaryTreeWithStats>;
815
820
  private getGCDataInternal;
816
821
  /**