@fluidframework/container-loader 2.102.0 → 2.110.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.
- package/CHANGELOG.md +45 -0
- package/api-report/container-loader.legacy.alpha.api.md +21 -8
- package/api-report/container-loader.legacy.beta.api.md +19 -6
- package/dist/connectionManager.d.ts +2 -2
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +3 -3
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +7 -3
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +3 -3
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +2 -2
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/createAndLoadContainerUtils.d.ts +111 -19
- package/dist/createAndLoadContainerUtils.d.ts.map +1 -1
- package/dist/createAndLoadContainerUtils.js +101 -19
- package/dist/createAndLoadContainerUtils.js.map +1 -1
- package/dist/debugLogger.d.ts +2 -2
- package/dist/debugLogger.d.ts.map +1 -1
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +2 -2
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js.map +1 -1
- package/dist/error.d.ts +2 -2
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/frozenServices.d.ts.map +1 -1
- package/dist/frozenServices.js +17 -4
- package/dist/frozenServices.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +3 -0
- package/dist/legacyAlpha.d.ts +3 -0
- package/dist/loaderLayerCompatState.d.ts +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +2 -2
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +13 -1
- package/dist/utils.js.map +1 -1
- package/lib/connectionManager.d.ts +2 -2
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +1 -1
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +3 -3
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +7 -3
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +3 -3
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +2 -2
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/createAndLoadContainerUtils.d.ts +111 -19
- package/lib/createAndLoadContainerUtils.d.ts.map +1 -1
- package/lib/createAndLoadContainerUtils.js +85 -3
- package/lib/createAndLoadContainerUtils.js.map +1 -1
- package/lib/debugLogger.d.ts +2 -2
- package/lib/debugLogger.d.ts.map +1 -1
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +2 -2
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +1 -1
- package/lib/deltaManager.js.map +1 -1
- package/lib/error.d.ts +2 -2
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/frozenServices.d.ts.map +1 -1
- package/lib/frozenServices.js +17 -4
- package/lib/frozenServices.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +3 -0
- package/lib/legacyAlpha.d.ts +3 -0
- package/lib/loaderLayerCompatState.d.ts +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +2 -2
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +13 -1
- package/lib/utils.js.map +1 -1
- package/package.json +42 -14
- package/src/connectionManager.ts +4 -4
- package/src/connectionStateHandler.ts +4 -4
- package/src/container.ts +8 -3
- package/src/containerContext.ts +3 -3
- package/src/containerStorageAdapter.ts +3 -3
- package/src/createAndLoadContainerUtils.ts +227 -24
- package/src/debugLogger.ts +3 -3
- package/src/deltaManager.ts +7 -7
- package/src/error.ts +2 -2
- package/src/frozenServices.ts +22 -8
- package/src/index.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/src/retriableDocumentStorageService.ts +2 -2
- package/src/utils.ts +12 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAndLoadContainerUtils.js","sourceRoot":"","sources":["../src/createAndLoadContainerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAe9E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACN,YAAY,EACZ,UAAU,EACV,cAAc,EACd,4BAA4B,EAC5B,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,GACZ,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EACN,gCAAgC,EAChC,2BAA2B,EAC3B,gCAAgC,EAChC,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,kCAAkC,GAElC,MAA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AAE,SAAS,EAAE,CAC7C,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIContainer,\n\tICodeDetailsLoader,\n\tIFluidCodeDetails,\n\tIContainerPolicies,\n} from \"@fluidframework/container-definitions/internal\";\nimport { LoaderHeader } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIConfigProviderBase,\n\tIRequest,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentServiceFactory,\n\tISequencedDocumentMessage,\n\tISnapshot,\n\tISnapshotTree,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { DriverHeader, FetchSource } from \"@fluidframework/driver-definitions/internal\";\nimport { getSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tGenericError,\n\tUsageError,\n\tnormalizeError,\n\tcreateChildMonitoringContext,\n\tmixinMonitoringContext,\n\tsessionStorageConfigProvider,\n\tPerformanceEvent,\n\tisFluidError,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n\tcaptureReferencedAttachmentBlobs,\n\textractBlobAttachReferences,\n\tinlineAttachmentBlobsByReference,\n\tparseGcSnapshotData,\n\treadReferencedSnapshotBlobs,\n\tsnapshotHasLoadingGroups,\n\tunreferencedAttachmentBlobLocalIds,\n\ttype IBlobAttachReference,\n} from \"./captureReferencedContents.js\";\nimport { DebugLogger } from \"./debugLogger.js\";\nimport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nimport { Loader } from \"./loader.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport type { ProtocolHandlerBuilder } from \"./protocol.js\";\nimport type { IPendingContainerState } from \"./serializedStateManager.js\";\nimport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummarizeOnDemandResults,\n} from \"./summarizerResultTypes.js\";\nimport { getDocumentAttributes } from \"./utils.js\";\n\ninterface OnDemandSummarizeResultsPromises {\n\treadonly summarySubmitted: Promise<SummarizeOnDemandResults[\"summarySubmitted\"]>;\n\treadonly summaryOpBroadcasted: Promise<SummarizeOnDemandResults[\"summaryOpBroadcasted\"]>;\n}\n\ninterface OnDemandSummarizeOptions {\n\treadonly reason?: string;\n\treadonly retryOnFailure?: boolean;\n\treadonly fullTree?: boolean;\n}\n\ninterface SummarizerLike {\n\treadonly ISummarizer?: SummarizerLike;\n\tsummarizeOnDemand(options: OnDemandSummarizeOptions): OnDemandSummarizeResultsPromises;\n}\n\n/**\n * Properties necessary for creating and loading a container.\n * @legacy @beta\n */\nexport interface ICreateAndLoadContainerProps {\n\t/**\n\t * The url resolver used by the loader for resolving external urls\n\t * into Fluid urls such that the container specified by the\n\t * external url can be loaded.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory take the Fluid url provided\n\t * by the resolved url and constructs all the necessary services\n\t * for communication with the container's server.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The code loader handles loading the necessary code\n\t * for running a container once it is loaded.\n\t */\n\treadonly codeLoader: ICodeDetailsLoader;\n\n\t/**\n\t * A property bag of options/policies used by various layers\n\t * to control features\n\t */\n\treadonly options?: IContainerPolicies | undefined;\n\n\t/**\n\t * Scope is provided to all container and is a set of shared\n\t * services for container's to integrate with their host environment.\n\t */\n\treadonly scope?: FluidObject | undefined;\n\n\t/**\n\t * The logger that all telemetry should be pushed to.\n\t */\n\treadonly logger?: ITelemetryBaseLogger | undefined;\n\n\t/**\n\t * The configuration provider which may be used to control features.\n\t */\n\treadonly configProvider?: IConfigProviderBase | undefined;\n\n\t/**\n\t * Optional property for allowing the container to use a custom\n\t * protocol implementation for handling the quorum and/or the audience.\n\t */\n\treadonly protocolHandlerBuilder?: ProtocolHandlerBuilder | undefined;\n\n\t/**\n\t * Disables the Container from reconnecting if false, allows reconnect otherwise.\n\t */\n\treadonly allowReconnect?: boolean | undefined;\n\n\t/**\n\t * Client details provided in the override will be merged over the default client.\n\t */\n\treadonly clientDetailsOverride?: IClientDetails | undefined;\n}\n\n/**\n * Props used to load a container.\n * @legacy @beta\n */\nexport interface ILoadExistingContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The request to resolve the container.\n\t */\n\treadonly request: IRequest;\n\n\t/**\n\t * Pending local state to be applied to the container.\n\t */\n\treadonly pendingLocalState?: string | undefined;\n}\n\n/**\n * Props used to load summarizer container.\n * @legacy @alpha\n */\nexport type ILoadSummarizerContainerProps = Omit<\n\tILoadExistingContainerProps,\n\t\"pendingLocalState\"\n>;\n\n/**\n * Props used to create a detached container.\n * @legacy @beta\n */\nexport interface ICreateDetachedContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The code details for the container to be created.\n\t */\n\treadonly codeDetails: IFluidCodeDetails;\n}\n\n/**\n * Props used to rehydrate a detached container.\n * @legacy @beta\n */\nexport interface IRehydrateDetachedContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The serialized state returned by calling serialize on another container\n\t */\n\treadonly serializedState: string;\n}\n\n/**\n * Creates a new container using the specified code details but in an unattached state. While unattached, all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n * @param createDetachedContainerProps - Services and properties necessary for creating detached container.\n * @legacy @beta\n */\nexport async function createDetachedContainer(\n\tcreateDetachedContainerProps: ICreateDetachedContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(createDetachedContainerProps);\n\treturn loader.createDetachedContainer(createDetachedContainerProps.codeDetails, {\n\t\tcanReconnect: createDetachedContainerProps.allowReconnect,\n\t\tclientDetailsOverride: createDetachedContainerProps.clientDetailsOverride,\n\t});\n}\n\n/**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached, all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n * @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.\n * @legacy @beta\n */\nexport async function rehydrateDetachedContainer(\n\trehydrateDetachedContainerProps: IRehydrateDetachedContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(rehydrateDetachedContainerProps);\n\treturn loader.rehydrateDetachedContainerFromSnapshot(\n\t\trehydrateDetachedContainerProps.serializedState,\n\t\t{\n\t\t\tcanReconnect: rehydrateDetachedContainerProps.allowReconnect,\n\t\t\tclientDetailsOverride: rehydrateDetachedContainerProps.clientDetailsOverride,\n\t\t},\n\t);\n}\n\n/**\n * Loads a container with an existing snapshot from the service.\n * @param loadExistingContainerProps - Services and properties necessary for loading an existing container.\n * @legacy @beta\n */\nexport async function loadExistingContainer(\n\tloadExistingContainerProps: ILoadExistingContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(loadExistingContainerProps);\n\treturn loader.resolve(\n\t\tloadExistingContainerProps.request,\n\t\tloadExistingContainerProps.pendingLocalState,\n\t);\n}\n\n/**\n * Properties required to load a frozen container from pending state.\n * @legacy @alpha\n */\nexport interface ILoadFrozenContainerFromPendingStateProps\n\textends ILoadExistingContainerProps {\n\t/**\n\t * Pending local state to be applied to the container.\n\t */\n\treadonly pendingLocalState: string;\n\n\t/**\n\t * Controls whether the frozen container is surfaced as read-only.\n\t *\n\t * Defaults to `true`. When `true`, the container reports `readOnlyInfo.readonly === true`\n\t * with `storageOnly === true`, matching the historical behavior of frozen loads.\n\t *\n\t * When `false`, the container loads as writable so the runtime will accept DDS submissions.\n\t * The connection itself stays `Connected`: the connection manager recognizes the synthetic\n\t * frozen delta stream and drops outbound messages at the network layer, so no read→write\n\t * reconnect is attempted. Local DDS state continues to update via optimistic apply, and\n\t * submitted ops accumulate in the runtime's pending-state manager. Use this when callers\n\t * want to accrue and capture pending state without publishing it.\n\t *\n\t * @remarks\n\t * The flag uses negative polarity (`readOnly`) rather than a positive opt-in (`writable`)\n\t * to align with `IContainer.readOnlyInfo.readonly`, which is the established surface for\n\t * read/write state on a loaded container. A future positive-polarity option can layer on\n\t * top of this without breaking callers, but flipping the polarity now would split readers\n\t * between two conventions for the same concept.\n\t *\n\t * Subsystem behavior is unchanged from the read-only frozen path regardless of `readOnly`:\n\t * storage operations still throw (only `readBlob` is supported); summarizer / id-compressor\n\t * never fire because no acks arrive; the quorum is whatever was captured in pending state\n\t * and gains no members during the writable-frozen lifetime. The only behavioral delta is\n\t * that the runtime accepts DDS submissions and accumulates them in `pendingStateManager`.\n\t */\n\treadonly readOnly?: boolean;\n}\n\n/**\n * Loads a frozen container from pending local state.\n * @param props - Properties required to load a frozen container from pending state.\n * @legacy @alpha\n */\nexport async function loadFrozenContainerFromPendingState(\n\tprops: ILoadFrozenContainerFromPendingStateProps,\n): Promise<IContainer> {\n\treturn loadExistingContainer({\n\t\t...props,\n\t\tdocumentServiceFactory: createFrozenDocumentServiceFactory(\n\t\t\tprops.documentServiceFactory,\n\t\t\tprops.readOnly,\n\t\t),\n\t});\n}\n\n/**\n * Properties for {@link captureFullContainerState}.\n * @legacy @alpha\n */\nexport interface ICaptureFullContainerStateProps {\n\t/**\n\t * The url resolver used to resolve the request into a Fluid resolved url.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory used to construct the driver services\n\t * against which the state is captured.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The request identifying the container whose state is to be captured.\n\t */\n\treadonly request: IRequest;\n\t/**\n\t * Optional logger for driver-side telemetry.\n\t */\n\treadonly logger?: ITelemetryBaseLogger | undefined;\n}\n\n/**\n * Captures the current state of an attached container using only driver-level\n * services, without instantiating a runtime or loading a full container. The\n * returned string is a serialized pending container state in the same wire\n * format produced by a live container's pending-state serialization, and can\n * be handed to {@link loadExistingContainer} as `pendingLocalState`.\n *\n * The output is a self-contained view of the container's referenced graph:\n * the latest snapshot, inlined contents of every blob reachable through\n * referenced subtrees, inlined contents of every referenced attachment blob\n * keyed by storage id, and all ops with sequence numbers after the base\n * snapshot's sequence number (as read from its attributes blob).\n *\n * Reachability respects GC. Snapshot subtrees flagged `unreferenced: true`\n * are skipped (their contents are not inlined). Attachment blobs that GC has\n * marked unreferenced, tombstoned, or deleted are skipped. When the snapshot\n * has no GC tree (GC disabled or pre-GC document), no filtering is applied.\n *\n * Blob reads on load hit the `ContainerStorageAdapter` cache populated from\n * the captured `snapshotBlobs` map, so a frozen loader can serve the full\n * referenced graph without a live storage service.\n *\n * `pendingRuntimeState` is `undefined` — no runtime is instantiated — so the\n * output cannot carry DDS-level in-flight changes. It is intended for state\n * relay, inspection, and durable-state snapshot use cases.\n *\n * Containers that declare loading groups are not yet supported: the function\n * throws `UsageError` if any referenced subtree carries a `groupId`. Group\n * snapshots would need a separate prefetch + serialization path; until there\n * is a known consumer and end-to-end coverage, the capture refuses rather\n * than silently producing pending state that omits group data.\n *\n * Note: if a new snapshot lands between the snapshot fetch and the ops fetch,\n * the returned state may not reflect the very latest snapshot, but remains\n * internally consistent: ops are anchored to the snapshot that was captured.\n *\n * No `mixinMonitoringContext` / `configProvider` is wired here, deliberately\n * diverging from the sibling entry points in this file. The function reads\n * no feature flags and instantiates no runtime, so there is nothing for a\n * monitoring context to gate or attribute. If a future change introduces\n * config-gated behavior or runtime-attributed telemetry, add the wiring\n * back together with that change.\n * @legacy @alpha\n */\nexport async function captureFullContainerState({\n\turlResolver,\n\tdocumentServiceFactory,\n\trequest,\n\tlogger,\n}: ICaptureFullContainerStateProps): Promise<string> {\n\tconst resolvedUrl = await urlResolver.resolve(request);\n\tif (resolvedUrl === undefined) {\n\t\tthrow new UsageError(\"Failed to resolve request to a Fluid URL\");\n\t}\n\n\tconst documentService = await documentServiceFactory.createDocumentService(\n\t\tresolvedUrl,\n\t\tlogger,\n\t);\n\ttry {\n\t\tconst storage = await documentService.connectToStorage();\n\n\t\tconst versions = await storage.getVersions(\n\t\t\t// `null` signals \"latest\"\n\t\t\t// eslint-disable-next-line unicorn/no-null\n\t\t\tnull,\n\t\t\t1,\n\t\t\t\"captureFullContainerState\",\n\t\t\tFetchSource.noCache,\n\t\t);\n\t\tconst version = versions[0];\n\t\tconst snapshot: ISnapshot | ISnapshotTree | undefined =\n\t\t\tstorage.getSnapshot === undefined\n\t\t\t\t? ((await storage.getSnapshotTree(version, \"captureFullContainerState\")) ?? undefined)\n\t\t\t\t: await storage.getSnapshot({\n\t\t\t\t\t\tcacheSnapshot: false,\n\t\t\t\t\t\tversionId: version?.id,\n\t\t\t\t\t\tscenarioName: \"captureFullContainerState\",\n\t\t\t\t\t});\n\t\tif (snapshot === undefined) {\n\t\t\tthrow new GenericError(\"Failed to fetch snapshot for captureFullContainerState\");\n\t\t}\n\n\t\tconst baseSnapshot = getSnapshotTree(snapshot);\n\t\tif (snapshotHasLoadingGroups(baseSnapshot)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"captureFullContainerState does not yet support containers with loading groups\",\n\t\t\t);\n\t\t}\n\t\tconst attributes = await getDocumentAttributes(storage, baseSnapshot);\n\t\tconst gcData = await parseGcSnapshotData(baseSnapshot, storage);\n\t\t// Structural snapshot blobs (JSON/text the runtime authored) are\n\t\t// UTF-8-encoded; attachment blobs may carry arbitrary binary bytes\n\t\t// and are base64-encoded. Keep them on separate fields of the\n\t\t// pending state so the load side can apply the matching decoder\n\t\t// without ambiguity. See IPendingContainerState.attachmentBlobContents.\n\t\tconst [snapshotBlobs, attachmentBlobContents] = await Promise.all([\n\t\t\treadReferencedSnapshotBlobs(snapshot, storage), // utf8 encoded\n\t\t\tcaptureReferencedAttachmentBlobs(baseSnapshot, storage, gcData), // base64 encoded\n\t\t]);\n\n\t\tconst deltaStorage = await documentService.connectToDeltaStorage();\n\t\tconst opsStream = deltaStorage.fetchMessages(\n\t\t\tattributes.sequenceNumber + 1,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t\tfalse,\n\t\t\t\"captureFullContainerState\",\n\t\t);\n\t\tconst savedOps: ISequencedDocumentMessage[] = [];\n\t\tconst postSnapshotBlobReferences: IBlobAttachReference[] = [];\n\t\tlet opsResult = await opsStream.read();\n\t\twhile (!opsResult.done) {\n\t\t\tfor (const op of opsResult.value) {\n\t\t\t\tsavedOps.push(op);\n\t\t\t\t// Blobs uploaded after the base snapshot are not in its\n\t\t\t\t// `.blobs` redirect table, so `captureReferencedAttachmentBlobs`\n\t\t\t\t// did not see them. The wire-format BlobAttach op carries\n\t\t\t\t// `(localId, storageId)` in its metadata; collect those here so\n\t\t\t\t// we can backfill the bytes before sealing the artifact.\n\t\t\t\tconst refs = extractBlobAttachReferences(op);\n\t\t\t\tif (refs.length > 0) {\n\t\t\t\t\tpostSnapshotBlobReferences.push(...refs);\n\t\t\t\t}\n\t\t\t}\n\t\t\topsResult = await opsStream.read();\n\t\t}\n\n\t\tif (postSnapshotBlobReferences.length > 0) {\n\t\t\tconst added = await inlineAttachmentBlobsByReference(\n\t\t\t\tpostSnapshotBlobReferences,\n\t\t\t\tstorage,\n\t\t\t\tunreferencedAttachmentBlobLocalIds(gcData),\n\t\t\t\tattachmentBlobContents,\n\t\t\t);\n\t\t\tObject.assign(attachmentBlobContents, added);\n\t\t}\n\n\t\tconst pendingState: IPendingContainerState = {\n\t\t\tattached: true,\n\t\t\tbaseSnapshot,\n\t\t\tsnapshotBlobs,\n\t\t\tattachmentBlobContents:\n\t\t\t\tObject.keys(attachmentBlobContents).length === 0 ? undefined : attachmentBlobContents,\n\t\t\tloadedGroupIdSnapshots: undefined,\n\t\t\tpendingRuntimeState: undefined,\n\t\t\tsavedOps,\n\t\t\turl: resolvedUrl.url,\n\t\t};\n\t\treturn JSON.stringify(pendingState);\n\t} finally {\n\t\tdocumentService.dispose();\n\t}\n}\n\n/**\n * Loads a summarizer container with the required headers, triggers an on-demand summary, and then closes it.\n * Returns success/failure and an optional error for host-side handling.\n *\n * @legacy @alpha\n */\nexport async function loadSummarizerContainerAndMakeSummary(\n\tloadSummarizerContainerProps: ILoadSummarizerContainerProps,\n): Promise<LoadSummarizerSummaryResult> {\n\tlet result = await loadSummarizerContainerAndMakeSummaryInternal(\n\t\tloadSummarizerContainerProps,\n\t);\n\tif (!result.success) {\n\t\t/**\n\t\t * We retry once as there is potential for a race condition when loading a snapshot.\n\t\t * If the newest snapshot is not ready when creating the container but becomes available upon catching up, the container\n\t\t * will be closed so it can load from the new snapshot.\n\t\t */\n\t\tresult = await loadSummarizerContainerAndMakeSummaryInternal(loadSummarizerContainerProps);\n\t}\n\treturn result;\n}\n\nasync function loadSummarizerContainerAndMakeSummaryInternal(\n\tloadSummarizerContainerProps: ILoadSummarizerContainerProps,\n): Promise<LoadSummarizerSummaryResult> {\n\tconst { logger, configProvider, request: originalRequest } = loadSummarizerContainerProps;\n\tconst telemetryProps = {\n\t\tloaderId: uuid(),\n\t\tloaderVersion: pkgVersion,\n\t};\n\n\tconst subMc = mixinMonitoringContext(\n\t\tDebugLogger.mixinDebugLogger(\"fluid:telemetry\", logger, {\n\t\t\tall: telemetryProps,\n\t\t}),\n\t\tsessionStorageConfigProvider.value,\n\t\tconfigProvider,\n\t);\n\tconst mc = createChildMonitoringContext({\n\t\tlogger: subMc.logger,\n\t\tnamespace: \"SummarizerOnDemand\",\n\t});\n\treturn PerformanceEvent.timedExecAsync(\n\t\tmc.logger,\n\t\t{ eventName: \"SummarizerOnDemandSummary\" },\n\t\tasync (event) => {\n\t\t\tconst baseHeaders = originalRequest.headers;\n\t\t\tconst request = {\n\t\t\t\t...originalRequest,\n\t\t\t\theaders: {\n\t\t\t\t\t...baseHeaders,\n\t\t\t\t\t[LoaderHeader.cache]: false,\n\t\t\t\t\t[LoaderHeader.clientDetails]: {\n\t\t\t\t\t\tcapabilities: { interactive: false },\n\t\t\t\t\t\ttype: \"summarizer\",\n\t\t\t\t\t},\n\t\t\t\t\t[DriverHeader.summarizingClient]: true,\n\t\t\t\t\t[LoaderHeader.reconnect]: false,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst container = await loadExistingContainer({\n\t\t\t\t...loadSummarizerContainerProps,\n\t\t\t\trequest,\n\t\t\t});\n\n\t\t\tlet summarySubmitted: SummarizeOnDemandResults[\"summarySubmitted\"];\n\t\t\tlet summaryOpBroadcasted: SummarizeOnDemandResults[\"summaryOpBroadcasted\"];\n\t\t\ttry {\n\t\t\t\tif (container.getEntryPoint === undefined) {\n\t\t\t\t\tthrow new GenericError(\"container.getEntryPoint() is undefined\");\n\t\t\t\t}\n\t\t\t\tconst fluidObject = (await container.getEntryPoint()) as FluidObject<SummarizerLike>;\n\t\t\t\tconst summarizer = fluidObject?.ISummarizer;\n\t\t\t\tif (summarizer === undefined) {\n\t\t\t\t\tthrow new GenericError(\"Summarizer entry point not available\");\n\t\t\t\t}\n\t\t\t\t// Host controlled feature gate for fullTree\n\t\t\t\t// Default value will be false\n\t\t\t\tconst fullTreeGate =\n\t\t\t\t\tmc.config.getBoolean(\"Fluid.Summarizer.FullTree.OnDemand\") === true;\n\n\t\t\t\tconst summarizeResults: OnDemandSummarizeResultsPromises =\n\t\t\t\t\tsummarizer.summarizeOnDemand({\n\t\t\t\t\t\treason: \"summaryOnRequest\",\n\t\t\t\t\t\tretryOnFailure: true,\n\t\t\t\t\t\tfullTree: fullTreeGate,\n\t\t\t\t\t});\n\t\t\t\t[summarySubmitted, summaryOpBroadcasted] = await Promise.all([\n\t\t\t\t\tsummarizeResults.summarySubmitted,\n\t\t\t\t\tsummarizeResults.summaryOpBroadcasted,\n\t\t\t\t]);\n\n\t\t\t\tconst summaryResults: OnDemandSummaryResults = {\n\t\t\t\t\tsummarySubmitted: summarySubmitted.success,\n\t\t\t\t\tsummaryInfo: summarySubmitted.success\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tstage: summarySubmitted.data.stage,\n\t\t\t\t\t\t\t\thandle: summaryOpBroadcasted.success\n\t\t\t\t\t\t\t\t\t? summaryOpBroadcasted.data.summarizeOp.contents.handle\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: {},\n\t\t\t\t\tsummaryOpBroadcasted: summaryOpBroadcasted.success,\n\t\t\t\t};\n\n\t\t\t\tif (summarySubmitted.success && summaryOpBroadcasted.success) {\n\t\t\t\t\tevent.end({\n\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\tsummarySubmitted: true,\n\t\t\t\t\t\tsummaryOpBroadcasted: true,\n\t\t\t\t\t});\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\tsummaryResults,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst failureError =\n\t\t\t\t\tsummarySubmitted.success === false\n\t\t\t\t\t\t? summarySubmitted.error\n\t\t\t\t\t\t: summaryOpBroadcasted.success === false\n\t\t\t\t\t\t\t? summaryOpBroadcasted.error\n\t\t\t\t\t\t\t: new GenericError(\"On demand summary failed\");\n\n\t\t\t\tevent.end({\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\tsummarySubmitted: summarySubmitted.success,\n\t\t\t\t\tsummaryOpBroadcasted: summaryOpBroadcasted.success,\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: failureError,\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\tevent.cancel({ success: false }, error);\n\t\t\t\tconst caughtError = isFluidError(error) ? error : normalizeError(error);\n\t\t\t\treturn { success: false, error: caughtError };\n\t\t\t} finally {\n\t\t\t\tcontainer.dispose();\n\t\t\t}\n\t\t},\n\t\t{ start: true, end: true, cancel: \"generic\" },\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"createAndLoadContainerUtils.js","sourceRoot":"","sources":["../src/createAndLoadContainerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAQ9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAUxE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC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GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YACxE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAC/C,CAAC;gBAAS,CAAC;YACV,SAAS,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC;IACF,CAAC,EACD,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAC7C,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIContainer,\n\tICodeDetailsLoader,\n\tIFluidCodeDetails,\n\tIContainerPolicies,\n} from \"@fluidframework/container-definitions/internal\";\nimport { LoaderHeader } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIConfigProviderBase,\n\tIRequest,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { AllOrNone } from \"@fluidframework/core-interfaces/internal\";\nimport { validateAllOrNone } from \"@fluidframework/core-utils/internal\";\nimport type { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n\tISequencedDocumentMessage,\n\tISnapshot,\n\tISnapshotTree,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { DriverHeader, FetchSource } from \"@fluidframework/driver-definitions/internal\";\nimport { getSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tGenericError,\n\tUsageError,\n\tnormalizeError,\n\tcreateChildMonitoringContext,\n\tmixinMonitoringContext,\n\tsessionStorageConfigProvider,\n\tPerformanceEvent,\n\tisFluidError,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n\tcaptureReferencedAttachmentBlobs,\n\textractBlobAttachReferences,\n\tinlineAttachmentBlobsByReference,\n\tparseGcSnapshotData,\n\treadReferencedSnapshotBlobs,\n\tsnapshotHasLoadingGroups,\n\tunreferencedAttachmentBlobLocalIds,\n\ttype IBlobAttachReference,\n} from \"./captureReferencedContents.js\";\nimport { DebugLogger } from \"./debugLogger.js\";\nimport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nimport { Loader } from \"./loader.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport type { ProtocolHandlerBuilder } from \"./protocol.js\";\nimport type { IPendingContainerState } from \"./serializedStateManager.js\";\nimport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummarizeOnDemandResults,\n} from \"./summarizerResultTypes.js\";\nimport {\n\tgetAttachedContainerStateFromSerializedContainer,\n\tgetDocumentAttributes,\n\ttryParseCompatibleResolvedUrl,\n} from \"./utils.js\";\n\ninterface OnDemandSummarizeResultsPromises {\n\treadonly summarySubmitted: Promise<SummarizeOnDemandResults[\"summarySubmitted\"]>;\n\treadonly summaryOpBroadcasted: Promise<SummarizeOnDemandResults[\"summaryOpBroadcasted\"]>;\n}\n\ninterface OnDemandSummarizeOptions {\n\treadonly reason?: string;\n\treadonly retryOnFailure?: boolean;\n\treadonly fullTree?: boolean;\n}\n\ninterface SummarizerLike {\n\treadonly ISummarizer?: SummarizerLike;\n\tsummarizeOnDemand(options: OnDemandSummarizeOptions): OnDemandSummarizeResultsPromises;\n}\n\n/**\n * Host-level container loader properties — the code loader plus all the\n * optional policy / observability fields that aren't tied to driver wiring.\n *\n * @remarks\n * Extracted as a reusable building block so other props types (create,\n * rehydrate, load, frozen-load) can compose it without duplicating the\n * optional-fields surface.\n *\n * @legacy @beta\n */\nexport interface IContainerHostProps {\n\t/**\n\t * The code loader handles loading the necessary code\n\t * for running a container once it is loaded.\n\t */\n\treadonly codeLoader: ICodeDetailsLoader;\n\n\t/**\n\t * A property bag of options/policies used by various layers\n\t * to control features\n\t */\n\treadonly options?: IContainerPolicies | undefined;\n\n\t/**\n\t * Scope is provided to all container and is a set of shared\n\t * services for container's to integrate with their host environment.\n\t */\n\treadonly scope?: FluidObject | undefined;\n\n\t/**\n\t * The logger that all telemetry should be pushed to.\n\t */\n\treadonly logger?: ITelemetryBaseLogger | undefined;\n\n\t/**\n\t * The configuration provider which may be used to control features.\n\t */\n\treadonly configProvider?: IConfigProviderBase | undefined;\n\n\t/**\n\t * Optional property for allowing the container to use a custom\n\t * protocol implementation for handling the quorum and/or the audience.\n\t */\n\treadonly protocolHandlerBuilder?: ProtocolHandlerBuilder | undefined;\n\n\t/**\n\t * Disables the Container from reconnecting if false, allows reconnect otherwise.\n\t */\n\treadonly allowReconnect?: boolean | undefined;\n\n\t/**\n\t * Client details provided in the override will be merged over the default client.\n\t */\n\treadonly clientDetailsOverride?: IClientDetails | undefined;\n}\n\n/**\n * The driver-services pair — `urlResolver` plus `documentServiceFactory` —\n * required to wire a container to a real driver at create or load time.\n *\n * @remarks\n * Extracted as a reusable building block so the `request` field can be\n * added on top for load-time props (see {@link IContainerLoadDriverProps})\n * while create-time props that don't carry a request can compose just this\n * pair.\n *\n * @legacy @beta\n */\nexport interface IContainerDriverServices {\n\t/**\n\t * The url resolver used by the loader for resolving external urls\n\t * into Fluid urls such that the container specified by the\n\t * external url can be loaded.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory take the Fluid url provided\n\t * by the resolved url and constructs all the necessary services\n\t * for communication with the container's server.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n}\n\n/**\n * The load-time driver wiring trio — `request`, `urlResolver`, and\n * `documentServiceFactory` together.\n *\n * @remarks\n * Reused as the all-or-nothing group for entry points (e.g. the frozen-load\n * entry point) that accept either a full driver wiring (online form) or none\n * of it (offline form). See `AllOrNone` in `@fluidframework/core-interfaces`.\n *\n * @legacy @beta\n */\nexport interface IContainerLoadDriverProps extends IContainerDriverServices {\n\t/**\n\t * The request to resolve the container.\n\t */\n\treadonly request: IRequest;\n}\n\n/**\n * Properties necessary for creating and loading a container.\n *\n * @deprecated\n * Use the composable building blocks instead: extend\n * {@link IContainerHostProps} for the code-loader / policy / observability\n * surface and {@link IContainerDriverServices} for the\n * `urlResolver` / `documentServiceFactory` pair, or compose them inline as\n * `IContainerHostProps & IContainerDriverServices`. This interface is kept\n * as an alias for back-compat and will be removed in a future release.\n *\n * @legacy @beta\n */\nexport interface ICreateAndLoadContainerProps\n\textends IContainerHostProps,\n\t\tIContainerDriverServices {}\n\n/**\n * Props used to load a container.\n * @legacy @beta\n */\nexport interface ILoadExistingContainerProps\n\textends IContainerHostProps,\n\t\tIContainerDriverServices {\n\t/**\n\t * The request to resolve the container.\n\t */\n\treadonly request: IRequest;\n\n\t/**\n\t * Pending local state to be applied to the container.\n\t */\n\treadonly pendingLocalState?: string | undefined;\n}\n\n/**\n * Props used to load summarizer container.\n * @legacy @alpha\n */\nexport type ILoadSummarizerContainerProps = Omit<\n\tILoadExistingContainerProps,\n\t\"pendingLocalState\"\n>;\n\n/**\n * Props used to create a detached container.\n * @legacy @beta\n */\nexport interface ICreateDetachedContainerProps\n\textends IContainerHostProps,\n\t\tIContainerDriverServices {\n\t/**\n\t * The code details for the container to be created.\n\t */\n\treadonly codeDetails: IFluidCodeDetails;\n}\n\n/**\n * Props used to rehydrate a detached container.\n * @legacy @beta\n */\nexport interface IRehydrateDetachedContainerProps\n\textends IContainerHostProps,\n\t\tIContainerDriverServices {\n\t/**\n\t * The serialized state returned by calling serialize on another container\n\t */\n\treadonly serializedState: string;\n}\n\n/**\n * Creates a new container using the specified code details but in an unattached state. While unattached, all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n * @param createDetachedContainerProps - Services and properties necessary for creating detached container.\n * @legacy @beta\n */\nexport async function createDetachedContainer(\n\tcreateDetachedContainerProps: ICreateDetachedContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(createDetachedContainerProps);\n\treturn loader.createDetachedContainer(createDetachedContainerProps.codeDetails, {\n\t\tcanReconnect: createDetachedContainerProps.allowReconnect,\n\t\tclientDetailsOverride: createDetachedContainerProps.clientDetailsOverride,\n\t});\n}\n\n/**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached, all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n * @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.\n * @legacy @beta\n */\nexport async function rehydrateDetachedContainer(\n\trehydrateDetachedContainerProps: IRehydrateDetachedContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(rehydrateDetachedContainerProps);\n\treturn loader.rehydrateDetachedContainerFromSnapshot(\n\t\trehydrateDetachedContainerProps.serializedState,\n\t\t{\n\t\t\tcanReconnect: rehydrateDetachedContainerProps.allowReconnect,\n\t\t\tclientDetailsOverride: rehydrateDetachedContainerProps.clientDetailsOverride,\n\t\t},\n\t);\n}\n\n/**\n * Loads a container with an existing snapshot from the service.\n * @param loadExistingContainerProps - Services and properties necessary for loading an existing container.\n * @legacy @beta\n */\nexport async function loadExistingContainer(\n\tloadExistingContainerProps: ILoadExistingContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(loadExistingContainerProps);\n\treturn loader.resolve(\n\t\tloadExistingContainerProps.request,\n\t\tloadExistingContainerProps.pendingLocalState,\n\t);\n}\n\n/**\n * Properties required to load a frozen container from pending state.\n *\n * @remarks\n * Two forms are supported and selected by the presence of the driver-wiring\n * fields. **Online** form supplies `request`, `urlResolver`, and\n * `documentServiceFactory`; the supplied factory is wrapped in a frozen\n * factory and the resolver is used to re-resolve the request URL just as with\n * {@link loadExistingContainer}. **Offline** form omits all three driver\n * fields; the captured URL stored in `pendingLocalState` is used to\n * synthesize a resolved URL, no real driver is contacted, and\n * `IContainer.getAbsoluteUrl` throws on the returned container because the\n * resolver's external URL format is unknown without a real `IUrlResolver`.\n *\n * **Offline form precondition.** With no driver wiring there is no live\n * storage to read attachment blobs from, so any blob the runtime dereferences\n * during load must already be inlined into `pendingLocalState`. The pending\n * state must therefore be produced by {@link captureFullContainerState}\n * (which inlines all referenced attachment blobs) rather than\n * `IContainer.getPendingLocalState` / `getRequiredPendingLocalState` (which\n * do not). If the runtime needs an attachment blob that is not inlined, the\n * load fails with `UsageError` from the synthesized storage service.\n *\n * **URL shape requirement.** In the offline form the captured\n * `pendingLocalState.url` is the only URL available; it is parsed in place of\n * a real `IUrlResolver.resolve()` call, so it must satisfy\n * {@link tryParseCompatibleResolvedUrl}'s contract — a resolved URL of shape\n * `protocol://<string>/.../..?<querystring>`. This is the format that\n * Fluid-shipped drivers emit; drivers that emit a non-standard resolved-URL\n * shape will surface as a `UsageError` at load time. The online form has no\n * such constraint because the supplied resolver controls URL parsing.\n *\n * The offline form supports `readOnly: false` for the same capture-and-relay\n * use case as the online form: local DDS submissions accrue in the runtime's\n * pending-state manager and can be captured via `getPendingLocalState` for\n * a later online replay. Nothing is published from an offline container.\n *\n * Mixing the two forms (some driver fields supplied, others omitted) is a\n * compile-time error courtesy of the `AllOrNone` modifier from\n * `@fluidframework/core-interfaces`.\n * @legacy @alpha\n */\nexport type ILoadFrozenContainerFromPendingStateProps = IContainerHostProps & {\n\t/**\n\t * Pending local state to be applied to the container.\n\t */\n\treadonly pendingLocalState: string;\n\n\t/**\n\t * Controls whether the frozen container is surfaced as read-only.\n\t *\n\t * Defaults to `true`. When `true`, the container reports `readOnlyInfo.readonly === true`\n\t * with `storageOnly === true`, matching the historical behavior of frozen loads.\n\t *\n\t * When `false`, the container loads as writable so the runtime will accept DDS submissions.\n\t * The connection itself stays `Connected`: the connection manager recognizes the synthetic\n\t * frozen delta stream and drops outbound messages at the network layer, so no read→write\n\t * reconnect is attempted. Local DDS state continues to update via optimistic apply, and\n\t * submitted ops accumulate in the runtime's pending-state manager. Use this when callers\n\t * want to accrue and capture pending state without publishing it.\n\t *\n\t * @remarks\n\t * The flag uses negative polarity (`readOnly`) rather than a positive opt-in (`writable`)\n\t * to align with `IContainer.readOnlyInfo.readonly`, which is the established surface for\n\t * read/write state on a loaded container. A future positive-polarity option can layer on\n\t * top of this without breaking callers, but flipping the polarity now would split readers\n\t * between two conventions for the same concept.\n\t *\n\t * Subsystem behavior is unchanged from the read-only frozen path regardless of `readOnly`:\n\t * storage operations still throw (only `readBlob` is supported); summarizer / id-compressor\n\t * never fire because no acks arrive; the quorum is whatever was captured in pending state\n\t * and gains no members during the writable-frozen lifetime. The only behavioral delta is\n\t * that the runtime accepts DDS submissions and accumulates them in `pendingStateManager`.\n\t */\n\treadonly readOnly?: boolean;\n} & AllOrNone<IContainerLoadDriverProps>;\n\nconst driverPropKeys = [\"request\", \"urlResolver\", \"documentServiceFactory\"] as const;\n\n// Recognizable opaque placeholder used as `request.url` for the offline form of\n// `loadFrozenContainerFromPendingState`. The synthesized `IUrlResolver` ignores\n// its argument and returns a `IResolvedUrl` derived from `pendingLocalState.url`,\n// so this string is never interpreted as a real URL by any downstream stage; it\n// only needs to be a fixed sentinel that won't collide with real request URLs.\nconst offlineFrozenRequestPlaceholderUrl =\n\t\"frozen-load-from-pending-state://offline-placeholder\";\n\n/**\n * Loads a frozen container from pending local state.\n * @param props - Properties required to load a frozen container from pending state.\n * @legacy @alpha\n */\nexport async function loadFrozenContainerFromPendingState(\n\tprops: ILoadFrozenContainerFromPendingStateProps,\n): Promise<IContainer> {\n\tconst fnName = loadFrozenContainerFromPendingState.name;\n\tconst { readOnly, pendingLocalState } = props;\n\n\tconst driverWiring = validateAllOrNone<IContainerLoadDriverProps>(props, driverPropKeys);\n\n\tif (driverWiring === \"mixed\") {\n\t\tthrow new UsageError(\n\t\t\t`${fnName}: ${driverPropKeys.join(\", \")} must all be provided or all omitted`,\n\t\t);\n\t}\n\n\tif (driverWiring === \"none\") {\n\t\t// Offline: synthesize the driver wiring from the URL captured in pending state.\n\t\t// The container's load pipeline is reused unchanged — the synthesized resolver\n\t\t// returns a resolved URL whose `url` equals `pendingLocalState.url`, so the\n\t\t// identity guard in `Loader.resolveCore` is trivially satisfied.\n\t\tconst pending = getAttachedContainerStateFromSerializedContainer(pendingLocalState);\n\t\tconst parsed = tryParseCompatibleResolvedUrl(pending.url);\n\t\tif (parsed === undefined) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`${fnName}: pending state URL is not in a parseable form (${pending.url})`,\n\t\t\t);\n\t\t}\n\t\t// `tryParseCompatibleResolvedUrl` returns `parsed.id` as the first two\n\t\t// path segments joined by `/` (i.e. `tenantId/docId`). Production\n\t\t// resolvers populate `IResolvedUrl.id` with the single doc-id segment\n\t\t// (see `localResolver.ts`, `insecureUrlResolver.ts`,\n\t\t// `routerlicious-urlResolver/urlResolver.ts`, `odspDriverUrlResolver.ts`),\n\t\t// so downstream consumers reading `IContainer.resolvedUrl.id` for\n\t\t// telemetry / cache keys expect the single-segment shape. Take the\n\t\t// trailing segment so offline-loaded containers match that contract.\n\t\tconst parsedIdSegments = parsed.id.split(\"/\");\n\t\tconst synthesizedId = parsedIdSegments[parsedIdSegments.length - 1] ?? parsed.id;\n\t\tconst synthesizedResolvedUrl: IResolvedUrl = {\n\t\t\ttype: \"fluid\",\n\t\t\tid: synthesizedId,\n\t\t\turl: pending.url,\n\t\t\t// `tokens` and `endpoints` are empty because no real driver is contacted; the\n\t\t\t// frozen factory never reads them. A future offline mode that needs them would\n\t\t\t// require carrying them in the pending-state format.\n\t\t\ttokens: {},\n\t\t\tendpoints: {},\n\t\t};\n\t\tconst synthesizedUrlResolver: IUrlResolver = {\n\t\t\t// The argument is ignored: in offline mode the only URL in the system is the\n\t\t\t// one captured in pending state. Any request is mapped to the same resolved URL.\n\t\t\tresolve: async () => synthesizedResolvedUrl,\n\t\t\t// External (request-form) URLs cannot be reconstructed from the captured\n\t\t\t// resolved URL alone, so we cannot honor `getAbsoluteUrl`. Surface the misuse\n\t\t\t// loudly rather than fabricate a string in the wrong format.\n\t\t\tgetAbsoluteUrl: async () => {\n\t\t\t\tthrow new UsageError(`${fnName}: getAbsoluteUrl requires ${driverPropKeys.join(\"/\")}`);\n\t\t\t},\n\t\t};\n\t\treturn loadExistingContainer({\n\t\t\t...props,\n\t\t\t// `request.url` is unused: `synthesizedUrlResolver.resolve()` returns\n\t\t\t// `synthesizedResolvedUrl` regardless of input, and the identity\n\t\t\t// guard in `Loader.resolveCore` compares the resolver's output URL\n\t\t\t// against `pendingLocalState.url` — both equal `pending.url` here.\n\t\t\t// Using a recognizable opaque placeholder instead of the resolved-form\n\t\t\t// URL avoids implying that any downstream stage interprets it as a\n\t\t\t// request-form URL.\n\t\t\trequest: { url: offlineFrozenRequestPlaceholderUrl, headers: {} },\n\t\t\turlResolver: synthesizedUrlResolver,\n\t\t\tdocumentServiceFactory: createFrozenDocumentServiceFactory(undefined, readOnly),\n\t\t});\n\t}\n\n\t// Online: wrap the caller-supplied factory so the live driver only serves blob reads.\n\t// `driverWiring === \"all\"` narrows `props` to the form that carries the driver fields.\n\tconst onlineProps = props as ILoadFrozenContainerFromPendingStateProps &\n\t\tIContainerLoadDriverProps;\n\treturn loadExistingContainer({\n\t\t...onlineProps,\n\t\tdocumentServiceFactory: createFrozenDocumentServiceFactory(\n\t\t\tonlineProps.documentServiceFactory,\n\t\t\treadOnly,\n\t\t),\n\t});\n}\n\n/**\n * Properties for {@link captureFullContainerState}.\n * @legacy @alpha\n */\nexport interface ICaptureFullContainerStateProps {\n\t/**\n\t * The url resolver used to resolve the request into a Fluid resolved url.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory used to construct the driver services\n\t * against which the state is captured.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The request identifying the container whose state is to be captured.\n\t */\n\treadonly request: IRequest;\n\t/**\n\t * Optional logger for driver-side telemetry.\n\t */\n\treadonly logger?: ITelemetryBaseLogger | undefined;\n}\n\n/**\n * Captures the current state of an attached container using only driver-level\n * services, without instantiating a runtime or loading a full container. The\n * returned string is a serialized pending container state in the same wire\n * format produced by a live container's pending-state serialization, and can\n * be handed to {@link loadExistingContainer} as `pendingLocalState`.\n *\n * The output is a self-contained view of the container's referenced graph:\n * the latest snapshot, inlined contents of every blob reachable through\n * referenced subtrees, inlined contents of every referenced attachment blob\n * keyed by storage id, and all ops with sequence numbers after the base\n * snapshot's sequence number (as read from its attributes blob).\n *\n * Reachability respects GC. Snapshot subtrees flagged `unreferenced: true`\n * are skipped (their contents are not inlined). Attachment blobs that GC has\n * marked unreferenced, tombstoned, or deleted are skipped. When the snapshot\n * has no GC tree (GC disabled or pre-GC document), no filtering is applied.\n *\n * Blob reads on load hit the `ContainerStorageAdapter` cache populated from\n * the captured `snapshotBlobs` map, so a frozen loader can serve the full\n * referenced graph without a live storage service.\n *\n * `pendingRuntimeState` is `undefined` — no runtime is instantiated — so the\n * output cannot carry DDS-level in-flight changes. It is intended for state\n * relay, inspection, and durable-state snapshot use cases.\n *\n * Containers that declare loading groups are not yet supported: the function\n * throws `UsageError` if any referenced subtree carries a `groupId`. Group\n * snapshots would need a separate prefetch + serialization path; until there\n * is a known consumer and end-to-end coverage, the capture refuses rather\n * than silently producing pending state that omits group data.\n *\n * Note: if a new snapshot lands between the snapshot fetch and the ops fetch,\n * the returned state may not reflect the very latest snapshot, but remains\n * internally consistent: ops are anchored to the snapshot that was captured.\n *\n * No `mixinMonitoringContext` / `configProvider` is wired here, deliberately\n * diverging from the sibling entry points in this file. The function reads\n * no feature flags and instantiates no runtime, so there is nothing for a\n * monitoring context to gate or attribute. If a future change introduces\n * config-gated behavior or runtime-attributed telemetry, add the wiring\n * back together with that change.\n * @legacy @alpha\n */\nexport async function captureFullContainerState({\n\turlResolver,\n\tdocumentServiceFactory,\n\trequest,\n\tlogger,\n}: ICaptureFullContainerStateProps): Promise<string> {\n\tconst resolvedUrl = await urlResolver.resolve(request);\n\tif (resolvedUrl === undefined) {\n\t\tthrow new UsageError(\"Failed to resolve request to a Fluid URL\");\n\t}\n\n\t// Validate the resolver's URL shape at capture time. The captured pending\n\t// state is rehydrated later (possibly in a different process) via the\n\t// offline form of `loadFrozenContainerFromPendingState`, which requires\n\t// `tryParseCompatibleResolvedUrl` to succeed on `pendingLocalState.url`.\n\t// Failing fast here turns \"your captured artifact silently isn't\n\t// rehydratable\" into a same-call error a partner can act on, instead of\n\t// surfacing as a `UsageError` at offline-load time in a different process.\n\tif (tryParseCompatibleResolvedUrl(resolvedUrl.url) === undefined) {\n\t\tthrow new UsageError(\n\t\t\t`${captureFullContainerState.name}: resolved URL is not in the shape required by tryParseCompatibleResolvedUrl (protocol://<string>/<tenantId>/<docId>?<querystring>); captured state would not rehydrate offline (${resolvedUrl.url})`,\n\t\t);\n\t}\n\n\tconst documentService = await documentServiceFactory.createDocumentService(\n\t\tresolvedUrl,\n\t\tlogger,\n\t);\n\ttry {\n\t\tconst storage = await documentService.connectToStorage();\n\n\t\tconst versions = await storage.getVersions(\n\t\t\t// `null` signals \"latest\"\n\t\t\t// eslint-disable-next-line unicorn/no-null\n\t\t\tnull,\n\t\t\t1,\n\t\t\t\"captureFullContainerState\",\n\t\t\tFetchSource.noCache,\n\t\t);\n\t\tconst version = versions[0];\n\t\tconst snapshot: ISnapshot | ISnapshotTree | undefined =\n\t\t\tstorage.getSnapshot === undefined\n\t\t\t\t? ((await storage.getSnapshotTree(version, \"captureFullContainerState\")) ?? undefined)\n\t\t\t\t: await storage.getSnapshot({\n\t\t\t\t\t\tcacheSnapshot: false,\n\t\t\t\t\t\tversionId: version?.id,\n\t\t\t\t\t\tscenarioName: \"captureFullContainerState\",\n\t\t\t\t\t});\n\t\tif (snapshot === undefined) {\n\t\t\tthrow new GenericError(\"Failed to fetch snapshot for captureFullContainerState\");\n\t\t}\n\n\t\tconst baseSnapshot = getSnapshotTree(snapshot);\n\t\tif (snapshotHasLoadingGroups(baseSnapshot)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"captureFullContainerState does not yet support containers with loading groups\",\n\t\t\t);\n\t\t}\n\t\tconst attributes = await getDocumentAttributes(storage, baseSnapshot);\n\t\tconst gcData = await parseGcSnapshotData(baseSnapshot, storage);\n\t\t// Structural snapshot blobs (JSON/text the runtime authored) are\n\t\t// UTF-8-encoded; attachment blobs may carry arbitrary binary bytes\n\t\t// and are base64-encoded. Keep them on separate fields of the\n\t\t// pending state so the load side can apply the matching decoder\n\t\t// without ambiguity. See IPendingContainerState.attachmentBlobContents.\n\t\tconst [snapshotBlobs, attachmentBlobContents] = await Promise.all([\n\t\t\treadReferencedSnapshotBlobs(snapshot, storage), // utf8 encoded\n\t\t\tcaptureReferencedAttachmentBlobs(baseSnapshot, storage, gcData), // base64 encoded\n\t\t]);\n\n\t\tconst deltaStorage = await documentService.connectToDeltaStorage();\n\t\tconst opsStream = deltaStorage.fetchMessages(\n\t\t\tattributes.sequenceNumber + 1,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t\tfalse,\n\t\t\t\"captureFullContainerState\",\n\t\t);\n\t\tconst savedOps: ISequencedDocumentMessage[] = [];\n\t\tconst postSnapshotBlobReferences: IBlobAttachReference[] = [];\n\t\tlet opsResult = await opsStream.read();\n\t\twhile (!opsResult.done) {\n\t\t\tfor (const op of opsResult.value) {\n\t\t\t\tsavedOps.push(op);\n\t\t\t\t// Blobs uploaded after the base snapshot are not in its\n\t\t\t\t// `.blobs` redirect table, so `captureReferencedAttachmentBlobs`\n\t\t\t\t// did not see them. The wire-format BlobAttach op carries\n\t\t\t\t// `(localId, storageId)` in its metadata; collect those here so\n\t\t\t\t// we can backfill the bytes before sealing the artifact.\n\t\t\t\tconst refs = extractBlobAttachReferences(op);\n\t\t\t\tif (refs.length > 0) {\n\t\t\t\t\tpostSnapshotBlobReferences.push(...refs);\n\t\t\t\t}\n\t\t\t}\n\t\t\topsResult = await opsStream.read();\n\t\t}\n\n\t\tif (postSnapshotBlobReferences.length > 0) {\n\t\t\tconst added = await inlineAttachmentBlobsByReference(\n\t\t\t\tpostSnapshotBlobReferences,\n\t\t\t\tstorage,\n\t\t\t\tunreferencedAttachmentBlobLocalIds(gcData),\n\t\t\t\tattachmentBlobContents,\n\t\t\t);\n\t\t\tObject.assign(attachmentBlobContents, added);\n\t\t}\n\n\t\tconst pendingState: IPendingContainerState = {\n\t\t\tattached: true,\n\t\t\tbaseSnapshot,\n\t\t\tsnapshotBlobs,\n\t\t\tattachmentBlobContents:\n\t\t\t\tObject.keys(attachmentBlobContents).length === 0 ? undefined : attachmentBlobContents,\n\t\t\tloadedGroupIdSnapshots: undefined,\n\t\t\tpendingRuntimeState: undefined,\n\t\t\tsavedOps,\n\t\t\turl: resolvedUrl.url,\n\t\t};\n\t\treturn JSON.stringify(pendingState);\n\t} finally {\n\t\tdocumentService.dispose();\n\t}\n}\n\n/**\n * Loads a summarizer container with the required headers, triggers an on-demand summary, and then closes it.\n * Returns success/failure and an optional error for host-side handling.\n *\n * @legacy @alpha\n */\nexport async function loadSummarizerContainerAndMakeSummary(\n\tloadSummarizerContainerProps: ILoadSummarizerContainerProps,\n): Promise<LoadSummarizerSummaryResult> {\n\tlet result = await loadSummarizerContainerAndMakeSummaryInternal(\n\t\tloadSummarizerContainerProps,\n\t);\n\tif (!result.success) {\n\t\t/**\n\t\t * We retry once as there is potential for a race condition when loading a snapshot.\n\t\t * If the newest snapshot is not ready when creating the container but becomes available upon catching up, the container\n\t\t * will be closed so it can load from the new snapshot.\n\t\t */\n\t\tresult = await loadSummarizerContainerAndMakeSummaryInternal(loadSummarizerContainerProps);\n\t}\n\treturn result;\n}\n\nasync function loadSummarizerContainerAndMakeSummaryInternal(\n\tloadSummarizerContainerProps: ILoadSummarizerContainerProps,\n): Promise<LoadSummarizerSummaryResult> {\n\tconst { logger, configProvider, request: originalRequest } = loadSummarizerContainerProps;\n\tconst telemetryProps = {\n\t\tloaderId: uuid(),\n\t\tloaderVersion: pkgVersion,\n\t};\n\n\tconst subMc = mixinMonitoringContext(\n\t\tDebugLogger.mixinDebugLogger(\"fluid:telemetry\", logger, {\n\t\t\tall: telemetryProps,\n\t\t}),\n\t\tsessionStorageConfigProvider.value,\n\t\tconfigProvider,\n\t);\n\tconst mc = createChildMonitoringContext({\n\t\tlogger: subMc.logger,\n\t\tnamespace: \"SummarizerOnDemand\",\n\t});\n\treturn PerformanceEvent.timedExecAsync(\n\t\tmc.logger,\n\t\t{ eventName: \"SummarizerOnDemandSummary\" },\n\t\tasync (event) => {\n\t\t\tconst baseHeaders = originalRequest.headers;\n\t\t\tconst request = {\n\t\t\t\t...originalRequest,\n\t\t\t\theaders: {\n\t\t\t\t\t...baseHeaders,\n\t\t\t\t\t[LoaderHeader.cache]: false,\n\t\t\t\t\t[LoaderHeader.clientDetails]: {\n\t\t\t\t\t\tcapabilities: { interactive: false },\n\t\t\t\t\t\ttype: \"summarizer\",\n\t\t\t\t\t},\n\t\t\t\t\t[DriverHeader.summarizingClient]: true,\n\t\t\t\t\t[LoaderHeader.reconnect]: false,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst container = await loadExistingContainer({\n\t\t\t\t...loadSummarizerContainerProps,\n\t\t\t\trequest,\n\t\t\t});\n\n\t\t\tlet summarySubmitted: SummarizeOnDemandResults[\"summarySubmitted\"];\n\t\t\tlet summaryOpBroadcasted: SummarizeOnDemandResults[\"summaryOpBroadcasted\"];\n\t\t\ttry {\n\t\t\t\tif (container.getEntryPoint === undefined) {\n\t\t\t\t\tthrow new GenericError(\"container.getEntryPoint() is undefined\");\n\t\t\t\t}\n\t\t\t\tconst fluidObject = (await container.getEntryPoint()) as FluidObject<SummarizerLike>;\n\t\t\t\tconst summarizer = fluidObject?.ISummarizer;\n\t\t\t\tif (summarizer === undefined) {\n\t\t\t\t\tthrow new GenericError(\"Summarizer entry point not available\");\n\t\t\t\t}\n\t\t\t\t// Host controlled feature gate for fullTree\n\t\t\t\t// Default value will be false\n\t\t\t\tconst fullTreeGate =\n\t\t\t\t\tmc.config.getBoolean(\"Fluid.Summarizer.FullTree.OnDemand\") === true;\n\n\t\t\t\tconst summarizeResults: OnDemandSummarizeResultsPromises =\n\t\t\t\t\tsummarizer.summarizeOnDemand({\n\t\t\t\t\t\treason: \"summaryOnRequest\",\n\t\t\t\t\t\tretryOnFailure: true,\n\t\t\t\t\t\tfullTree: fullTreeGate,\n\t\t\t\t\t});\n\t\t\t\t[summarySubmitted, summaryOpBroadcasted] = await Promise.all([\n\t\t\t\t\tsummarizeResults.summarySubmitted,\n\t\t\t\t\tsummarizeResults.summaryOpBroadcasted,\n\t\t\t\t]);\n\n\t\t\t\tconst summaryResults: OnDemandSummaryResults = {\n\t\t\t\t\tsummarySubmitted: summarySubmitted.success,\n\t\t\t\t\tsummaryInfo: summarySubmitted.success\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tstage: summarySubmitted.data.stage,\n\t\t\t\t\t\t\t\thandle: summaryOpBroadcasted.success\n\t\t\t\t\t\t\t\t\t? summaryOpBroadcasted.data.summarizeOp.contents.handle\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: {},\n\t\t\t\t\tsummaryOpBroadcasted: summaryOpBroadcasted.success,\n\t\t\t\t};\n\n\t\t\t\tif (summarySubmitted.success && summaryOpBroadcasted.success) {\n\t\t\t\t\tevent.end({\n\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\tsummarySubmitted: true,\n\t\t\t\t\t\tsummaryOpBroadcasted: true,\n\t\t\t\t\t});\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\tsummaryResults,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst failureError =\n\t\t\t\t\tsummarySubmitted.success === false\n\t\t\t\t\t\t? summarySubmitted.error\n\t\t\t\t\t\t: summaryOpBroadcasted.success === false\n\t\t\t\t\t\t\t? summaryOpBroadcasted.error\n\t\t\t\t\t\t\t: new GenericError(\"On demand summary failed\");\n\n\t\t\t\tevent.end({\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\tsummarySubmitted: summarySubmitted.success,\n\t\t\t\t\tsummaryOpBroadcasted: summaryOpBroadcasted.success,\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: failureError,\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\tevent.cancel({ success: false }, error);\n\t\t\t\tconst caughtError = isFluidError(error) ? error : normalizeError(error);\n\t\t\t\treturn { success: false, error: caughtError };\n\t\t\t} finally {\n\t\t\t\tcontainer.dispose();\n\t\t\t}\n\t\t},\n\t\t{ start: true, end: true, cancel: \"generic\" },\n\t);\n}\n"]}
|
package/lib/debugLogger.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { ITelemetryBaseEvent, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { type
|
|
6
|
+
import { type ITelemetryLoggerPropertyBags, type TelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
7
7
|
/**
|
|
8
8
|
* Implementation of debug logger
|
|
9
9
|
*/
|
|
@@ -18,7 +18,7 @@ export declare class DebugLogger implements ITelemetryBaseLogger {
|
|
|
18
18
|
* @param propertyGetters - Getters to add additional properties to all events
|
|
19
19
|
* @param baseLogger - Base logger to output events (in addition to debug logger being created). Can be undefined.
|
|
20
20
|
*/
|
|
21
|
-
static mixinDebugLogger(namespace: string, baseLogger?: ITelemetryBaseLogger, properties?: ITelemetryLoggerPropertyBags):
|
|
21
|
+
static mixinDebugLogger(namespace: string, baseLogger?: ITelemetryBaseLogger, properties?: ITelemetryLoggerPropertyBags): TelemetryLoggerExt;
|
|
22
22
|
private constructor();
|
|
23
23
|
/**
|
|
24
24
|
* Send an event to debug loggers
|
package/lib/debugLogger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugLogger.d.ts","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EAEpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"debugLogger.d.ts","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EAEpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAIN,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAOlD;;GAEG;AACH,qBAAa,WAAY,YAAW,oBAAoB;IAwCtD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAxC1B;;;;;;;OAOG;WACW,gBAAgB,CAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,oBAAoB,EACjC,UAAU,CAAC,EAAE,4BAA4B,GACvC,kBAAkB;IA0BrB,OAAO;IAKP;;;;OAIG;IACI,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;CA4C7C"}
|
package/lib/debugLogger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugLogger.js","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAM9D,OAAO,
|
|
1
|
+
{"version":3,"file":"debugLogger.js","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAM9D,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,GAGV,MAAM,0CAA0C,CAAC;AAClD,0FAA0F;AAC1F,OAAO,QAAQ,MAAM,OAAO,CAAC;AAG7B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,WAAW;IACvB;;;;;;;OAOG;IACI,MAAM,CAAC,gBAAgB,CAC7B,S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AAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3D,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACf,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACzD,CAAC;QACD,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;QAE/B,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,IAAI,GAAG,QAAQ,UAAU,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC;QAE9C,8FAA8F;QAC9F,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;QACnC,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC;QAE3B,qEAAqE;QACrE,wEAAwE;QACxE,sFAAsF;QACtF,IAAI,OAAe,CAAC;QACpB,IAAI,CAAC;YACJ,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACR,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC;YAC3B,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QAED,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO,GAAG,EAAE,CAAC;QACd,CAAC;QAED,6CAA6C;QAC7C,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,CAAC;QAED,oBAAoB;QACpB,gEAAgE;QAChE,MAAM,CAAC,GAAG,IAAI,IAAI,OAAO,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport type {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tcreateMultiSinkLogger,\n\teventNamespaceSeparator,\n\tformatTick,\n\ttype ITelemetryLoggerPropertyBags,\n\ttype TelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n// This import style is necessary to ensure the emitted JS code works in both CJS and ESM.\nimport debugPkg from \"debug\";\nimport type { IDebugger } from \"debug\";\n\nconst { debug: registerDebug } = debugPkg;\n\n/**\n * Implementation of debug logger\n */\nexport class DebugLogger implements ITelemetryBaseLogger {\n\t/**\n\t * Mix in debug logger with another logger.\n\t * Returned logger will output events to both newly created debug logger, as well as base logger\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t * @param propertyGetters - Getters to add additional properties to all events\n\t * @param baseLogger - Base logger to output events (in addition to debug logger being created). Can be undefined.\n\t */\n\tpublic static mixinDebugLogger(\n\t\tnamespace: string,\n\t\tbaseLogger?: ITelemetryBaseLogger,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t): TelemetryLoggerExt {\n\t\t// Setup base logger upfront, such that host can disable it (if needed)\n\t\tconst debug = registerDebug(namespace);\n\n\t\t// Create one for errors that is always enabled\n\t\t// It can be silenced by replacing console.error if the debug namespace is not enabled.\n\t\tconst debugErr = registerDebug(namespace);\n\t\tdebugErr.log = function (...args: unknown[]): void {\n\t\t\tif (debug.enabled === true) {\n\t\t\t\t// if the namespace is enabled, just use the default logger\n\t\t\t\tregisterDebug.log(...args);\n\t\t\t} else {\n\t\t\t\t// other wise, use the console logger (which could be replaced and silenced)\n\t\t\t\tconsole.error(...args);\n\t\t\t}\n\t\t};\n\t\tdebugErr.enabled = true;\n\n\t\treturn createMultiSinkLogger({\n\t\t\tnamespace,\n\t\t\tloggers: [baseLogger, new DebugLogger(debug, debugErr)],\n\t\t\tproperties,\n\t\t\ttryInheritProperties: true,\n\t\t});\n\t}\n\n\tprivate constructor(\n\t\tprivate readonly debug: IDebugger,\n\t\tprivate readonly debugErr: IDebugger,\n\t) {}\n\n\t/**\n\t * Send an event to debug loggers\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\tconst newEvent: ITelemetryBaseProperties = { ...event };\n\t\tconst isError = newEvent.category === \"error\";\n\t\tlet logger = isError ? this.debugErr : this.debug;\n\n\t\t// Use debug's coloring schema for base of the event\n\t\tconst index = event.eventName.lastIndexOf(eventNamespaceSeparator);\n\t\tconst name = event.eventName.slice(Math.max(0, index + 1));\n\t\tif (index > 0) {\n\t\t\tlogger = logger.extend(event.eventName.slice(0, index));\n\t\t}\n\t\tnewEvent.eventName = undefined;\n\n\t\tlet tick = \"\";\n\t\ttick = `tick=${formatTick(performanceNow())}`;\n\n\t\t// Extract stack to put it last, but also to avoid escaping '\\n' in it by JSON.stringify below\n\t\tconst stack = newEvent.stack ?? \"\";\n\t\tnewEvent.stack = undefined;\n\n\t\t// Watch out for circular references - they can come from two sources\n\t\t// 1) error object - we do not control it and should remove it and retry\n\t\t// 2) properties supplied by telemetry caller - that's a bug that should be addressed!\n\t\tlet payload: string;\n\t\ttry {\n\t\t\tpayload = JSON.stringify(newEvent);\n\t\t} catch {\n\t\t\tnewEvent.error = undefined;\n\t\t\tpayload = JSON.stringify(newEvent);\n\t\t}\n\n\t\tif (payload === \"{}\") {\n\t\t\tpayload = \"\";\n\t\t}\n\n\t\t// Force errors out, to help with diagnostics\n\t\tif (isError) {\n\t\t\tlogger.enabled = true;\n\t\t}\n\n\t\t// Print multi-line.\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tlogger(`${name} ${payload} ${tick} ${stack}`);\n\t}\n}\n"]}
|
package/lib/deltaManager.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { IEventProvider, ITelemetryBaseProperties } from "@fluidframework/c
|
|
|
8
8
|
import type { IThrottlingWarning } from "@fluidframework/core-interfaces/internal";
|
|
9
9
|
import type { ConnectionMode } from "@fluidframework/driver-definitions";
|
|
10
10
|
import { type IDocumentService, type IDocumentMessage, MessageType, type ISequencedDocumentMessage, type ISignalMessage, type IClientDetails, type IClientConfiguration } from "@fluidframework/driver-definitions/internal";
|
|
11
|
-
import { type ITelemetryErrorEventExt, type
|
|
11
|
+
import { EventEmitterWithErrorHandling, type ITelemetryErrorEventExt, type TelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
12
12
|
import type { IConnectionDetailsInternal, IConnectionManager, IConnectionManagerFactoryArgs, IConnectionStateChangeReason } from "./contracts.js";
|
|
13
13
|
export interface IConnectionArgs {
|
|
14
14
|
mode?: ConnectionMode;
|
|
@@ -121,7 +121,7 @@ export declare class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
121
121
|
* @param event - Event to log.
|
|
122
122
|
*/
|
|
123
123
|
logConnectionIssue(event: ITelemetryErrorEventExt): void;
|
|
124
|
-
constructor(serviceProvider: () => IDocumentService | undefined, logger:
|
|
124
|
+
constructor(serviceProvider: () => IDocumentService | undefined, logger: TelemetryLoggerExt, _active: () => boolean, createConnectionManager: (props: IConnectionManagerFactoryArgs) => TConnectionManager);
|
|
125
125
|
private cancelEstablishingConnection;
|
|
126
126
|
private establishingConnection;
|
|
127
127
|
private connectHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltaManager.d.ts","sourceRoot":"","sources":["../src/deltaManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,cAAc,EAEd,wBAAwB,EACxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM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AA+B,GAC1D,OAAO,CAAC,IAAI,CAAC;IAsDT,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;YAyB7B,SAAS;IA6GvB;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,CAAC,EAAE,uBAAuB,GAAG,IAAI;IAWnD;;;;;;;OAOG;IACI,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,uBAAuB,GAAG,IAAI;IAoB7D,OAAO,CAAC,WAAW;IAeZ,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAOzC,OAAO,CAAC,iBAAiB;IAKzB;;;;;OAKG;IACI,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAsBvE,OAAO,CAAC,wBAAwB;IAIhC;;;OAGG;IACH,OAAO,CAAC,uCAAuC;IA4C/C,OAAO,CAAC,eAAe;IA2JvB,OAAO,CAAC,qBAAqB;IAmG7B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAM1B;;OAEG;YACW,sBAAsB;IA8DpC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAiCzB,OAAO,CAAC,4BAA4B;CAKpC"}
|
package/lib/deltaManager.js
CHANGED
|
@@ -6,7 +6,7 @@ import { JsonParse } from "@fluidframework/core-interfaces/internal";
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { DriverErrorTypes, MessageType, } from "@fluidframework/driver-definitions/internal";
|
|
8
8
|
import { NonRetryableError, isRuntimeMessage } from "@fluidframework/driver-utils/internal";
|
|
9
|
-
import { DataCorruptionError, DataProcessingError,
|
|
9
|
+
import { DataCorruptionError, DataProcessingError, EventEmitterWithErrorHandling, extractSafePropertiesFromMessage, isFluidError, normalizeError, safeRaiseEvent, UsageError, } from "@fluidframework/telemetry-utils/internal";
|
|
10
10
|
import { v4 as uuid } from "uuid";
|
|
11
11
|
import { DeltaQueue } from "./deltaQueue.js";
|
|
12
12
|
import { ThrottlingWarning } from "./error.js";
|