@fluidframework/container-loader 2.51.0-347100 → 2.52.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 +8 -0
- package/dist/connectionManager.d.ts +7 -1
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +28 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/container.d.ts +11 -8
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +37 -22
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +49 -25
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +29 -38
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +10 -3
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +12 -3
- package/dist/containerStorageAdapter.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/serializedStateManager.d.ts +2 -2
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js +5 -5
- package/dist/serializedStateManager.js.map +1 -1
- package/lib/connectionManager.d.ts +7 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +28 -1
- package/lib/connectionManager.js.map +1 -1
- package/lib/container.d.ts +11 -8
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +37 -22
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +49 -25
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +29 -38
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +10 -3
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +12 -3
- package/lib/containerStorageAdapter.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/serializedStateManager.d.ts +2 -2
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js +5 -5
- package/lib/serializedStateManager.js.map +1 -1
- package/package.json +14 -14
- package/src/connectionManager.ts +38 -0
- package/src/container.ts +50 -59
- package/src/containerContext.ts +128 -52
- package/src/containerStorageAdapter.ts +19 -6
- package/src/packageVersion.ts +1 -1
- package/src/serializedStateManager.ts +5 -9
|
@@ -4,22 +4,58 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { ILayerCompatDetails, IProvideLayerCompatDetails } from "@fluid-internal/client-utils";
|
|
6
6
|
import { AttachState, IAudience, ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
7
|
-
import { IBatchMessage, IContainerContext, ILoader, ILoaderOptions, IDeltaManager } from "@fluidframework/container-definitions/internal";
|
|
7
|
+
import { IBatchMessage, IContainerContext, ILoader, ILoaderOptions, IDeltaManager, type IContainerStorageService } from "@fluidframework/container-definitions/internal";
|
|
8
8
|
import { type FluidObject } from "@fluidframework/core-interfaces";
|
|
9
9
|
import { type ISignalEnvelope } from "@fluidframework/core-interfaces/internal";
|
|
10
10
|
import { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
|
|
11
|
-
import {
|
|
11
|
+
import { ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
12
12
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
13
|
+
import type { ConnectionState } from "./connectionState.js";
|
|
14
|
+
/**
|
|
15
|
+
* Configuration object for ContainerContext constructor.
|
|
16
|
+
*/
|
|
17
|
+
export interface IContainerContextConfig {
|
|
18
|
+
readonly options: ILoaderOptions;
|
|
19
|
+
readonly scope: FluidObject;
|
|
20
|
+
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
21
|
+
readonly version: IVersion | undefined;
|
|
22
|
+
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
23
|
+
readonly storage: IContainerStorageService;
|
|
24
|
+
readonly quorum: IQuorumClients;
|
|
25
|
+
readonly audience: IAudience;
|
|
26
|
+
readonly loader: ILoader;
|
|
27
|
+
readonly submitFn: (type: MessageType, contents: unknown, batch: boolean, appData: unknown) => number;
|
|
28
|
+
readonly submitSummaryFn: (summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number;
|
|
29
|
+
readonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;
|
|
30
|
+
readonly submitSignalFn: (content: unknown | ISignalEnvelope, targetClientId?: string) => void;
|
|
31
|
+
readonly disposeFn: (error?: ICriticalContainerError) => void;
|
|
32
|
+
readonly closeFn: (error?: ICriticalContainerError) => void;
|
|
33
|
+
readonly updateDirtyContainerState: (dirty: boolean) => void;
|
|
34
|
+
readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;
|
|
35
|
+
readonly getContainerDiagnosticId: () => string | undefined;
|
|
36
|
+
readonly getClientId: () => string | undefined;
|
|
37
|
+
readonly getAttachState: () => AttachState;
|
|
38
|
+
readonly getConnected: () => boolean;
|
|
39
|
+
readonly getConnectionState: () => ConnectionState;
|
|
40
|
+
readonly clientDetails: IClientDetails;
|
|
41
|
+
readonly existing: boolean;
|
|
42
|
+
readonly taggedLogger: ITelemetryLoggerExt;
|
|
43
|
+
readonly pendingLocalState?: unknown;
|
|
44
|
+
readonly snapshotWithContents?: ISnapshot;
|
|
45
|
+
}
|
|
13
46
|
/**
|
|
14
47
|
* {@inheritDoc @fluidframework/container-definitions#IContainerContext}
|
|
15
48
|
*/
|
|
16
49
|
export declare class ContainerContext implements IContainerContext, IProvideLayerCompatDetails {
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated - This has been replaced by ILayerCompatDetails.
|
|
52
|
+
*/
|
|
53
|
+
readonly supportedFeatures: ReadonlyMap<string, unknown>;
|
|
17
54
|
readonly options: ILoaderOptions;
|
|
18
55
|
readonly scope: FluidObject;
|
|
19
56
|
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
20
|
-
private readonly _version;
|
|
21
57
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
22
|
-
readonly storage:
|
|
58
|
+
readonly storage: IContainerStorageService;
|
|
23
59
|
readonly quorum: IQuorumClients;
|
|
24
60
|
readonly audience: IAudience;
|
|
25
61
|
readonly loader: ILoader;
|
|
@@ -39,19 +75,17 @@ export declare class ContainerContext implements IContainerContext, IProvideLaye
|
|
|
39
75
|
readonly closeFn: (error?: ICriticalContainerError) => void;
|
|
40
76
|
readonly updateDirtyContainerState: (dirty: boolean) => void;
|
|
41
77
|
readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;
|
|
42
|
-
private readonly _getContainerDiagnosticId;
|
|
43
|
-
private readonly _getClientId;
|
|
44
|
-
private readonly _getAttachState;
|
|
45
|
-
private readonly _getConnected;
|
|
46
78
|
readonly clientDetails: IClientDetails;
|
|
47
79
|
readonly existing: boolean;
|
|
48
80
|
readonly taggedLogger: ITelemetryLoggerExt;
|
|
49
|
-
readonly pendingLocalState
|
|
50
|
-
readonly snapshotWithContents
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
readonly
|
|
81
|
+
readonly pendingLocalState: unknown;
|
|
82
|
+
readonly snapshotWithContents: ISnapshot | undefined;
|
|
83
|
+
readonly getConnectionState: () => ConnectionState;
|
|
84
|
+
private readonly _getClientId;
|
|
85
|
+
private readonly _getContainerDiagnosticId;
|
|
86
|
+
private readonly _getConnected;
|
|
87
|
+
private readonly _getAttachState;
|
|
88
|
+
private readonly version;
|
|
55
89
|
get clientId(): string | undefined;
|
|
56
90
|
/**
|
|
57
91
|
* DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.
|
|
@@ -67,17 +101,7 @@ export declare class ContainerContext implements IContainerContext, IProvideLaye
|
|
|
67
101
|
* for validating Runtime-Loader compatibility.
|
|
68
102
|
*/
|
|
69
103
|
get ILayerCompatDetails(): ILayerCompatDetails;
|
|
70
|
-
constructor(
|
|
71
|
-
/**
|
|
72
|
-
* @returns clientSequenceNumber of last message in a batch
|
|
73
|
-
*/
|
|
74
|
-
submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number,
|
|
75
|
-
/**
|
|
76
|
-
* `unknown` should be removed once `@alpha` tag is removed from IContainerContext
|
|
77
|
-
* @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}
|
|
78
|
-
* Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s
|
|
79
|
-
*/
|
|
80
|
-
submitSignalFn: (content: unknown | ISignalEnvelope, targetClientId?: string) => void, disposeFn: (error?: ICriticalContainerError) => void, closeFn: (error?: ICriticalContainerError) => void, updateDirtyContainerState: (dirty: boolean) => void, getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>, _getContainerDiagnosticId: () => string | undefined, _getClientId: () => string | undefined, _getAttachState: () => AttachState, _getConnected: () => boolean, clientDetails: IClientDetails, existing: boolean, taggedLogger: ITelemetryLoggerExt, pendingLocalState?: unknown, snapshotWithContents?: ISnapshot | undefined);
|
|
104
|
+
constructor(config: IContainerContextConfig);
|
|
81
105
|
getLoadedFromVersion(): IVersion | undefined;
|
|
82
106
|
get attachState(): AttachState;
|
|
83
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,0BAA0B,EAC1B,MAAM,8BAA8B,CAAC;AACtC,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,MAA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
|
package/dist/containerContext.js
CHANGED
|
@@ -33,43 +33,7 @@ class ContainerContext {
|
|
|
33
33
|
get ILayerCompatDetails() {
|
|
34
34
|
return loaderLayerCompatState_js_1.loaderCompatDetailsForRuntime;
|
|
35
35
|
}
|
|
36
|
-
constructor(
|
|
37
|
-
/**
|
|
38
|
-
* @returns clientSequenceNumber of last message in a batch
|
|
39
|
-
*/
|
|
40
|
-
submitBatchFn,
|
|
41
|
-
/**
|
|
42
|
-
* `unknown` should be removed once `@alpha` tag is removed from IContainerContext
|
|
43
|
-
* @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}
|
|
44
|
-
* Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s
|
|
45
|
-
*/
|
|
46
|
-
submitSignalFn, disposeFn, closeFn, updateDirtyContainerState, getAbsoluteUrl, _getContainerDiagnosticId, _getClientId, _getAttachState, _getConnected, clientDetails, existing, taggedLogger, pendingLocalState, snapshotWithContents) {
|
|
47
|
-
this.options = options;
|
|
48
|
-
this.scope = scope;
|
|
49
|
-
this.baseSnapshot = baseSnapshot;
|
|
50
|
-
this._version = _version;
|
|
51
|
-
this.deltaManager = deltaManager;
|
|
52
|
-
this.storage = storage;
|
|
53
|
-
this.quorum = quorum;
|
|
54
|
-
this.audience = audience;
|
|
55
|
-
this.loader = loader;
|
|
56
|
-
this.submitFn = submitFn;
|
|
57
|
-
this.submitSummaryFn = submitSummaryFn;
|
|
58
|
-
this.submitBatchFn = submitBatchFn;
|
|
59
|
-
this.submitSignalFn = submitSignalFn;
|
|
60
|
-
this.disposeFn = disposeFn;
|
|
61
|
-
this.closeFn = closeFn;
|
|
62
|
-
this.updateDirtyContainerState = updateDirtyContainerState;
|
|
63
|
-
this.getAbsoluteUrl = getAbsoluteUrl;
|
|
64
|
-
this._getContainerDiagnosticId = _getContainerDiagnosticId;
|
|
65
|
-
this._getClientId = _getClientId;
|
|
66
|
-
this._getAttachState = _getAttachState;
|
|
67
|
-
this._getConnected = _getConnected;
|
|
68
|
-
this.clientDetails = clientDetails;
|
|
69
|
-
this.existing = existing;
|
|
70
|
-
this.taggedLogger = taggedLogger;
|
|
71
|
-
this.pendingLocalState = pendingLocalState;
|
|
72
|
-
this.snapshotWithContents = snapshotWithContents;
|
|
36
|
+
constructor(config) {
|
|
73
37
|
/**
|
|
74
38
|
* @deprecated - This has been replaced by ILayerCompatDetails.
|
|
75
39
|
*/
|
|
@@ -81,9 +45,36 @@ class ContainerContext {
|
|
|
81
45
|
*/
|
|
82
46
|
["referenceSequenceNumbers", true],
|
|
83
47
|
]);
|
|
48
|
+
this.options = config.options;
|
|
49
|
+
this.scope = config.scope;
|
|
50
|
+
this.baseSnapshot = config.baseSnapshot;
|
|
51
|
+
this.deltaManager = config.deltaManager;
|
|
52
|
+
this.storage = config.storage;
|
|
53
|
+
this.quorum = config.quorum;
|
|
54
|
+
this.audience = config.audience;
|
|
55
|
+
this.loader = config.loader;
|
|
56
|
+
this.submitFn = config.submitFn;
|
|
57
|
+
this.submitSummaryFn = config.submitSummaryFn;
|
|
58
|
+
this.submitBatchFn = config.submitBatchFn;
|
|
59
|
+
this.submitSignalFn = config.submitSignalFn;
|
|
60
|
+
this.disposeFn = config.disposeFn;
|
|
61
|
+
this.closeFn = config.closeFn;
|
|
62
|
+
this.updateDirtyContainerState = config.updateDirtyContainerState;
|
|
63
|
+
this.getAbsoluteUrl = config.getAbsoluteUrl;
|
|
64
|
+
this.clientDetails = config.clientDetails;
|
|
65
|
+
this.existing = config.existing;
|
|
66
|
+
this.taggedLogger = config.taggedLogger;
|
|
67
|
+
this.pendingLocalState = config.pendingLocalState;
|
|
68
|
+
this.snapshotWithContents = config.snapshotWithContents;
|
|
69
|
+
this.getConnectionState = config.getConnectionState;
|
|
70
|
+
this._getClientId = config.getClientId;
|
|
71
|
+
this._getContainerDiagnosticId = config.getContainerDiagnosticId;
|
|
72
|
+
this._getConnected = config.getConnected;
|
|
73
|
+
this._getAttachState = config.getAttachState;
|
|
74
|
+
this.version = config.version;
|
|
84
75
|
}
|
|
85
76
|
getLoadedFromVersion() {
|
|
86
|
-
return this.
|
|
77
|
+
return this.version;
|
|
87
78
|
}
|
|
88
79
|
get attachState() {
|
|
89
80
|
return this._getAttachState();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiCH,2EAA4E;AAE5E;;GAEG;AACH,MAAa,gBAAgB;IAa5B,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;;;OAGG;IACH,IAAW,mBAAmB;QAC7B,OAAO,yDAA6B,CAAC;IACtC,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,EACO,SAAoD,EACpD,OAAkD,EAClD,yBAAmD,EACnD,cAAoE,EACnE,yBAAmD,EACnD,YAAsC,EACtC,eAAkC,EAClC,aAA4B,EAC7B,aAA6B,EAC7B,QAAiB,EACjB,YAAiC,EACjC,iBAA2B,EAC3B,oBAAgC;QAhDhC,YAAO,GAAP,OAAO,CAAgB;QACvB,UAAK,GAAL,KAAK,CAAa;QAClB,iBAAY,GAAZ,YAAY,CAA2B;QACtC,aAAQ,GAAR,QAAQ,CAAsB;QAC/B,iBAAY,GAAZ,YAAY,CAA4D;QACxE,YAAO,GAAP,OAAO,CAAyB;QAChC,WAAM,GAAN,MAAM,CAAgB;QACtB,aAAQ,GAAR,QAAQ,CAAW;QACnB,WAAM,GAAN,MAAM,CAAS;QACf,aAAQ,GAAR,QAAQ,CAKb;QACK,oBAAe,GAAf,eAAe,CAGpB;QAIK,kBAAa,GAAb,aAAa,CAGlB;QAOK,mBAAc,GAAd,cAAc,CAGrB;QACO,cAAS,GAAT,SAAS,CAA2C;QACpD,YAAO,GAAP,OAAO,CAA2C;QAClD,8BAAyB,GAAzB,yBAAyB,CAA0B;QACnD,mBAAc,GAAd,cAAc,CAAsD;QACnE,8BAAyB,GAAzB,yBAAyB,CAA0B;QACnD,iBAAY,GAAZ,YAAY,CAA0B;QACtC,oBAAe,GAAf,eAAe,CAAmB;QAClC,kBAAa,GAAb,aAAa,CAAe;QAC7B,kBAAa,GAAb,aAAa,CAAgB;QAC7B,aAAQ,GAAR,QAAQ,CAAS;QACjB,iBAAY,GAAZ,YAAY,CAAqB;QACjC,sBAAiB,GAAjB,iBAAiB,CAAU;QAC3B,yBAAoB,GAApB,oBAAoB,CAAY;QAxFjD;;WAEG;QACa,sBAAiB,GAAiC,IAAI,GAAG,CAAC;YACzE;;;;eAIG;YACH,CAAC,0BAA0B,EAAE,IAAI,CAAC;SAClC,CAAC,CAAC;IA+EA,CAAC;IAEG,oBAAoB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACD;AAnGD,4CAmGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tIProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\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\nimport { loaderCompatDetailsForRuntime } from \"./loaderLayerCompatState.js\";\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext implements IContainerContext, IProvideLayerCompatDetails {\n\t/**\n\t * @deprecated - This has been replaced by ILayerCompatDetails.\n\t */\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\t/**\n\t * The compatibility details of the Loader layer that is exposed to the Runtime layer\n\t * for validating Runtime-Loader compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn loaderCompatDetailsForRuntime;\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"]}
|
|
1
|
+
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkCH,2EAA4E;AA8C5E;;GAEG;AACH,MAAa,gBAAgB;IAiE5B,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;;;OAGG;IACH,IAAW,mBAAmB;QAC7B,OAAO,yDAA6B,CAAC;IACtC,CAAC;IAED,YAAY,MAA+B;QA3F3C;;WAEG;QACa,sBAAiB,GAAiC,IAAI,GAAG,CAAC;YACzE;;;;eAIG;YACH,CAAC,0BAA0B,EAAE,IAAI,CAAC;SAClC,CAAC,CAAC;QAkFF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;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,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACD;AAlID,4CAkIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tIProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\nimport {\n\tAttachState,\n\tIAudience,\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nimport {\n\tIBatchMessage,\n\tIContainerContext,\n\tILoader,\n\tILoaderOptions,\n\tIDeltaManager,\n\ttype IContainerStorageService,\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\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\nimport type { ConnectionState } from \"./connectionState.js\";\nimport { loaderCompatDetailsForRuntime } from \"./loaderLayerCompatState.js\";\n\n/**\n * Configuration object for ContainerContext constructor.\n */\nexport interface IContainerContextConfig {\n\treadonly options: ILoaderOptions;\n\treadonly scope: FluidObject;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly version: IVersion | undefined;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IContainerStorageService;\n\treadonly quorum: IQuorumClients;\n\treadonly audience: IAudience;\n\treadonly loader: ILoader;\n\treadonly submitFn: (\n\t\ttype: MessageType,\n\t\tcontents: unknown,\n\t\tbatch: boolean,\n\t\tappData: unknown,\n\t) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSignalFn: (\n\t\tcontent: unknown | ISignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n\treadonly disposeFn: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly updateDirtyContainerState: (dirty: boolean) => void;\n\treadonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;\n\treadonly getContainerDiagnosticId: () => string | undefined;\n\treadonly getClientId: () => string | undefined;\n\treadonly getAttachState: () => AttachState;\n\treadonly getConnected: () => boolean;\n\treadonly getConnectionState: () => ConnectionState;\n\treadonly clientDetails: IClientDetails;\n\treadonly existing: boolean;\n\treadonly taggedLogger: ITelemetryLoggerExt;\n\treadonly pendingLocalState?: unknown;\n\treadonly snapshotWithContents?: ISnapshot;\n}\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext implements IContainerContext, IProvideLayerCompatDetails {\n\t/**\n\t * @deprecated - This has been replaced by ILayerCompatDetails.\n\t */\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 readonly options: ILoaderOptions;\n\tpublic readonly scope: FluidObject;\n\tpublic readonly baseSnapshot: ISnapshotTree | undefined;\n\tpublic readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\tpublic readonly storage: IContainerStorageService;\n\tpublic readonly quorum: IQuorumClients;\n\tpublic readonly audience: IAudience;\n\tpublic readonly loader: ILoader;\n\tpublic readonly submitFn: (\n\t\ttype: MessageType,\n\t\tcontents: unknown,\n\t\tbatch: boolean,\n\t\tappData: unknown,\n\t) => number;\n\tpublic readonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\tpublic readonly submitBatchFn: (\n\t\tbatch: IBatchMessage[],\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * `unknown` should be removed once `@alpha` tag is removed from IContainerContext\n\t * @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n\t * Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s\n\t */\n\tpublic readonly submitSignalFn: (\n\t\tcontent: unknown | ISignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n\tpublic readonly disposeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly closeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly updateDirtyContainerState: (dirty: boolean) => void;\n\tpublic readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;\n\tpublic readonly clientDetails: IClientDetails;\n\tpublic readonly existing: boolean;\n\tpublic readonly taggedLogger: ITelemetryLoggerExt;\n\tpublic readonly pendingLocalState: unknown;\n\tpublic readonly snapshotWithContents: ISnapshot | undefined;\n\n\tpublic readonly getConnectionState: () => ConnectionState;\n\n\tprivate readonly _getClientId: () => string | undefined;\n\tprivate readonly _getContainerDiagnosticId: () => string | undefined;\n\tprivate readonly _getConnected: () => boolean;\n\tprivate readonly _getAttachState: () => AttachState;\n\tprivate readonly version: IVersion | undefined;\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\t/**\n\t * The compatibility details of the Loader layer that is exposed to the Runtime layer\n\t * for validating Runtime-Loader compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn loaderCompatDetailsForRuntime;\n\t}\n\n\tconstructor(config: IContainerContextConfig) {\n\t\tthis.options = config.options;\n\t\tthis.scope = config.scope;\n\t\tthis.baseSnapshot = config.baseSnapshot;\n\t\tthis.deltaManager = config.deltaManager;\n\t\tthis.storage = config.storage;\n\t\tthis.quorum = config.quorum;\n\t\tthis.audience = config.audience;\n\t\tthis.loader = config.loader;\n\t\tthis.submitFn = config.submitFn;\n\t\tthis.submitSummaryFn = config.submitSummaryFn;\n\t\tthis.submitBatchFn = config.submitBatchFn;\n\t\tthis.submitSignalFn = config.submitSignalFn;\n\t\tthis.disposeFn = config.disposeFn;\n\t\tthis.closeFn = config.closeFn;\n\t\tthis.updateDirtyContainerState = config.updateDirtyContainerState;\n\t\tthis.getAbsoluteUrl = config.getAbsoluteUrl;\n\t\tthis.clientDetails = config.clientDetails;\n\t\tthis.existing = config.existing;\n\t\tthis.taggedLogger = config.taggedLogger;\n\t\tthis.pendingLocalState = config.pendingLocalState;\n\t\tthis.snapshotWithContents = config.snapshotWithContents;\n\n\t\tthis.getConnectionState = config.getConnectionState;\n\t\tthis._getClientId = config.getClientId;\n\t\tthis._getContainerDiagnosticId = config.getContainerDiagnosticId;\n\t\tthis._getConnected = config.getConnected;\n\t\tthis._getAttachState = config.getAttachState;\n\t\tthis.version = config.version;\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"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ISnapshotTreeWithBlobContents } from "@fluidframework/container-definitions/internal";
|
|
5
|
+
import { ISnapshotTreeWithBlobContents, type IContainerStorageService } from "@fluidframework/container-definitions/internal";
|
|
6
6
|
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
8
|
import { FetchSource, IDocumentService, IDocumentStorageService, IDocumentStorageServicePolicies, ISnapshot, ISnapshotFetchOptions, ISummaryContext, ICreateBlobResponse, ISnapshotTree, IVersion } from "@fluidframework/driver-definitions/internal";
|
|
@@ -20,7 +20,7 @@ export interface ISerializableBlobContents {
|
|
|
20
20
|
* This class wraps the actual storage and make sure no wrong apis are called according to
|
|
21
21
|
* container attach state.
|
|
22
22
|
*/
|
|
23
|
-
export declare class ContainerStorageAdapter implements ISerializedStateManagerDocumentStorageService,
|
|
23
|
+
export declare class ContainerStorageAdapter implements ISerializedStateManagerDocumentStorageService, IContainerStorageService, IDisposable {
|
|
24
24
|
private readonly logger;
|
|
25
25
|
/**
|
|
26
26
|
* ArrayBufferLikes or utf8 encoded strings, containing blobs from a snapshot
|
|
@@ -63,13 +63,20 @@ export declare class ContainerStorageAdapter implements ISerializedStateManagerD
|
|
|
63
63
|
loadSnapshotFromSnapshotBlobs(snapshotBlobs: ISerializableBlobContents): void;
|
|
64
64
|
clearPendingState(): void;
|
|
65
65
|
get policies(): IDocumentStorageServicePolicies | undefined;
|
|
66
|
+
get maximumCacheDurationMs(): IDocumentStorageServicePolicies["maximumCacheDurationMs"];
|
|
66
67
|
getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
|
|
67
68
|
getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
|
|
68
69
|
readBlob(id: string): Promise<ArrayBufferLike>;
|
|
69
70
|
getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
|
|
70
71
|
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
71
|
-
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
|
|
72
72
|
createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* {@link IRuntimeStorageService.downloadSummary}.
|
|
75
|
+
*
|
|
76
|
+
* @deprecated - This API is deprecated and will be removed in a future release. No replacement is planned as
|
|
77
|
+
* it is unused in the Runtime and below layers.
|
|
78
|
+
*/
|
|
79
|
+
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
|
|
73
80
|
}
|
|
74
81
|
/**
|
|
75
82
|
* Get blob contents of a snapshot tree from storage (or, ideally, cache)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerStorageAdapter.d.ts","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"containerStorageAdapter.d.ts","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,MAAM,gDAAgD,CAAC;AACxD,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;AAE/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxE,OAAO,KAAK,EACX,6CAA6C,EAC7C,aAAa,EACb,MAAM,6BAA6B,CAAC;AAGrC;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACzC,CA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E7F;IAEY,eAAe,CAC3B,OAAO,CAAC,EAAE,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;IA2C7E,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,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI5E;;;;;OAKG;IACU,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;CAG3E;AA6DD;;GAEG;AACH,wBAAsB,uBAAuB,CAC5C,QAAQ,EAAE,SAAS,GAAG,aAAa,EACnC,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,GAChD,OAAO,CAAC,yBAAyB,CAAC,CAYpC;AAqCD;;GAEG;AACH,wBAAgB,uCAAuC,CACtD,QAAQ,EAAE,6BAA6B,GACrC,yBAAyB,CAI3B"}
|
|
@@ -104,6 +104,9 @@ class ContainerStorageAdapter {
|
|
|
104
104
|
}
|
|
105
105
|
return undefined;
|
|
106
106
|
}
|
|
107
|
+
get maximumCacheDurationMs() {
|
|
108
|
+
return this.policies?.maximumCacheDurationMs;
|
|
109
|
+
}
|
|
107
110
|
async getSnapshotTree(version, scenarioName) {
|
|
108
111
|
return this._storageService.getSnapshotTree(version, scenarioName);
|
|
109
112
|
}
|
|
@@ -157,12 +160,18 @@ class ContainerStorageAdapter {
|
|
|
157
160
|
async uploadSummaryWithContext(summary, context) {
|
|
158
161
|
return this._storageService.uploadSummaryWithContext(summary, context);
|
|
159
162
|
}
|
|
160
|
-
async downloadSummary(handle) {
|
|
161
|
-
return this._storageService.downloadSummary(handle);
|
|
162
|
-
}
|
|
163
163
|
async createBlob(file) {
|
|
164
164
|
return this._storageService.createBlob(file);
|
|
165
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* {@link IRuntimeStorageService.downloadSummary}.
|
|
168
|
+
*
|
|
169
|
+
* @deprecated - This API is deprecated and will be removed in a future release. No replacement is planned as
|
|
170
|
+
* it is unused in the Runtime and below layers.
|
|
171
|
+
*/
|
|
172
|
+
async downloadSummary(handle) {
|
|
173
|
+
return this._storageService.downloadSummary(handle);
|
|
174
|
+
}
|
|
166
175
|
}
|
|
167
176
|
exports.ContainerStorageAdapter = ContainerStorageAdapter;
|
|
168
177
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerStorageAdapter.js","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8E;AAG9E,kEAA6D;AAc7D,oEAA0F;AAI1F,mGAAqF;AACrF,6FAAuF;AAKvF,yCAA2D;AAU3D;;;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,YACC,mBAA0D,EACzC,MAA2B;IAC5C;;OAEG;IACc,eAA2D,EAAE,EACtE,uCAAkF,EACzE,2BAAwE,EACxE,2BAAgD;QAPhD,WAAM,GAAN,MAAM,CAAqB;QAI3B,iBAAY,GAAZ,YAAY,CAAiD;QACtE,4CAAuC,GAAv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C,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,IAAA,iBAAM,EACL,EAAE,KAAK,SAAS,EAChB,KAAK,CAAC,mEAAmE,CACzE,CAAC;IACF,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 { isInstanceOfISnapshot, UsageError } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { MemoryDetachedBlobStorage } from \"./memoryBlobStorage.js\";\nimport { ProtocolTreeStorageService } from \"./protocolTreeDocumentStorageService.js\";\nimport { RetriableDocumentStorageService } from \"./retriableDocumentStorageService.js\";\nimport type {\n\tISerializedStateManagerDocumentStorageService,\n\tISnapshotInfo,\n} from \"./serializedStateManager.js\";\nimport { convertSnapshotInfoToSnapshot } 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\tdetachedBlobStorage: MemoryDetachedBlobStorage | 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\tsnapshot = convertSnapshotInfoToSnapshot(\n\t\t\t\tlocalSnapshot,\n\t\t\t\tlocalSnapshot.snapshotSequenceNumber,\n\t\t\t);\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\tprivate readonly detachedStorage: MemoryDetachedBlobStorage | 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\tprivate verifyStorage(): MemoryDetachedBlobStorage {\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: ISnapshot | ISnapshotTree,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<ISerializableBlobContents> {\n\tconst blobs = {};\n\tif (isInstanceOfISnapshot(snapshot)) {\n\t\tconst blobContents = snapshot.blobContents;\n\t\tfor (const [id, content] of blobContents.entries()) {\n\t\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\t\tblobs[id] = bufferToString(content, \"utf8\");\n\t\t}\n\t} else {\n\t\tawait getBlobContentsFromTreeCore(snapshot, blobs, storage);\n\t}\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\tassert(id !== undefined, 0x9ce /* id is undefined in getBlobManagerTreeFromTree */);\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\tassert(\n\t\tid !== undefined,\n\t\t0x9cf /* id is undefined in getBlobManagerTreeFromTreeWithBlobContents */,\n\t);\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;AAM9E,kEAA6D;AAc7D,oEAA0F;AAI1F,mGAAqF;AACrF,6FAAuF;AAKvF,yCAA2D;AAU3D;;;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,YACC,mBAA0D,EACzC,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;QA3B1D,4BAAuB,GAA8B,EAAE,CAAC;QAgChE,aAAQ,GAAY,KAAK,CAAC;QAHzB,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAC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,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC7C,IAAA,iBAAM,EACL,EAAE,KAAK,SAAS,EAChB,KAAK,CAAC,mEAAmE,CACzE,CAAC;IACF,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 {\n\tISnapshotTreeWithBlobContents,\n\ttype IContainerStorageService,\n} 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 { isInstanceOfISnapshot, UsageError } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { MemoryDetachedBlobStorage } from \"./memoryBlobStorage.js\";\nimport { ProtocolTreeStorageService } from \"./protocolTreeDocumentStorageService.js\";\nimport { RetriableDocumentStorageService } from \"./retriableDocumentStorageService.js\";\nimport type {\n\tISerializedStateManagerDocumentStorageService,\n\tISnapshotInfo,\n} from \"./serializedStateManager.js\";\nimport { convertSnapshotInfoToSnapshot } 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\tIContainerStorageService,\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\tdetachedBlobStorage: MemoryDetachedBlobStorage | 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 get maximumCacheDurationMs(): IDocumentStorageServicePolicies[\"maximumCacheDurationMs\"] {\n\t\treturn this.policies?.maximumCacheDurationMs;\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\tsnapshot = convertSnapshotInfoToSnapshot(\n\t\t\t\tlocalSnapshot,\n\t\t\t\tlocalSnapshot.snapshotSequenceNumber,\n\t\t\t);\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 createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this._storageService.createBlob(file);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.downloadSummary}.\n\t *\n\t * @deprecated - This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime and below layers.\n\t */\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this._storageService.downloadSummary(handle);\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\tprivate readonly detachedStorage: MemoryDetachedBlobStorage | 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\tprivate verifyStorage(): MemoryDetachedBlobStorage {\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: ISnapshot | ISnapshotTree,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<ISerializableBlobContents> {\n\tconst blobs = {};\n\tif (isInstanceOfISnapshot(snapshot)) {\n\t\tconst blobContents = snapshot.blobContents;\n\t\tfor (const [id, content] of blobContents.entries()) {\n\t\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\t\tblobs[id] = bufferToString(content, \"utf8\");\n\t\t}\n\t} else {\n\t\tawait getBlobContentsFromTreeCore(snapshot, blobs, storage);\n\t}\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\tassert(id !== undefined, 0x9ce /* id is undefined in getBlobManagerTreeFromTree */);\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\tassert(\n\t\tid !== undefined,\n\t\t0x9cf /* id is undefined in getBlobManagerTreeFromTreeWithBlobContents */,\n\t);\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/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/container-loader";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.52.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,WAAW,CAAC"}
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/container-loader";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.52.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.52.0\";\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { IRuntime } from "@fluidframework/container-definitions/internal";
|
|
6
6
|
import type { IEventProvider, IEvent, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { IDocumentStorageService, IResolvedUrl, ISnapshot, ISnapshotTree, IVersion, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
8
8
|
import { MonitoringContext } from "@fluidframework/telemetry-utils/internal";
|
|
@@ -174,7 +174,7 @@ export declare class SerializedStateManager {
|
|
|
174
174
|
* Assembles and serializes the {@link IPendingContainerState} for the container,
|
|
175
175
|
* to be stored and used to rehydrate the container at a later time.
|
|
176
176
|
*/
|
|
177
|
-
getPendingLocalState(
|
|
177
|
+
getPendingLocalState(clientId: string | undefined, runtime: Pick<IRuntime, "getPendingLocalState">, resolvedUrl: IResolvedUrl): Promise<string>;
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
180
|
* Retrieves the most recent snapshot and returns its info.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializedStateManager.d.ts","sourceRoot":"","sources":["../src/serializedStateManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"serializedStateManager.d.ts","sourceRoot":"","sources":["../src/serializedStateManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,KAAK,EACX,cAAc,EACd,MAAM,EACN,oBAAoB,EAEpB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEN,uBAAuB,EACvB,YAAY,EACZ,SAAS,EAET,aAAa,EACb,QAAQ,EACR,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACN,iBAAiB,EAKjB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACN,yBAAyB,EAEzB,MAAM,8BAA8B,CAAC;AAGtC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,YAAY,EAAE,aAAa,CAAC;IAC5B;;;OAGG;IACH,aAAa,EAAE,yBAAyB,CAAC;CACzC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAChE;;OAEG;IACH,QAAQ,EAAE,IAAI,CAAC;IACf;;;OAGG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACvD;;;;OAIG;IACH,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC;;OAEG;IACH,GAAG,EAAE,MAAM,CA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,EAC7D,qBAAqB,EAAE,OAAO,GAC5B,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAoCpC;AA2BD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CACnC,EAAE,EAAE,iBAAiB,EACrB,cAAc,EAAE,IAAI,CAAC,uBAAuB,EAAE,aAAa,CAAC,EAC5D,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,QAAQ,CAAA;CAAE,CAAC,CAsBvD;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACvC,EAAE,EAAE,iBAAiB,EACrB,cAAc,EAAE,IAAI,CAAC,uBAAuB,EAAE,iBAAiB,GAAG,aAAa,CAAC,EAChF,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;IAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAE,CAAC,CAwBvE"}
|
|
@@ -243,13 +243,13 @@ class SerializedStateManager {
|
|
|
243
243
|
* Assembles and serializes the {@link IPendingContainerState} for the container,
|
|
244
244
|
* to be stored and used to rehydrate the container at a later time.
|
|
245
245
|
*/
|
|
246
|
-
async getPendingLocalState(
|
|
246
|
+
async getPendingLocalState(clientId, runtime, resolvedUrl) {
|
|
247
247
|
return internal_4.PerformanceEvent.timedExecAsync(this.mc.logger, {
|
|
248
248
|
eventName: "getPendingLocalState",
|
|
249
249
|
details: {
|
|
250
|
-
notifyImminentClosure:
|
|
251
|
-
sessionExpiryTimerStarted:
|
|
252
|
-
snapshotSequenceNumber:
|
|
250
|
+
notifyImminentClosure: false,
|
|
251
|
+
sessionExpiryTimerStarted: undefined,
|
|
252
|
+
snapshotSequenceNumber: undefined,
|
|
253
253
|
processedOpsSize: this.processedOps.length,
|
|
254
254
|
},
|
|
255
255
|
clientId,
|
|
@@ -259,7 +259,7 @@ class SerializedStateManager {
|
|
|
259
259
|
}
|
|
260
260
|
(0, internal_1.assert)(this.snapshot !== undefined, 0x8e5 /* no base data */);
|
|
261
261
|
const pendingRuntimeState = await runtime.getPendingLocalState({
|
|
262
|
-
|
|
262
|
+
notifyImminentClosure: false,
|
|
263
263
|
snapshotSequenceNumber: this.snapshot.snapshotSequenceNumber,
|
|
264
264
|
sessionExpiryTimerStarted: this.snapshot.snapshotFetchedTime,
|
|
265
265
|
});
|