@fluidframework/container-loader 2.0.2 → 2.1.0-276326
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/.eslintrc.cjs +2 -5
- package/api-extractor/api-extractor.legacy.json +4 -0
- package/api-report/container-loader.beta.api.md +0 -27
- package/api-report/{container-loader.alpha.api.md → container-loader.legacy.alpha.api.md} +0 -27
- package/api-report/container-loader.public.api.md +0 -27
- package/dist/attachment.d.ts +2 -1
- package/dist/attachment.d.ts.map +1 -1
- package/dist/attachment.js.map +1 -1
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js +4 -4
- package/dist/audience.js.map +1 -1
- package/dist/catchUpMonitor.d.ts +15 -4
- package/dist/catchUpMonitor.d.ts.map +1 -1
- package/dist/catchUpMonitor.js +12 -3
- package/dist/catchUpMonitor.js.map +1 -1
- package/dist/connectionManager.d.ts +24 -8
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +36 -23
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +30 -20
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +15 -11
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +7 -2
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +45 -28
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +8 -4
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +3 -1
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +1 -1
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +12 -6
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +17 -8
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +4 -2
- package/dist/contracts.js.map +1 -1
- package/dist/debugLogger.js +3 -3
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +13 -9
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +32 -23
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaQueue.d.ts +1 -4
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/deltaQueue.js +2 -2
- package/dist/deltaQueue.js.map +1 -1
- package/dist/disposal.d.ts +1 -1
- package/dist/disposal.d.ts.map +1 -1
- package/dist/disposal.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/loadPaused.d.ts +2 -2
- package/dist/loadPaused.d.ts.map +1 -1
- package/dist/loadPaused.js +7 -3
- package/dist/loadPaused.js.map +1 -1
- package/dist/loader.d.ts +10 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +11 -1
- package/dist/loader.js.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +2 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js +3 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/dist/memoryBlobStorage.d.ts.map +1 -1
- package/dist/memoryBlobStorage.js +4 -2
- package/dist/memoryBlobStorage.js.map +1 -1
- package/dist/noopHeuristic.js +1 -1
- package/dist/noopHeuristic.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/protocol/protocol.d.ts +4 -3
- package/dist/protocol/protocol.d.ts.map +1 -1
- package/dist/protocol/protocol.js +6 -5
- package/dist/protocol/protocol.js.map +1 -1
- package/dist/protocol/quorum.d.ts +11 -8
- package/dist/protocol/quorum.d.ts.map +1 -1
- package/dist/protocol/quorum.js +8 -8
- package/dist/protocol/quorum.js.map +1 -1
- package/dist/protocol.d.ts +2 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +7 -2
- package/dist/protocol.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts +2 -2
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +4 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/serializedStateManager.d.ts +29 -12
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js +55 -24
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/utils.d.ts +4 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +15 -6
- package/dist/utils.js.map +1 -1
- package/lib/attachment.d.ts +2 -1
- package/lib/attachment.d.ts.map +1 -1
- package/lib/attachment.js.map +1 -1
- package/lib/audience.d.ts.map +1 -1
- package/lib/audience.js +4 -4
- package/lib/audience.js.map +1 -1
- package/lib/catchUpMonitor.d.ts +15 -4
- package/lib/catchUpMonitor.d.ts.map +1 -1
- package/lib/catchUpMonitor.js +12 -3
- package/lib/catchUpMonitor.js.map +1 -1
- package/lib/connectionManager.d.ts +24 -8
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +36 -23
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +30 -20
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +14 -12
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +7 -2
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +45 -28
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +8 -4
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +3 -1
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +1 -1
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +12 -6
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +17 -8
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js +4 -2
- package/lib/contracts.js.map +1 -1
- package/lib/debugLogger.js +3 -3
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +13 -9
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +32 -23
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaQueue.d.ts +1 -4
- package/lib/deltaQueue.d.ts.map +1 -1
- package/lib/deltaQueue.js +2 -2
- package/lib/deltaQueue.js.map +1 -1
- package/lib/disposal.d.ts +1 -1
- package/lib/disposal.d.ts.map +1 -1
- package/lib/disposal.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/loadPaused.d.ts +2 -2
- package/lib/loadPaused.d.ts.map +1 -1
- package/lib/loadPaused.js +8 -4
- package/lib/loadPaused.js.map +1 -1
- package/lib/loader.d.ts +10 -1
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +11 -1
- package/lib/loader.js.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts +2 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js +3 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/lib/memoryBlobStorage.d.ts.map +1 -1
- package/lib/memoryBlobStorage.js +4 -2
- package/lib/memoryBlobStorage.js.map +1 -1
- package/lib/noopHeuristic.js +1 -1
- package/lib/noopHeuristic.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/protocol/protocol.d.ts +4 -3
- package/lib/protocol/protocol.d.ts.map +1 -1
- package/lib/protocol/protocol.js +6 -5
- package/lib/protocol/protocol.js.map +1 -1
- package/lib/protocol/quorum.d.ts +11 -8
- package/lib/protocol/quorum.d.ts.map +1 -1
- package/lib/protocol/quorum.js +8 -8
- package/lib/protocol/quorum.js.map +1 -1
- package/lib/protocol.d.ts +2 -0
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +7 -2
- package/lib/protocol.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts +2 -2
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +4 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/serializedStateManager.d.ts +29 -12
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js +56 -25
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/utils.d.ts +4 -2
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +16 -7
- package/lib/utils.js.map +1 -1
- package/package.json +21 -17
- package/src/attachment.ts +2 -1
- package/src/audience.ts +4 -4
- package/src/catchUpMonitor.ts +23 -8
- package/src/connectionManager.ts +85 -60
- package/src/connectionStateHandler.ts +85 -63
- package/src/container.ts +118 -84
- package/src/containerContext.ts +5 -3
- package/src/containerStorageAdapter.ts +20 -13
- package/src/contracts.ts +21 -9
- package/src/debugLogger.ts +4 -4
- package/src/deltaManager.ts +75 -56
- package/src/deltaQueue.ts +16 -10
- package/src/disposal.ts +3 -3
- package/src/error.ts +2 -1
- package/src/loadPaused.ts +16 -8
- package/src/loader.ts +20 -2
- package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +7 -3
- package/src/memoryBlobStorage.ts +5 -3
- package/src/noopHeuristic.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/protocol/protocol.ts +12 -11
- package/src/protocol/quorum.ts +49 -40
- package/src/protocol.ts +12 -4
- package/src/protocolTreeDocumentStorageService.ts +3 -2
- package/src/retriableDocumentStorageService.ts +6 -3
- package/src/serializedStateManager.ts +95 -39
- package/src/utils.ts +26 -10
|
@@ -22,9 +22,11 @@ export declare class ContainerContext implements IContainerContext {
|
|
|
22
22
|
readonly quorum: IQuorumClients;
|
|
23
23
|
readonly audience: IAudience;
|
|
24
24
|
readonly loader: ILoader;
|
|
25
|
-
readonly submitFn: (type: MessageType, contents:
|
|
25
|
+
readonly submitFn: (type: MessageType, contents: unknown, batch: boolean, appData: unknown) => number;
|
|
26
26
|
readonly submitSummaryFn: (summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @returns clientSequenceNumber of last message in a batch
|
|
29
|
+
*/
|
|
28
30
|
readonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;
|
|
29
31
|
/**
|
|
30
32
|
* `unknown` should be removed once `@alpha` tag is removed from IContainerContext
|
|
@@ -56,8 +58,10 @@ export declare class ContainerContext implements IContainerContext {
|
|
|
56
58
|
* When false, ops should be kept as pending or rejected
|
|
57
59
|
*/
|
|
58
60
|
get connected(): boolean;
|
|
59
|
-
constructor(options: ILoaderOptions, scope: FluidObject, baseSnapshot: ISnapshotTree | undefined, _version: IVersion | undefined, deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, storage: IDocumentStorageService, quorum: IQuorumClients, audience: IAudience, loader: ILoader, submitFn: (type: MessageType, contents:
|
|
60
|
-
/**
|
|
61
|
+
constructor(options: ILoaderOptions, scope: FluidObject, baseSnapshot: ISnapshotTree | undefined, _version: IVersion | undefined, deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, storage: IDocumentStorageService, quorum: IQuorumClients, audience: IAudience, loader: ILoader, submitFn: (type: MessageType, contents: unknown, batch: boolean, appData: unknown) => number, submitSummaryFn: (summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number,
|
|
62
|
+
/**
|
|
63
|
+
* @returns clientSequenceNumber of last message in a batch
|
|
64
|
+
*/
|
|
61
65
|
submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number,
|
|
62
66
|
/**
|
|
63
67
|
* `unknown` should be removed once `@alpha` tag is removed from IContainerContext
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,aAAa,EACb,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EACN,uBAAuB,EACvB,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E;;GAEG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;aA8BxC,OAAO,EAAE,cAAc;aACvB,KAAK,EAAE,WAAW;aAClB,YAAY,EAAE,aAAa,GAAG,SAAS;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ;aACT,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;aACxE,OAAO,EAAE,uBAAuB;aAChC,MAAM,EAAE,cAAc;aACtB,QAAQ,EAAE,SAAS;aACnB,MAAM,EAAE,OAAO;aACf,QAAQ,EAAE,CACzB,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":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AE,OAAO,EACd,OAAO,EAAE,OAAO,KACZ,MAAM,EACK,eAAe,EAAE,CAChC,SAAS,EAAE,eAAe,EAC1B,uBAAuB,CAAC,EAAE,MAAM,KAC5B,MAAM;IACX;;OAEG;IACa,aAAa,EAAE,CAC9B,KAAK,EAAE,aAAa,EAAE,EACtB,uBAAuB,CAAC,EAAE,MAAM,KAC5B,MAAM;IAEX;;;;OAIG;IACa,cAAc,EAAE,CAC/B,OAAO,EAAE,OAAO,GAAG,eAAe,EAClC,cAAc,CAAC,EAAE,MAAM,KACnB,IAAI,EACO,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,EACpD,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,EAClD,yBAAyB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EACnD,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,EACnE,yBAAyB,EAAE,MAAM,MAAM,GAAG,SAAS,EACnD,YAAY,EAAE,MAAM,MAAM,GAAG,SAAS,EACtC,eAAe,EAAE,MAAM,WAAW,EAClC,aAAa,EAAE,MAAM,OAAO,EAC7B,aAAa,EAAE,cAAc,EAC7B,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,mBAAmB,EACjC,iBAAiB,CAAC,SAAS,EAC3B,oBAAoB,CAAC,uBAAW;IAG1C,oBAAoB,IAAI,QAAQ,GAAG,SAAS;IAInD,IAAW,WAAW,IAAI,WAAW,CAEpC;CACD"}
|
package/dist/containerContext.js
CHANGED
|
@@ -26,7 +26,9 @@ class ContainerContext {
|
|
|
26
26
|
return this._getConnected();
|
|
27
27
|
}
|
|
28
28
|
constructor(options, scope, baseSnapshot, _version, deltaManager, storage, quorum, audience, loader, submitFn, submitSummaryFn,
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @returns clientSequenceNumber of last message in a batch
|
|
31
|
+
*/
|
|
30
32
|
submitBatchFn,
|
|
31
33
|
/**
|
|
32
34
|
* `unknown` should be removed once `@alpha` tag is removed from IContainerContext
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6BH;;GAEG;AACH,MAAa,gBAAgB;IAU5B,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,yBAAyB,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACH,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED,YACiB,OAAuB,EACvB,KAAkB,EAClB,YAAuC,EACtC,QAA8B,EAC/B,YAAwE,EACxE,OAAgC,EAChC,MAAsB,EACtB,QAAmB,EACnB,MAAe,EACf,QAKL,EACK,eAGL;IACX
|
|
1
|
+
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6BH;;GAEG;AACH,MAAa,gBAAgB;IAU5B,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,yBAAyB,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACH,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED,YACiB,OAAuB,EACvB,KAAkB,EAClB,YAAuC,EACtC,QAA8B,EAC/B,YAAwE,EACxE,OAAgC,EAChC,MAAsB,EACtB,QAAmB,EACnB,MAAe,EACf,QAKL,EACK,eAGL;IACX;;OAEG;IACa,aAGL;IAEX;;;;OAIG;IACa,cAGP,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,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACD;AAxFD,4CAwFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tAttachState,\n\tIAudience,\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nimport {\n\tIBatchMessage,\n\tIContainerContext,\n\tILoader,\n\tILoaderOptions,\n\tIDeltaManager,\n} from \"@fluidframework/container-definitions/internal\";\nimport { type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { type ISignalEnvelope } from \"@fluidframework/core-interfaces/internal\";\nimport { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentStorageService,\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext implements IContainerContext {\n\tpublic readonly supportedFeatures: ReadonlyMap<string, unknown> = new Map([\n\t\t/**\n\t\t * This version of the loader accepts `referenceSequenceNumber`, provided by the container runtime,\n\t\t * as a parameter to the `submitBatchFn` and `submitSummaryFn` functions.\n\t\t * This is then used to set the reference sequence numbers of the submitted ops in the DeltaManager.\n\t\t */\n\t\t[\"referenceSequenceNumbers\", true],\n\t]);\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._getClientId();\n\t}\n\n\t/**\n\t * DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.\n\t */\n\tpublic get id(): string {\n\t\treturn this._getContainerDiagnosticId() ?? \"\";\n\t}\n\n\t/**\n\t * When true, ops are free to flow\n\t * When false, ops should be kept as pending or rejected\n\t */\n\tpublic get connected(): boolean {\n\t\treturn this._getConnected();\n\t}\n\n\tconstructor(\n\t\tpublic readonly options: ILoaderOptions,\n\t\tpublic readonly scope: FluidObject,\n\t\tpublic readonly baseSnapshot: ISnapshotTree | undefined,\n\t\tprivate readonly _version: IVersion | undefined,\n\t\tpublic readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tpublic readonly storage: IDocumentStorageService,\n\t\tpublic readonly quorum: IQuorumClients,\n\t\tpublic readonly audience: IAudience,\n\t\tpublic readonly loader: ILoader,\n\t\tpublic readonly submitFn: (\n\t\t\ttype: MessageType,\n\t\t\tcontents: unknown,\n\t\t\tbatch: boolean,\n\t\t\tappData: unknown,\n\t\t) => number,\n\t\tpublic readonly submitSummaryFn: (\n\t\t\tsummaryOp: ISummaryContent,\n\t\t\treferenceSequenceNumber?: number,\n\t\t) => number,\n\t\t/**\n\t\t * @returns clientSequenceNumber of last message in a batch\n\t\t */\n\t\tpublic readonly submitBatchFn: (\n\t\t\tbatch: IBatchMessage[],\n\t\t\treferenceSequenceNumber?: number,\n\t\t) => number,\n\n\t\t/**\n\t\t * `unknown` should be removed once `@alpha` tag is removed from IContainerContext\n\t\t * @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n\t\t * Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s\n\t\t */\n\t\tpublic readonly submitSignalFn: (\n\t\t\tcontent: unknown | ISignalEnvelope,\n\t\t\ttargetClientId?: string,\n\t\t) => void,\n\t\tpublic readonly disposeFn: (error?: ICriticalContainerError) => void,\n\t\tpublic readonly closeFn: (error?: ICriticalContainerError) => void,\n\t\tpublic readonly updateDirtyContainerState: (dirty: boolean) => void,\n\t\tpublic readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>,\n\t\tprivate readonly _getContainerDiagnosticId: () => string | undefined,\n\t\tprivate readonly _getClientId: () => string | undefined,\n\t\tprivate readonly _getAttachState: () => AttachState,\n\t\tprivate readonly _getConnected: () => boolean,\n\t\tpublic readonly clientDetails: IClientDetails,\n\t\tpublic readonly existing: boolean,\n\t\tpublic readonly taggedLogger: ITelemetryLoggerExt,\n\t\tpublic readonly pendingLocalState?: unknown,\n\t\tpublic readonly snapshotWithContents?: ISnapshot,\n\t) {}\n\n\tpublic getLoadedFromVersion(): IVersion | undefined {\n\t\treturn this._version;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._getAttachState();\n\t}\n}\n"]}
|
|
@@ -48,7 +48,7 @@ export declare class ContainerStorageAdapter implements ISerializedStateManagerD
|
|
|
48
48
|
* @param loadingGroupIdSnapshotsFromPendingState - in offline mode, any loading group snapshots we've downloaded from the service that were stored in the pending state
|
|
49
49
|
* @param addProtocolSummaryIfMissing - a callback to permit the container to inspect the summary we're about to
|
|
50
50
|
* upload, and fix it up with a protocol tree if needed
|
|
51
|
-
* @param enableSummarizeProtocolTree
|
|
51
|
+
* @param enableSummarizeProtocolTree - Enable uploading a protocol summary. Note: preference is given to service policy's "summarizeProtocolTree" before this value.
|
|
52
52
|
*/
|
|
53
53
|
constructor(detachedBlobStorage: IDetachedBlobStorage | undefined, logger: ITelemetryLoggerExt,
|
|
54
54
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerStorageAdapter.d.ts","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AA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E,QAAQ,EAClB,YAAY,CAAC,EAAE,MAAM,GAGnB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAInB,WAAW,CAAC,oBAAoB,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAyC7E,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAY9C,WAAW,CAGvB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIT,wBAAwB,CACpC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;IAIL,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAI9D,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAG5E;AA+DD;;GAEG;AACH,wBAAsB,uBAAuB,CAC5C,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,GAChD,OAAO,CAAC,yBAAyB,CAAC,CAIpC;AAoCD;;GAEG;AACH,wBAAgB,uCAAuC,CACtD,QAAQ,EAAE,6BAA6B,GACrC,yBAAyB,CAI3B"}
|
|
@@ -36,7 +36,7 @@ class ContainerStorageAdapter {
|
|
|
36
36
|
* @param loadingGroupIdSnapshotsFromPendingState - in offline mode, any loading group snapshots we've downloaded from the service that were stored in the pending state
|
|
37
37
|
* @param addProtocolSummaryIfMissing - a callback to permit the container to inspect the summary we're about to
|
|
38
38
|
* upload, and fix it up with a protocol tree if needed
|
|
39
|
-
* @param enableSummarizeProtocolTree
|
|
39
|
+
* @param enableSummarizeProtocolTree - Enable uploading a protocol summary. Note: preference is given to service policy's "summarizeProtocolTree" before this value.
|
|
40
40
|
*/
|
|
41
41
|
constructor(
|
|
42
42
|
// eslint-disable-next-line import/no-deprecated
|
|
@@ -101,7 +101,9 @@ class ContainerStorageAdapter {
|
|
|
101
101
|
try {
|
|
102
102
|
return this._storageService.policies;
|
|
103
103
|
}
|
|
104
|
-
catch
|
|
104
|
+
catch {
|
|
105
|
+
// No-op
|
|
106
|
+
}
|
|
105
107
|
return undefined;
|
|
106
108
|
}
|
|
107
109
|
async getSnapshotTree(version, scenarioName) {
|
|
@@ -149,7 +151,10 @@ class ContainerStorageAdapter {
|
|
|
149
151
|
}
|
|
150
152
|
return this._storageService.readBlob(id);
|
|
151
153
|
}
|
|
152
|
-
async getVersions(
|
|
154
|
+
async getVersions(
|
|
155
|
+
// API used below uses null
|
|
156
|
+
// eslint-disable-next-line @rushstack/no-new-null
|
|
157
|
+
versionId, count, scenarioName, fetchSource) {
|
|
153
158
|
return this._storageService.getVersions(versionId, count, scenarioName, fetchSource);
|
|
154
159
|
}
|
|
155
160
|
async uploadSummaryWithContext(summary, context) {
|
|
@@ -174,6 +179,7 @@ class BlobOnlyStorage {
|
|
|
174
179
|
this.detachedStorage = detachedStorage;
|
|
175
180
|
this.logger = logger;
|
|
176
181
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
182
|
+
// eslint-disable-next-line @rushstack/no-new-null
|
|
177
183
|
this.getSnapshotTree = this.notCalled;
|
|
178
184
|
this.getSnapshot = this.notCalled;
|
|
179
185
|
this.getVersions = this.notCalled;
|
|
@@ -204,9 +210,9 @@ class BlobOnlyStorage {
|
|
|
204
210
|
// some browsers may not populate stack unless exception is thrown
|
|
205
211
|
throw new Error("BlobOnlyStorage not implemented method used");
|
|
206
212
|
}
|
|
207
|
-
catch (
|
|
208
|
-
this.logger.sendTelemetryEvent({ eventName: "BlobOnlyStorageWrongCall" },
|
|
209
|
-
throw
|
|
213
|
+
catch (error) {
|
|
214
|
+
this.logger.sendTelemetryEvent({ eventName: "BlobOnlyStorageWrongCall" }, error);
|
|
215
|
+
throw error;
|
|
210
216
|
}
|
|
211
217
|
}
|
|
212
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerStorageAdapter.js","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8E;AAG9E,kEAA6D;AAc7D,oEAAmE;AAKnE,mGAAqF;AACrF,6FAAuF;AAKvF,yCAAkF;AAUlF;;;GAGG;AACH,MAAa,uBAAuB;IASnC;;OAEG;IACH,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,KAAK,IAAI,CAAC;IAC7C,CAAC;IAGD;;OAEG;IACH,IAAW,sBAAsB;QAChC,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACrC,CAAC;IAED;;;;;;;;;OASG;IACH;IACC,gDAAgD;IAChD,mBAAqD,EACpC,MAA2B;IAC5C;;OAEG;IACc,eAA2D,EAAE,EACtE,uCAAkF,EACzE,2BAAwE,EACxE,2BAAgD;QAPhD,WAAM,GAAN,MAAM,CAAqB;QAI3B,iBAAY,GAAZ,YAAY,CAAiD;QACtE,4CAAuC,GAAvC,uCAAuC,CAA2C;QACzE,gCAA2B,GAA3B,2BAA2B,CAA6C;QACxE,gCAA2B,GAA3B,2BAA2B,CAAqB;QA5B1D,4BAAuB,GAA8B,EAAE,CAAC;QAiChE,aAAQ,GAAY,KAAK,CAAC;QAHzB,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC;IAGD,OAAO,CAAC,KAAa;QACpB,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtB,CAAC;IAEM,gBAAgB,CAAC,OAAyB;QAChD,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,YAAY,eAAe,CAAC,EAAE,CAAC;YACxD,OAAO;QACR,CAAC;QAED,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OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC;IACF,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QACtC,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAChF,oDAAoD;QACpD,KAAK,CAAC,EAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;AACF,CAAC;AAED,wDAAwD;AACxD,SAAS,0CAA0C,CAClD,IAAmC,EACnC,KAAgC;IAEhC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;IACtC,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9E,oDAAoD;IACpD,KAAK,CAAC,EAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { ISnapshotTreeWithBlobContents } from \"@fluidframework/container-definitions/internal\";\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISummaryHandle, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tFetchSource,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISummaryContext,\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\n// eslint-disable-next-line import/no-deprecated\nimport { IDetachedBlobStorage } from \"./loader.js\";\nimport { ProtocolTreeStorageService } from \"./protocolTreeDocumentStorageService.js\";\nimport { RetriableDocumentStorageService } from \"./retriableDocumentStorageService.js\";\nimport type {\n\tISerializedStateManagerDocumentStorageService,\n\tISnapshotInfo,\n} from \"./serializedStateManager.js\";\nimport { convertSnapshotInfoToSnapshot, getDocumentAttributes } from \"./utils.js\";\n\n/**\n * Stringified blobs from a summary/snapshot tree.\n * @internal\n */\nexport interface ISerializableBlobContents {\n\t[id: string]: string;\n}\n\n/**\n * This class wraps the actual storage and make sure no wrong apis are called according to\n * container attach state.\n */\nexport class ContainerStorageAdapter\n\timplements\n\t\tISerializedStateManagerDocumentStorageService,\n\t\tIDocumentStorageService,\n\t\tIDisposable\n{\n\tprivate _storageService: IDocumentStorageService & Partial<IDisposable>;\n\n\tprivate _summarizeProtocolTree: boolean | undefined;\n\t/**\n\t * Whether the adapter will enforce sending combined summary trees.\n\t */\n\tpublic get summarizeProtocolTree() {\n\t\treturn this._summarizeProtocolTree === true;\n\t}\n\n\tprivate _loadedGroupIdSnapshots: Record<string, ISnapshot> = {};\n\t/**\n\t * Any loading group id (virtualized) snapshot download from storage will be stored here.\n\t */\n\tpublic get loadedGroupIdSnapshots(): Record<string, ISnapshot> {\n\t\treturn this._loadedGroupIdSnapshots;\n\t}\n\n\t/**\n\t * An adapter that ensures we're using detachedBlobStorage up until we connect to a real service, and then\n\t * after connecting to a real service augments it with retry and combined summary tree enforcement.\n\t * @param detachedBlobStorage - The detached blob storage to use up until we connect to a real service\n\t * @param logger - Telemetry logger\n\t * @param loadingGroupIdSnapshotsFromPendingState - in offline mode, any loading group snapshots we've downloaded from the service that were stored in the pending state\n\t * @param addProtocolSummaryIfMissing - a callback to permit the container to inspect the summary we're about to\n\t * upload, and fix it up with a protocol tree if needed\n\t * @param enableSummarizeProtocolTree - Enable uploading a protocol summary. Note: preference is given to service policy's \"summarizeProtocolTree\" before this value.\n\t */\n\tpublic constructor(\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tdetachedBlobStorage: IDetachedBlobStorage | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\t/**\n\t\t * ArrayBufferLikes or utf8 encoded strings, containing blobs from a snapshot\n\t\t */\n\t\tprivate readonly blobContents: { [id: string]: ArrayBufferLike | string } = {},\n\t\tprivate loadingGroupIdSnapshotsFromPendingState: Record<string, ISnapshotInfo> | undefined,\n\t\tprivate readonly addProtocolSummaryIfMissing: (summaryTree: ISummaryTree) => ISummaryTree,\n\t\tprivate readonly enableSummarizeProtocolTree: boolean | undefined,\n\t) {\n\t\tthis._storageService = new BlobOnlyStorage(detachedBlobStorage, logger);\n\t}\n\n\tdisposed: boolean = false;\n\tdispose(error?: Error): void {\n\t\tthis._storageService?.dispose?.(error);\n\t\tthis.disposed = true;\n\t}\n\n\tpublic connectToService(service: IDocumentService): void {\n\t\tif (!(this._storageService instanceof BlobOnlyStorage)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst storageServiceP = service.connectToStorage();\n\t\tconst retriableStorage = (this._storageService = new RetriableDocumentStorageService(\n\t\t\tstorageServiceP,\n\t\t\tthis.logger,\n\t\t));\n\n\t\t// A storage service wrapper which intercept calls to uploadSummaryWithContext and ensure they include\n\t\t// the protocol summary, provided single-commit summary is enabled.\n\t\tthis._storageService = new ProtocolTreeStorageService(\n\t\t\tretriableStorage,\n\t\t\t(...props) => {\n\t\t\t\tthis.logger.sendTelemetryEvent({ eventName: \"summarizeProtocolTreeEnabled\" });\n\t\t\t\treturn this.addProtocolSummaryIfMissing(...props);\n\t\t\t},\n\t\t\t// A callback to ensure we fetch the most updated value of service.policies.summarizeProtocolTree, which could be set\n\t\t\t// based on the response received from the service after connection is established.\n\t\t\t() => {\n\t\t\t\t// Determine whether or not container should upload the protocol summary along with the summary.\n\t\t\t\t// This is determined based on what value is set for serve policy's summariProtocolTree value or the enableSummarizeProtocolTree\n\t\t\t\t// retrievd from the loader options or monitoring context config.\n\t\t\t\tconst shouldSummarizeProtocolTree =\n\t\t\t\t\tservice.policies?.summarizeProtocolTree ?? this.enableSummarizeProtocolTree ?? false;\n\n\t\t\t\tif (this._summarizeProtocolTree !== shouldSummarizeProtocolTree) {\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"isSummarizeProtocolTreeEnabled\",\n\t\t\t\t\t\tdetails: { value: shouldSummarizeProtocolTree },\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis._summarizeProtocolTree = shouldSummarizeProtocolTree;\n\t\t\t\treturn this._summarizeProtocolTree;\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic loadSnapshotFromSnapshotBlobs(snapshotBlobs: ISerializableBlobContents) {\n\t\tfor (const [id, value] of Object.entries(snapshotBlobs)) {\n\t\t\tthis.blobContents[id] = value;\n\t\t}\n\t}\n\n\tpublic clearPendingState() {\n\t\tthis.loadingGroupIdSnapshotsFromPendingState = undefined;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\t// back-compat 0.40 containerRuntime requests policies even in detached container if storage is present\n\t\t// and storage is always present in >=0.41.\n\t\ttry {\n\t\t\treturn this._storageService.policies;\n\t\t} catch (e) {}\n\t\treturn undefined;\n\t}\n\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this._storageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tlet snapshot: ISnapshot;\n\t\tif (\n\t\t\tthis.loadingGroupIdSnapshotsFromPendingState !== undefined &&\n\t\t\tsnapshotFetchOptions?.loadingGroupIds !== undefined\n\t\t) {\n\t\t\tconst localSnapshot =\n\t\t\t\tthis.loadingGroupIdSnapshotsFromPendingState[snapshotFetchOptions.loadingGroupIds[0]];\n\t\t\tassert(localSnapshot !== undefined, 0x970 /* Local snapshot must be present */);\n\t\t\tconst attributes = await getDocumentAttributes(this, localSnapshot.baseSnapshot);\n\t\t\tsnapshot = convertSnapshotInfoToSnapshot(localSnapshot, attributes.sequenceNumber);\n\t\t} else {\n\t\t\tif (this._storageService.getSnapshot === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"getSnapshot api should exist in internal storage in ContainerStorageAdapter\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tsnapshot = await this._storageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\n\t\t// Track the latest snapshot for each loading group id\n\t\tconst loadingGroupIds = snapshotFetchOptions?.loadingGroupIds;\n\t\tassert(\n\t\t\tsnapshot.sequenceNumber !== undefined,\n\t\t\t0x971 /* Snapshot must have sequence number */,\n\t\t);\n\t\tif (loadingGroupIds !== undefined) {\n\t\t\tfor (const loadingGroupId of loadingGroupIds) {\n\t\t\t\t// Do we actually want to update the stored snapshot?\n\t\t\t\t// What if the incoming snapshot is way newer than the stored snapshot?\n\t\t\t\t// We only want to update the stored snapshot if the incoming snapshot is newer (stored sequence number < incoming sequence number)\n\t\t\t\tconst storedSeqNum =\n\t\t\t\t\tthis._loadedGroupIdSnapshots[loadingGroupId]?.sequenceNumber ?? -1;\n\t\t\t\tif (storedSeqNum < snapshot.sequenceNumber) {\n\t\t\t\t\tthis._loadedGroupIdSnapshots[loadingGroupId] = snapshot;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn snapshot;\n\t}\n\n\tpublic async readBlob(id: string): Promise<ArrayBufferLike> {\n\t\tconst maybeBlob = this.blobContents[id];\n\t\tif (maybeBlob !== undefined) {\n\t\t\tif (typeof maybeBlob === \"string\") {\n\t\t\t\tconst blob = stringToBuffer(maybeBlob, \"utf8\");\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t\treturn maybeBlob;\n\t\t}\n\t\treturn this._storageService.readBlob(id);\n\t}\n\n\tpublic async getVersions(\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this._storageService.getVersions(versionId, count, scenarioName, fetchSource);\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this._storageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this._storageService.downloadSummary(handle);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this._storageService.createBlob(file);\n\t}\n}\n\n/**\n * Storage which only supports createBlob() and readBlob(). This is used with IDetachedBlobStorage to support\n * blobs in detached containers.\n */\nclass BlobOnlyStorage implements IDocumentStorageService {\n\tconstructor(\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tprivate readonly detachedStorage: IDetachedBlobStorage | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {}\n\n\tpublic async createBlob(content: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.verifyStorage().createBlob(content);\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.verifyStorage().readBlob(blobId);\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate verifyStorage(): IDetachedBlobStorage {\n\t\tif (this.detachedStorage === undefined) {\n\t\t\tthrow new UsageError(\"Real storage calls not allowed in Unattached container\");\n\t\t}\n\t\treturn this.detachedStorage;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\treturn this.notCalled();\n\t}\n\n\t/* eslint-disable @typescript-eslint/unbound-method */\n\tpublic getSnapshotTree: () => Promise<ISnapshotTree | null> = this.notCalled;\n\tpublic getSnapshot: () => Promise<ISnapshot> = this.notCalled;\n\tpublic getVersions: () => Promise<IVersion[]> = this.notCalled;\n\tpublic write: () => Promise<IVersion> = this.notCalled;\n\tpublic uploadSummaryWithContext: () => Promise<string> = this.notCalled;\n\tpublic downloadSummary: () => Promise<ISummaryTree> = this.notCalled;\n\t/* eslint-enable @typescript-eslint/unbound-method */\n\n\tprivate notCalled(): never {\n\t\tthis.verifyStorage();\n\t\ttry {\n\t\t\t// some browsers may not populate stack unless exception is thrown\n\t\t\tthrow new Error(\"BlobOnlyStorage not implemented method used\");\n\t\t} catch (err) {\n\t\t\tthis.logger.sendTelemetryEvent({ eventName: \"BlobOnlyStorageWrongCall\" }, err);\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\n// runtime will write a tree to the summary containing \"attachment\" type entries\n// which reference attachment blobs by ID, along with a blob containing the blob redirect table.\n// However, some drivers do not support the \"attachment\" type and will convert them to \"blob\" type\n// entries. We want to avoid saving these to reduce the size of stashed change blobs, but we\n// need to make sure the blob redirect table is saved.\nconst blobsTreeName = \".blobs\";\nconst redirectTableBlobName = \".redirectTable\";\n\n/**\n * Get blob contents of a snapshot tree from storage (or, ideally, cache)\n */\nexport async function getBlobContentsFromTree(\n\tsnapshot: ISnapshotTree,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<ISerializableBlobContents> {\n\tconst blobs = {};\n\tawait getBlobContentsFromTreeCore(snapshot, blobs, storage);\n\treturn blobs;\n}\n\nasync function getBlobContentsFromTreeCore(\n\ttree: ISnapshotTree,\n\tblobs: ISerializableBlobContents,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n\troot = true,\n) {\n\tconst treePs: Promise<any>[] = [];\n\tfor (const [key, subTree] of Object.entries(tree.trees)) {\n\t\tif (root && key === blobsTreeName) {\n\t\t\ttreePs.push(getBlobManagerTreeFromTree(subTree, blobs, storage));\n\t\t} else {\n\t\t\ttreePs.push(getBlobContentsFromTreeCore(subTree, blobs, storage, false));\n\t\t}\n\t}\n\tfor (const id of Object.values(tree.blobs)) {\n\t\tconst blob = await storage.readBlob(id);\n\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\tblobs[id] = bufferToString(blob, \"utf8\");\n\t}\n\treturn Promise.all(treePs);\n}\n\n// save redirect table from .blobs tree but nothing else\nasync function getBlobManagerTreeFromTree(\n\ttree: ISnapshotTree,\n\tblobs: ISerializableBlobContents,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n) {\n\tconst id = tree.blobs[redirectTableBlobName];\n\tconst blob = await storage.readBlob(id);\n\t// ArrayBufferLike will not survive JSON.stringify()\n\tblobs[id] = bufferToString(blob, \"utf8\");\n}\n\n/**\n * Extract blob contents from a snapshot tree with blob contents\n */\nexport function getBlobContentsFromTreeWithBlobContents(\n\tsnapshot: ISnapshotTreeWithBlobContents,\n): ISerializableBlobContents {\n\tconst blobs = {};\n\tgetBlobContentsFromTreeWithBlobContentsCore(snapshot, blobs);\n\treturn blobs;\n}\n\nfunction getBlobContentsFromTreeWithBlobContentsCore(\n\ttree: ISnapshotTreeWithBlobContents,\n\tblobs: ISerializableBlobContents,\n\troot = true,\n) {\n\tfor (const [key, subTree] of Object.entries(tree.trees)) {\n\t\tif (root && key === blobsTreeName) {\n\t\t\tgetBlobManagerTreeFromTreeWithBlobContents(subTree, blobs);\n\t\t} else {\n\t\t\tgetBlobContentsFromTreeWithBlobContentsCore(subTree, blobs, false);\n\t\t}\n\t}\n\tfor (const id of Object.values(tree.blobs)) {\n\t\tconst blob = tree.blobsContents?.[id];\n\t\tassert(blob !== undefined, 0x2ec /* \"Blob must be present in blobsContents\" */);\n\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\tblobs[id] = bufferToString(blob, \"utf8\");\n\t}\n}\n\n// save redirect table from .blobs tree but nothing else\nfunction getBlobManagerTreeFromTreeWithBlobContents(\n\ttree: ISnapshotTreeWithBlobContents,\n\tblobs: ISerializableBlobContents,\n) {\n\tconst id = tree.blobs[redirectTableBlobName];\n\tconst blob = tree.blobsContents?.[id];\n\tassert(blob !== undefined, 0x70f /* Blob must be present in blobsContents */);\n\t// ArrayBufferLike will not survive JSON.stringify()\n\tblobs[id] = bufferToString(blob, \"utf8\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"containerStorageAdapter.js","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8E;AAG9E,kEAA6D;AAc7D,oEAAmE;AAKnE,mGAAqF;AACrF,6FAAuF;AAKvF,yCAAkF;AAUlF;;;GAGG;AACH,MAAa,uBAAuB;IASnC;;OAEG;IACH,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,KAAK,IAAI,CAAC;IAC7C,CAAC;IAGD;;OAEG;IACH,IAAW,sBAAsB;QAChC,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACrC,CAAC;IAED;;;;;;;;;OASG;IACH;IACC,gDAAgD;IAChD,mBAAqD,EACpC,MAA2B;IAC5C;;OAEG;IACc,eAA2D,EAAE,EACtE,uCAAkF,EACzE,2BAAwE,EACxE,2BAAgD;QAPhD,WAAM,GAAN,MAAM,CAAqB;QAI3B,iBAAY,GAAZ,YAAY,CAAiD;QACtE,4CAAuC,GAAvC,uCAAuC,CAA2C;QACzE,gCAA2B,GAA3B,2BAA2B,CAA6C;QACxE,gCAA2B,GAA3B,2BAA2B,CAAqB;QA5B1D,4BAAuB,GAA8B,EAAE,CAAC;QAiChE,aAAQ,GAAY,KAAK,CAAC;QAHzB,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC;IAGD,OAAO,CAAC,KAAa;QACpB,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,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,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,IAAI,IAAI,IAAI,GAAG,KAAK,aAAa,EAAE,CAAC;YACnC,0CAA0C,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC5D,CAAC;aAAM,CAAC;YACP,2CAA2C,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC;IACF,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QACtC,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAChF,oDAAoD;QACpD,KAAK,CAAC,EAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;AACF,CAAC;AAED,wDAAwD;AACxD,SAAS,0CAA0C,CAClD,IAAmC,EACnC,KAAgC;IAEhC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;IACtC,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9E,oDAAoD;IACpD,KAAK,CAAC,EAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { ISnapshotTreeWithBlobContents } from \"@fluidframework/container-definitions/internal\";\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISummaryHandle, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tFetchSource,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISummaryContext,\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\n// eslint-disable-next-line import/no-deprecated\nimport { IDetachedBlobStorage } from \"./loader.js\";\nimport { ProtocolTreeStorageService } from \"./protocolTreeDocumentStorageService.js\";\nimport { RetriableDocumentStorageService } from \"./retriableDocumentStorageService.js\";\nimport type {\n\tISerializedStateManagerDocumentStorageService,\n\tISnapshotInfo,\n} from \"./serializedStateManager.js\";\nimport { convertSnapshotInfoToSnapshot, getDocumentAttributes } from \"./utils.js\";\n\n/**\n * Stringified blobs from a summary/snapshot tree.\n * @internal\n */\nexport interface ISerializableBlobContents {\n\t[id: string]: string;\n}\n\n/**\n * This class wraps the actual storage and make sure no wrong apis are called according to\n * container attach state.\n */\nexport class ContainerStorageAdapter\n\timplements\n\t\tISerializedStateManagerDocumentStorageService,\n\t\tIDocumentStorageService,\n\t\tIDisposable\n{\n\tprivate _storageService: IDocumentStorageService & Partial<IDisposable>;\n\n\tprivate _summarizeProtocolTree: boolean | undefined;\n\t/**\n\t * Whether the adapter will enforce sending combined summary trees.\n\t */\n\tpublic get summarizeProtocolTree(): boolean {\n\t\treturn this._summarizeProtocolTree === true;\n\t}\n\n\tprivate _loadedGroupIdSnapshots: Record<string, ISnapshot> = {};\n\t/**\n\t * Any loading group id (virtualized) snapshot download from storage will be stored here.\n\t */\n\tpublic get loadedGroupIdSnapshots(): Record<string, ISnapshot> {\n\t\treturn this._loadedGroupIdSnapshots;\n\t}\n\n\t/**\n\t * An adapter that ensures we're using detachedBlobStorage up until we connect to a real service, and then\n\t * after connecting to a real service augments it with retry and combined summary tree enforcement.\n\t * @param detachedBlobStorage - The detached blob storage to use up until we connect to a real service\n\t * @param logger - Telemetry logger\n\t * @param loadingGroupIdSnapshotsFromPendingState - in offline mode, any loading group snapshots we've downloaded from the service that were stored in the pending state\n\t * @param addProtocolSummaryIfMissing - a callback to permit the container to inspect the summary we're about to\n\t * upload, and fix it up with a protocol tree if needed\n\t * @param enableSummarizeProtocolTree - Enable uploading a protocol summary. Note: preference is given to service policy's \"summarizeProtocolTree\" before this value.\n\t */\n\tpublic constructor(\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tdetachedBlobStorage: IDetachedBlobStorage | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\t/**\n\t\t * ArrayBufferLikes or utf8 encoded strings, containing blobs from a snapshot\n\t\t */\n\t\tprivate readonly blobContents: { [id: string]: ArrayBufferLike | string } = {},\n\t\tprivate loadingGroupIdSnapshotsFromPendingState: Record<string, ISnapshotInfo> | undefined,\n\t\tprivate readonly addProtocolSummaryIfMissing: (summaryTree: ISummaryTree) => ISummaryTree,\n\t\tprivate readonly enableSummarizeProtocolTree: boolean | undefined,\n\t) {\n\t\tthis._storageService = new BlobOnlyStorage(detachedBlobStorage, logger);\n\t}\n\n\tdisposed: boolean = false;\n\tdispose(error?: Error): void {\n\t\tthis._storageService?.dispose?.(error);\n\t\tthis.disposed = true;\n\t}\n\n\tpublic connectToService(service: IDocumentService): void {\n\t\tif (!(this._storageService instanceof BlobOnlyStorage)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst storageServiceP = service.connectToStorage();\n\t\tconst retriableStorage = (this._storageService = new RetriableDocumentStorageService(\n\t\t\tstorageServiceP,\n\t\t\tthis.logger,\n\t\t));\n\n\t\t// A storage service wrapper which intercept calls to uploadSummaryWithContext and ensure they include\n\t\t// the protocol summary, provided single-commit summary is enabled.\n\t\tthis._storageService = new ProtocolTreeStorageService(\n\t\t\tretriableStorage,\n\t\t\t(...props) => {\n\t\t\t\tthis.logger.sendTelemetryEvent({ eventName: \"summarizeProtocolTreeEnabled\" });\n\t\t\t\treturn this.addProtocolSummaryIfMissing(...props);\n\t\t\t},\n\t\t\t// A callback to ensure we fetch the most updated value of service.policies.summarizeProtocolTree, which could be set\n\t\t\t// based on the response received from the service after connection is established.\n\t\t\t() => {\n\t\t\t\t// Determine whether or not container should upload the protocol summary along with the summary.\n\t\t\t\t// This is determined based on what value is set for serve policy's summariProtocolTree value or the enableSummarizeProtocolTree\n\t\t\t\t// retrievd from the loader options or monitoring context config.\n\t\t\t\tconst shouldSummarizeProtocolTree =\n\t\t\t\t\tservice.policies?.summarizeProtocolTree ?? this.enableSummarizeProtocolTree ?? false;\n\n\t\t\t\tif (this._summarizeProtocolTree !== shouldSummarizeProtocolTree) {\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"isSummarizeProtocolTreeEnabled\",\n\t\t\t\t\t\tdetails: { value: shouldSummarizeProtocolTree },\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis._summarizeProtocolTree = shouldSummarizeProtocolTree;\n\t\t\t\treturn this._summarizeProtocolTree;\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic loadSnapshotFromSnapshotBlobs(snapshotBlobs: ISerializableBlobContents): void {\n\t\tfor (const [id, value] of Object.entries(snapshotBlobs)) {\n\t\t\tthis.blobContents[id] = value;\n\t\t}\n\t}\n\n\tpublic clearPendingState(): void {\n\t\tthis.loadingGroupIdSnapshotsFromPendingState = undefined;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\t// back-compat 0.40 containerRuntime requests policies even in detached container if storage is present\n\t\t// and storage is always present in >=0.41.\n\t\ttry {\n\t\t\treturn this._storageService.policies;\n\t\t} catch {\n\t\t\t// No-op\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t\t// API called below uses null\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this._storageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tlet snapshot: ISnapshot;\n\t\tif (\n\t\t\tthis.loadingGroupIdSnapshotsFromPendingState !== undefined &&\n\t\t\tsnapshotFetchOptions?.loadingGroupIds !== undefined\n\t\t) {\n\t\t\tconst localSnapshot =\n\t\t\t\tthis.loadingGroupIdSnapshotsFromPendingState[snapshotFetchOptions.loadingGroupIds[0]];\n\t\t\tassert(localSnapshot !== undefined, 0x970 /* Local snapshot must be present */);\n\t\t\tconst attributes = await getDocumentAttributes(this, localSnapshot.baseSnapshot);\n\t\t\tsnapshot = convertSnapshotInfoToSnapshot(localSnapshot, attributes.sequenceNumber);\n\t\t} else {\n\t\t\tif (this._storageService.getSnapshot === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"getSnapshot api should exist in internal storage in ContainerStorageAdapter\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tsnapshot = await this._storageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\n\t\t// Track the latest snapshot for each loading group id\n\t\tconst loadingGroupIds = snapshotFetchOptions?.loadingGroupIds;\n\t\tassert(\n\t\t\tsnapshot.sequenceNumber !== undefined,\n\t\t\t0x971 /* Snapshot must have sequence number */,\n\t\t);\n\t\tif (loadingGroupIds !== undefined) {\n\t\t\tfor (const loadingGroupId of loadingGroupIds) {\n\t\t\t\t// Do we actually want to update the stored snapshot?\n\t\t\t\t// What if the incoming snapshot is way newer than the stored snapshot?\n\t\t\t\t// We only want to update the stored snapshot if the incoming snapshot is newer (stored sequence number < incoming sequence number)\n\t\t\t\tconst storedSeqNum =\n\t\t\t\t\tthis._loadedGroupIdSnapshots[loadingGroupId]?.sequenceNumber ?? -1;\n\t\t\t\tif (storedSeqNum < snapshot.sequenceNumber) {\n\t\t\t\t\tthis._loadedGroupIdSnapshots[loadingGroupId] = snapshot;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn snapshot;\n\t}\n\n\tpublic async readBlob(id: string): Promise<ArrayBufferLike> {\n\t\tconst maybeBlob = this.blobContents[id];\n\t\tif (maybeBlob !== undefined) {\n\t\t\tif (typeof maybeBlob === \"string\") {\n\t\t\t\tconst blob = stringToBuffer(maybeBlob, \"utf8\");\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t\treturn maybeBlob;\n\t\t}\n\t\treturn this._storageService.readBlob(id);\n\t}\n\n\tpublic async getVersions(\n\t\t// API used below uses null\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this._storageService.getVersions(versionId, count, scenarioName, fetchSource);\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this._storageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this._storageService.downloadSummary(handle);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this._storageService.createBlob(file);\n\t}\n}\n\n/**\n * Storage which only supports createBlob() and readBlob(). This is used with IDetachedBlobStorage to support\n * blobs in detached containers.\n */\nclass BlobOnlyStorage implements IDocumentStorageService {\n\tconstructor(\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tprivate readonly detachedStorage: IDetachedBlobStorage | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {}\n\n\tpublic async createBlob(content: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.verifyStorage().createBlob(content);\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.verifyStorage().readBlob(blobId);\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate verifyStorage(): IDetachedBlobStorage {\n\t\tif (this.detachedStorage === undefined) {\n\t\t\tthrow new UsageError(\"Real storage calls not allowed in Unattached container\");\n\t\t}\n\t\treturn this.detachedStorage;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\treturn this.notCalled();\n\t}\n\n\t/* eslint-disable @typescript-eslint/unbound-method */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic getSnapshotTree: () => Promise<ISnapshotTree | null> = this.notCalled;\n\tpublic getSnapshot: () => Promise<ISnapshot> = this.notCalled;\n\tpublic getVersions: () => Promise<IVersion[]> = this.notCalled;\n\tpublic write: () => Promise<IVersion> = this.notCalled;\n\tpublic uploadSummaryWithContext: () => Promise<string> = this.notCalled;\n\tpublic downloadSummary: () => Promise<ISummaryTree> = this.notCalled;\n\t/* eslint-enable @typescript-eslint/unbound-method */\n\n\tprivate notCalled(): never {\n\t\tthis.verifyStorage();\n\t\ttry {\n\t\t\t// some browsers may not populate stack unless exception is thrown\n\t\t\tthrow new Error(\"BlobOnlyStorage not implemented method used\");\n\t\t} catch (error) {\n\t\t\tthis.logger.sendTelemetryEvent({ eventName: \"BlobOnlyStorageWrongCall\" }, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\n// runtime will write a tree to the summary containing \"attachment\" type entries\n// which reference attachment blobs by ID, along with a blob containing the blob redirect table.\n// However, some drivers do not support the \"attachment\" type and will convert them to \"blob\" type\n// entries. We want to avoid saving these to reduce the size of stashed change blobs, but we\n// need to make sure the blob redirect table is saved.\nconst blobsTreeName = \".blobs\";\nconst redirectTableBlobName = \".redirectTable\";\n\n/**\n * Get blob contents of a snapshot tree from storage (or, ideally, cache)\n */\nexport async function getBlobContentsFromTree(\n\tsnapshot: ISnapshotTree,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<ISerializableBlobContents> {\n\tconst blobs = {};\n\tawait getBlobContentsFromTreeCore(snapshot, blobs, storage);\n\treturn blobs;\n}\n\nasync function getBlobContentsFromTreeCore(\n\ttree: ISnapshotTree,\n\tblobs: ISerializableBlobContents,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n\troot = true,\n): Promise<unknown[]> {\n\tconst treePs: Promise<unknown>[] = [];\n\tfor (const [key, subTree] of Object.entries(tree.trees)) {\n\t\tif (root && key === blobsTreeName) {\n\t\t\ttreePs.push(getBlobManagerTreeFromTree(subTree, blobs, storage));\n\t\t} else {\n\t\t\ttreePs.push(getBlobContentsFromTreeCore(subTree, blobs, storage, false));\n\t\t}\n\t}\n\tfor (const id of Object.values(tree.blobs)) {\n\t\tconst blob = await storage.readBlob(id);\n\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\tblobs[id] = bufferToString(blob, \"utf8\");\n\t}\n\treturn Promise.all(treePs);\n}\n\n// save redirect table from .blobs tree but nothing else\nasync function getBlobManagerTreeFromTree(\n\ttree: ISnapshotTree,\n\tblobs: ISerializableBlobContents,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<void> {\n\tconst id = tree.blobs[redirectTableBlobName];\n\tconst blob = await storage.readBlob(id);\n\t// ArrayBufferLike will not survive JSON.stringify()\n\tblobs[id] = bufferToString(blob, \"utf8\");\n}\n\n/**\n * Extract blob contents from a snapshot tree with blob contents\n */\nexport function getBlobContentsFromTreeWithBlobContents(\n\tsnapshot: ISnapshotTreeWithBlobContents,\n): ISerializableBlobContents {\n\tconst blobs = {};\n\tgetBlobContentsFromTreeWithBlobContentsCore(snapshot, blobs);\n\treturn blobs;\n}\n\nfunction getBlobContentsFromTreeWithBlobContentsCore(\n\ttree: ISnapshotTreeWithBlobContents,\n\tblobs: ISerializableBlobContents,\n\troot = true,\n): void {\n\tfor (const [key, subTree] of Object.entries(tree.trees)) {\n\t\tif (root && key === blobsTreeName) {\n\t\t\tgetBlobManagerTreeFromTreeWithBlobContents(subTree, blobs);\n\t\t} else {\n\t\t\tgetBlobContentsFromTreeWithBlobContentsCore(subTree, blobs, false);\n\t\t}\n\t}\n\tfor (const id of Object.values(tree.blobs)) {\n\t\tconst blob = tree.blobsContents?.[id];\n\t\tassert(blob !== undefined, 0x2ec /* \"Blob must be present in blobsContents\" */);\n\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\tblobs[id] = bufferToString(blob, \"utf8\");\n\t}\n}\n\n// save redirect table from .blobs tree but nothing else\nfunction getBlobManagerTreeFromTreeWithBlobContents(\n\ttree: ISnapshotTreeWithBlobContents,\n\tblobs: ISerializableBlobContents,\n): void {\n\tconst id = tree.blobs[redirectTableBlobName];\n\tconst blob = tree.blobsContents?.[id];\n\tassert(blob !== undefined, 0x70f /* Blob must be present in blobsContents */);\n\t// ArrayBufferLike will not survive JSON.stringify()\n\tblobs[id] = bufferToString(blob, \"utf8\");\n}\n"]}
|
package/dist/contracts.d.ts
CHANGED
|
@@ -32,15 +32,25 @@ export interface IConnectionDetailsInternal extends IConnectionDetails {
|
|
|
32
32
|
export interface IConnectionManager {
|
|
33
33
|
readonly connected: boolean;
|
|
34
34
|
readonly clientId: string | undefined;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* The queue of outbound delta messages
|
|
37
|
+
*/
|
|
36
38
|
readonly outbound: IDeltaQueue<IDocumentMessage[]>;
|
|
37
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Details of client
|
|
41
|
+
*/
|
|
38
42
|
readonly clientDetails: IClientDetails;
|
|
39
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Protocol version being used to communicate with the service
|
|
45
|
+
*/
|
|
40
46
|
readonly version: string;
|
|
41
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Max message size allowed to the delta manager
|
|
49
|
+
*/
|
|
42
50
|
readonly maxMessageSize: number;
|
|
43
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Service configuration provided by the service.
|
|
53
|
+
*/
|
|
44
54
|
readonly serviceConfiguration: IClientConfiguration | undefined;
|
|
45
55
|
readonly readOnlyInfo: ReadOnlyInfo;
|
|
46
56
|
readonly connectionProps: ITelemetryBaseProperties;
|
|
@@ -103,7 +113,7 @@ export interface IConnectionManagerFactoryArgs {
|
|
|
103
113
|
* Called by connection manager whenever critical error happens and container should be closed.
|
|
104
114
|
* Expects dispose() call in response to this call.
|
|
105
115
|
*/
|
|
106
|
-
readonly closeHandler: (error?:
|
|
116
|
+
readonly closeHandler: (error?: IErrorBase) => void;
|
|
107
117
|
/**
|
|
108
118
|
* Called whenever connection to relay service is lost.
|
|
109
119
|
*/
|
|
@@ -141,9 +151,8 @@ export interface IConnectionManagerFactoryArgs {
|
|
|
141
151
|
readonly cancelConnectionHandler: (reason: IConnectionStateChangeReason) => void;
|
|
142
152
|
}
|
|
143
153
|
/**
|
|
144
|
-
*
|
|
154
|
+
* Gets the name of the Fluid package.
|
|
145
155
|
* @param codeDetails- - Data structure used to describe the code to load on the Fluid document
|
|
146
|
-
* @returns The name of the Fluid package
|
|
147
156
|
*/
|
|
148
157
|
export declare const getPackageName: (codeDetails: IFluidCodeDetails | undefined) => IContainerPackageInfo;
|
|
149
158
|
//# sourceMappingURL=contracts.d.ts.map
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EACN,WAAW,EACX,YAAY,EACZ,iBAAiB,EAEjB,kBAAkB,EAClB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EACN,qBAAqB,EACrB,oB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AAK,IAAI,CAAC;IAEpF;;OAEG;IACH,QAAQ,CAAC,uBAAuB,EAAE,CAAC,MAAM,EAAE,4BAA4B,KAAK,IAAI,CAAC;CACjF;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,gBACb,iBAAiB,GAAG,SAAS,KACxC,qBAaF,CAAC"}
|
package/dist/contracts.js
CHANGED
|
@@ -13,11 +13,12 @@ var ReconnectMode;
|
|
|
13
13
|
ReconnectMode["Enabled"] = "Enabled";
|
|
14
14
|
})(ReconnectMode || (exports.ReconnectMode = ReconnectMode = {}));
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Gets the name of the Fluid package.
|
|
17
17
|
* @param codeDetails- - Data structure used to describe the code to load on the Fluid document
|
|
18
|
-
* @returns The name of the Fluid package
|
|
19
18
|
*/
|
|
20
19
|
const getPackageName = (codeDetails) => {
|
|
20
|
+
// TODO: use a real type
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
22
|
let containerPackageName;
|
|
22
23
|
if (codeDetails && "name" in codeDetails) {
|
|
23
24
|
containerPackageName = codeDetails;
|
|
@@ -28,6 +29,7 @@ const getPackageName = (codeDetails) => {
|
|
|
28
29
|
else {
|
|
29
30
|
containerPackageName = codeDetails?.package;
|
|
30
31
|
}
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
31
33
|
return { name: containerPackageName };
|
|
32
34
|
};
|
|
33
35
|
exports.getPackageName = getPackageName;
|
package/dist/contracts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,6EAMwD;AAYxD,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;AACpB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,6EAMwD;AAYxD,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;AACpB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAoLD;;;GAGG;AACI,MAAM,cAAc,GAAG,CAC7B,WAA0C,EAClB,EAAE;IAC1B,wBAAwB;IACxB,8DAA8D;IAC9D,IAAI,oBAAyB,CAAC;IAC9B,IAAI,WAAW,IAAI,MAAM,IAAI,WAAW,EAAE,CAAC;QAC1C,oBAAoB,GAAG,WAAW,CAAC;IACpC,CAAC;SAAM,IAAI,IAAA,yBAAc,EAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;QACjD,oBAAoB,GAAG,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC;IAClD,CAAC;SAAM,CAAC;QACP,oBAAoB,GAAG,WAAW,EAAE,OAAO,CAAC;IAC7C,CAAC;IACD,mEAAmE;IACnE,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;AACvC,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tIDeltaQueue,\n\tReadOnlyInfo,\n\tIFluidCodeDetails,\n\tisFluidPackage,\n\tIConnectionDetails,\n} from \"@fluidframework/container-definitions/internal\";\nimport { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport { ConnectionMode, IClientDetails } from \"@fluidframework/driver-definitions\";\nimport {\n\tIContainerPackageInfo,\n\tIClientConfiguration,\n\tIDocumentMessage,\n\tISignalClient,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nexport enum ReconnectMode {\n\tNever = \"Never\",\n\tDisabled = \"Disabled\",\n\tEnabled = \"Enabled\",\n}\n\nexport interface IConnectionStateChangeReason<T extends IErrorBase = IErrorBase> {\n\ttext: string;\n\terror?: T;\n}\n\n/**\n * Internal version of IConnectionDetails with props are only exposed internally\n */\nexport interface IConnectionDetailsInternal extends IConnectionDetails {\n\tmode: ConnectionMode;\n\tversion: string;\n\tinitialClients: ISignalClient[];\n\treason: IConnectionStateChangeReason;\n}\n\n/**\n * Connection manager (implements this interface) is responsible for maintaining connection\n * to relay service.\n */\nexport interface IConnectionManager {\n\treadonly connected: boolean;\n\n\treadonly clientId: string | undefined;\n\n\t/**\n\t * The queue of outbound delta messages\n\t */\n\treadonly outbound: IDeltaQueue<IDocumentMessage[]>;\n\n\t/**\n\t * Details of client\n\t */\n\treadonly clientDetails: IClientDetails;\n\n\t/**\n\t * Protocol version being used to communicate with the service\n\t */\n\treadonly version: string;\n\n\t/**\n\t * Max message size allowed to the delta manager\n\t */\n\treadonly maxMessageSize: number;\n\n\t/**\n\t * Service configuration provided by the service.\n\t */\n\treadonly serviceConfiguration: IClientConfiguration | undefined;\n\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t// Various connectivity properties for telemetry describing type of current connection\n\t// Things like connection mode, service info, etc.\n\t// Called when connection state changes (connect / disconnect)\n\treadonly connectionProps: ITelemetryBaseProperties;\n\n\t// Verbose information about connection logged to telemetry in case of issues with\n\t// maintaining healthy connection, including op gaps, not receiving join op in time, etc.\n\t// Contains details information, like sequence numbers at connection time, initial ops info, etc.\n\treadonly connectionVerboseProps: ITelemetryBaseProperties;\n\n\t/**\n\t * Prepares message to be sent. Fills in clientSequenceNumber.\n\t * Called only when active connection is present.\n\t */\n\tprepareMessageToSend(\n\t\tmessage: Omit<IDocumentMessage, \"clientSequenceNumber\">,\n\t): IDocumentMessage | undefined;\n\n\t/**\n\t * Called before incoming message is processed. Incoming messages can be combing from connection,\n\t * but also could come from storage.\n\t * This call allows connection manager to adjust knowledge about acked ops sent on previous connection.\n\t * Can be called at any time, including when there is no active connection.\n\t */\n\tbeforeProcessingIncomingOp(message: ISequencedDocumentMessage): void;\n\n\t/**\n\t * Submits signal to relay service.\n\t * Called only when active connection is present.\n\t */\n\tsubmitSignal: (content: string, targetClientId?: string) => void;\n\n\t/**\n\t * Submits messages to relay service.\n\t * Called only when active connection is present.\n\t */\n\tsendMessages(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Initiates connection to relay service (noop if already connected).\n\t */\n\tconnect(reason: IConnectionStateChangeReason, connectionMode?: ConnectionMode): void;\n\n\t/**\n\t * Disposed connection manager\n\t */\n\tdispose(error?: ICriticalContainerError, switchToReadonly?: boolean): void;\n\n\tget connectionMode(): ConnectionMode;\n}\n\n/**\n * This interface represents a set of callbacks provided by DeltaManager to IConnectionManager on its creation\n * IConnectionManager instance will use them to communicate to DeltaManager about various events.\n */\nexport interface IConnectionManagerFactoryArgs {\n\t/**\n\t * Called by connection manager for each incoming op. Some ops maybe delivered before\n\t * connectHandler is called (initial ops on socket connection)\n\t */\n\treadonly incomingOpHandler: (messages: ISequencedDocumentMessage[], reason: string) => void;\n\n\t/**\n\t * Called by connection manager for each incoming signal.\n\t * May be called before connectHandler is called (due to initial signals on socket connection)\n\t */\n\treadonly signalHandler: (signals: ISignalMessage[]) => void;\n\n\t/**\n\t * Called when connection manager experiences delay in connecting to relay service.\n\t * This can happen because client is offline, or service is busy and asks to not connect for some time.\n\t * Can be called many times while not connected.\n\t * Situation is considered resolved when connection is established and connectHandler is called.\n\t */\n\treadonly reconnectionDelayHandler: (delayMs: number, error: unknown) => void;\n\n\t/**\n\t * Called by connection manager whenever critical error happens and container should be closed.\n\t * Expects dispose() call in response to this call.\n\t */\n\treadonly closeHandler: (error?: IErrorBase) => void;\n\n\t/**\n\t * Called whenever connection to relay service is lost.\n\t */\n\treadonly disconnectHandler: (reason: IConnectionStateChangeReason) => void;\n\n\t/**\n\t * Called whenever new connection to rely service is established\n\t */\n\treadonly connectHandler: (connection: IConnectionDetailsInternal) => void;\n\n\t/**\n\t * Called whenever ping/pong messages are roundtripped on connection.\n\t */\n\treadonly pongHandler: (latency: number) => void;\n\n\t/**\n\t * Called whenever connection type changes from writable to read-only or vice versa.\n\t *\n\t * @remarks\n\t *\n\t * Connection can be read-only if user has no edit permissions, or if container forced\n\t * connection to be read-only.\n\t * This should not be confused with \"read\" / \"write\"connection mode which is internal\n\t * optimization.\n\t *\n\t * @param readonly - Whether or not the container is now read-only.\n\t * `undefined` indicates that user permissions are not yet known.\n\t * @param readonlyConnectionReason - reason/error if any for the change\n\t */\n\treadonly readonlyChangeHandler: (\n\t\treadonly?: boolean,\n\t\treadonlyConnectionReason?: IConnectionStateChangeReason,\n\t) => void;\n\n\t/**\n\t * Called whenever we try to start establishing a new connection.\n\t */\n\treadonly establishConnectionHandler: (reason: IConnectionStateChangeReason) => void;\n\n\t/**\n\t * Called whenever we cancel the connection in progress.\n\t */\n\treadonly cancelConnectionHandler: (reason: IConnectionStateChangeReason) => void;\n}\n\n/**\n * Gets the name of the Fluid package.\n * @param codeDetails- - Data structure used to describe the code to load on the Fluid document\n */\nexport const getPackageName = (\n\tcodeDetails: IFluidCodeDetails | undefined,\n): IContainerPackageInfo => {\n\t// TODO: use a real type\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tlet containerPackageName: any;\n\tif (codeDetails && \"name\" in codeDetails) {\n\t\tcontainerPackageName = codeDetails;\n\t} else if (isFluidPackage(codeDetails?.package)) {\n\t\tcontainerPackageName = codeDetails?.package.name;\n\t} else {\n\t\tcontainerPackageName = codeDetails?.package;\n\t}\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\treturn { name: containerPackageName };\n};\n"]}
|
package/dist/debugLogger.js
CHANGED
|
@@ -64,9 +64,9 @@ class DebugLogger {
|
|
|
64
64
|
let logger = isError ? this.debugErr : this.debug;
|
|
65
65
|
// Use debug's coloring schema for base of the event
|
|
66
66
|
const index = event.eventName.lastIndexOf(internal_1.eventNamespaceSeparator);
|
|
67
|
-
const name = event.eventName.
|
|
67
|
+
const name = event.eventName.slice(Math.max(0, index + 1));
|
|
68
68
|
if (index > 0) {
|
|
69
|
-
logger = logger.extend(event.eventName.
|
|
69
|
+
logger = logger.extend(event.eventName.slice(0, index));
|
|
70
70
|
}
|
|
71
71
|
newEvent.eventName = undefined;
|
|
72
72
|
let tick = "";
|
|
@@ -81,7 +81,7 @@ class DebugLogger {
|
|
|
81
81
|
try {
|
|
82
82
|
payload = JSON.stringify(newEvent);
|
|
83
83
|
}
|
|
84
|
-
catch
|
|
84
|
+
catch {
|
|
85
85
|
newEvent.error = undefined;
|
|
86
86
|
payload = JSON.stringify(newEvent);
|
|
87
87
|
}
|
package/dist/debugLogger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugLogger.js","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,+DAA2D;AAM3D,uEAMkD;AAClD,0FAA0F;AAC1F,kDAA6B;AAG7B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,eAAQ,CAAC;AAE1C;;GAEG;AACH,MAAa,WAAW;IACvB;;;;;;;OAOG;IACI,MAAM,CAAC,gBAAgB,CAC7B,SAAiB,EACjB,UAAiC,EACjC,UAAyC;QAEzC,uEAAuE;QACvE,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;QAEvC,+CAA+C;QAC/C,uFAAuF;QACvF,MAAM,QAAQ,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;QAC1C,QAAQ,CAAC,GAAG,GAAG,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"debugLogger.js","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,+DAA2D;AAM3D,uEAMkD;AAClD,0FAA0F;AAC1F,kDAA6B;AAG7B,MAAM,EAAE,KAAK,EAAE,aAAa,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I,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;CACD;AA7FD,kCA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performance } from \"@fluid-internal/client-utils\";\nimport {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tITelemetryLoggerExt,\n\tITelemetryLoggerPropertyBags,\n\tcreateMultiSinkLogger,\n\teventNamespaceSeparator,\n\tformatTick,\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): ITelemetryLoggerExt {\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(performance.now())}`;\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/dist/deltaManager.d.ts
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
6
|
-
import { IDeltaManager, IDeltaManagerEvents, IDeltaQueue } from "@fluidframework/container-definitions/internal";
|
|
6
|
+
import { IDeltaManager, IDeltaManagerEvents, IDeltaQueue, type IDeltaSender, type ReadOnlyInfo } from "@fluidframework/container-definitions/internal";
|
|
7
7
|
import { IEventProvider, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { IThrottlingWarning } from "@fluidframework/core-interfaces/internal";
|
|
9
9
|
import { ConnectionMode } from "@fluidframework/driver-definitions";
|
|
10
|
-
import { IDocumentService, IDocumentMessage, MessageType, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal";
|
|
10
|
+
import { IDocumentService, IDocumentMessage, MessageType, ISequencedDocumentMessage, ISignalMessage, type IClientDetails, type IClientConfiguration } from "@fluidframework/driver-definitions/internal";
|
|
11
11
|
import { type ITelemetryErrorEventExt, ITelemetryLoggerExt, EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils/internal";
|
|
12
12
|
import { IConnectionDetailsInternal, IConnectionManager, IConnectionManagerFactoryArgs, IConnectionStateChangeReason } from "./contracts.js";
|
|
13
13
|
export interface IConnectionArgs {
|
|
@@ -50,7 +50,7 @@ export declare class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
50
50
|
readonly connectionManager: TConnectionManager;
|
|
51
51
|
get active(): boolean;
|
|
52
52
|
get disposed(): boolean;
|
|
53
|
-
get IDeltaSender():
|
|
53
|
+
get IDeltaSender(): IDeltaSender;
|
|
54
54
|
private pending;
|
|
55
55
|
private fetchReason;
|
|
56
56
|
private currentlyProcessingOps;
|
|
@@ -59,9 +59,13 @@ export declare class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
59
59
|
private lastObservedSeqNumber;
|
|
60
60
|
private lastProcessedSequenceNumber;
|
|
61
61
|
private lastProcessedMessage;
|
|
62
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Count the number of noops sent by the client which may not be acked
|
|
64
|
+
*/
|
|
63
65
|
private noOpCount;
|
|
64
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Track clientSequenceNumber of the last op
|
|
68
|
+
*/
|
|
65
69
|
private lastClientSequenceNumber;
|
|
66
70
|
/**
|
|
67
71
|
* Track down the ops size.
|
|
@@ -97,11 +101,11 @@ export declare class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
97
101
|
get hasCheckpointSequenceNumber(): boolean;
|
|
98
102
|
get maxMessageSize(): number;
|
|
99
103
|
get version(): string;
|
|
100
|
-
get serviceConfiguration():
|
|
104
|
+
get serviceConfiguration(): IClientConfiguration | undefined;
|
|
101
105
|
get outbound(): IDeltaQueue<IDocumentMessage[]>;
|
|
102
|
-
get readOnlyInfo():
|
|
103
|
-
get clientDetails():
|
|
104
|
-
submit(type: MessageType, contents?: string, batch?: boolean, metadata?:
|
|
106
|
+
get readOnlyInfo(): ReadOnlyInfo;
|
|
107
|
+
get clientDetails(): IClientDetails;
|
|
108
|
+
submit(type: MessageType, contents?: string, batch?: boolean, metadata?: unknown, compression?: string, referenceSequenceNumber?: number): number;
|
|
105
109
|
submitSignal(content: string, targetClientId?: string): void;
|
|
106
110
|
flush(): void;
|
|
107
111
|
get connectionProps(): ITelemetryBaseProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltaManager.d.ts","sourceRoot":"","sources":["../src/deltaManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,cAAc,EAEd,wBAAwB,EACxB,MAAM,iCAAiC,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