@fluidframework/container-loader 2.63.0-359734 → 2.63.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 +4 -0
- package/api-report/container-loader.legacy.alpha.api.md +31 -0
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +12 -8
- package/dist/container.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +7 -13
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +9 -14
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/createAndLoadContainerUtils.d.ts +13 -0
- package/dist/createAndLoadContainerUtils.d.ts.map +1 -1
- package/dist/createAndLoadContainerUtils.js +118 -2
- package/dist/createAndLoadContainerUtils.js.map +1 -1
- package/dist/frozenServices.d.ts +10 -1
- package/dist/frozenServices.d.ts.map +1 -1
- package/dist/frozenServices.js +24 -4
- package/dist/frozenServices.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/legacyAlpha.d.ts +7 -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 +10 -6
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js +76 -77
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/summarizerResultTypes.d.ts +96 -0
- package/dist/summarizerResultTypes.d.ts.map +1 -0
- package/dist/summarizerResultTypes.js +9 -0
- package/dist/summarizerResultTypes.js.map +1 -0
- package/dist/utils.d.ts +4 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +14 -13
- package/dist/utils.js.map +1 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +13 -9
- package/lib/container.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +7 -13
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +10 -15
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/createAndLoadContainerUtils.d.ts +13 -0
- package/lib/createAndLoadContainerUtils.d.ts.map +1 -1
- package/lib/createAndLoadContainerUtils.js +117 -2
- package/lib/createAndLoadContainerUtils.js.map +1 -1
- package/lib/frozenServices.d.ts +10 -1
- package/lib/frozenServices.d.ts.map +1 -1
- package/lib/frozenServices.js +20 -1
- package/lib/frozenServices.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/legacyAlpha.d.ts +7 -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 +10 -6
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js +78 -79
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/summarizerResultTypes.d.ts +96 -0
- package/lib/summarizerResultTypes.d.ts.map +1 -0
- package/lib/summarizerResultTypes.js +6 -0
- package/lib/summarizerResultTypes.js.map +1 -0
- package/lib/utils.d.ts +4 -5
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +15 -14
- package/lib/utils.js.map +1 -1
- package/package.json +11 -11
- package/src/container.ts +19 -14
- package/src/containerStorageAdapter.ts +14 -18
- package/src/createAndLoadContainerUtils.ts +176 -2
- package/src/frozenServices.ts +28 -2
- package/src/index.ts +8 -0
- package/src/packageVersion.ts +1 -1
- package/src/serializedStateManager.ts +118 -109
- package/src/summarizerResultTypes.ts +115 -0
- package/src/utils.ts +20 -20
package/lib/index.d.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { ConnectionState } from "./connectionState.js";
|
|
6
6
|
export { type ContainerAlpha, waitContainerToCatchUp, asLegacyAlpha } from "./container.js";
|
|
7
|
-
export {
|
|
7
|
+
export { createFrozenDocumentServiceFactory } from "./frozenServices.js";
|
|
8
|
+
export { createDetachedContainer, loadExistingContainer, rehydrateDetachedContainer, loadFrozenContainerFromPendingState, loadSummarizerContainerAndMakeSummary, type ICreateAndLoadContainerProps, type ICreateDetachedContainerProps, type ILoadExistingContainerProps, type ILoadSummarizerContainerProps, type IRehydrateDetachedContainerProps, type ILoadFrozenContainerFromPendingStateProps, } from "./createAndLoadContainerUtils.js";
|
|
9
|
+
export type { LoadSummarizerSummaryResult, OnDemandSummaryResults, SummaryStage, } from "./summarizerResultTypes.js";
|
|
8
10
|
export { type ICodeDetailsLoader, type IFluidModuleWithDetails, type ILoaderProps, type ILoaderServices, Loader, } from "./loader.js";
|
|
9
11
|
export { driverSupportRequirementsForLoader, loaderCoreCompatDetails, runtimeSupportRequirementsForLoader, loaderCompatDetailsForRuntime, } from "./loaderLayerCompatState.js";
|
|
10
12
|
export { loadContainerPaused } from "./loadPaused.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,GAC9C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,GACN,MAAM,aAAa,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EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACN,6BAA6B,EAC7B,KAAK,UAAU,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { ConnectionState } from "./connectionState.js";
|
|
6
6
|
export { waitContainerToCatchUp, asLegacyAlpha } from "./container.js";
|
|
7
|
-
export {
|
|
7
|
+
export { createFrozenDocumentServiceFactory } from "./frozenServices.js";
|
|
8
|
+
export { createDetachedContainer, loadExistingContainer, rehydrateDetachedContainer, loadFrozenContainerFromPendingState, loadSummarizerContainerAndMakeSummary, } from "./createAndLoadContainerUtils.js";
|
|
8
9
|
export { Loader, } from "./loader.js";
|
|
9
10
|
export { driverSupportRequirementsForLoader, loaderCoreCompatDetails, runtimeSupportRequirementsForLoader, loaderCompatDetailsForRuntime, } from "./loaderLayerCompatState.js";
|
|
10
11
|
export { loadContainerPaused } from "./loadPaused.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAuB,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAuB,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,GAOrC,MAAM,kCAAkC,CAAC;AAM1C,OAAO,EAKN,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACN,6BAA6B,GAE7B,MAAM,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { type ContainerAlpha, waitContainerToCatchUp, asLegacyAlpha } from \"./container.js\";\nexport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nexport {\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tloadFrozenContainerFromPendingState,\n\tloadSummarizerContainerAndMakeSummary,\n\ttype ICreateAndLoadContainerProps,\n\ttype ICreateDetachedContainerProps,\n\ttype ILoadExistingContainerProps,\n\ttype ILoadSummarizerContainerProps,\n\ttype IRehydrateDetachedContainerProps,\n\ttype ILoadFrozenContainerFromPendingStateProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummaryStage,\n} from \"./summarizerResultTypes.js\";\nexport {\n\ttype ICodeDetailsLoader,\n\ttype IFluidModuleWithDetails,\n\ttype ILoaderProps,\n\ttype ILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport {\n\tdriverSupportRequirementsForLoader,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirementsForLoader,\n\tloaderCompatDetailsForRuntime,\n} from \"./loaderLayerCompatState.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport type { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\ttype IParsedUrl,\n} from \"./utils.js\";\nexport type {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\n"]}
|
package/lib/legacyAlpha.d.ts
CHANGED
|
@@ -42,7 +42,13 @@ export {
|
|
|
42
42
|
// #region @legacyAlpha APIs
|
|
43
43
|
ContainerAlpha,
|
|
44
44
|
ILoadFrozenContainerFromPendingStateProps,
|
|
45
|
+
ILoadSummarizerContainerProps,
|
|
46
|
+
LoadSummarizerSummaryResult,
|
|
47
|
+
OnDemandSummaryResults,
|
|
48
|
+
SummaryStage,
|
|
45
49
|
asLegacyAlpha,
|
|
46
|
-
|
|
50
|
+
createFrozenDocumentServiceFactory,
|
|
51
|
+
loadFrozenContainerFromPendingState,
|
|
52
|
+
loadSummarizerContainerAndMakeSummary
|
|
47
53
|
// #endregion
|
|
48
54
|
} from "./index.js";
|
package/lib/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.63.0
|
|
8
|
+
export declare const pkgVersion = "2.63.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/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,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.63.0\";\n"]}
|
|
@@ -7,7 +7,7 @@ import type { IEventProvider, IEvent, ITelemetryBaseLogger } from "@fluidframewo
|
|
|
7
7
|
import type { IDisposable } from "@fluidframework/core-interfaces/internal";
|
|
8
8
|
import { type IDocumentStorageService, type IResolvedUrl, type ISnapshot, type IDocumentAttributes, type ISnapshotTree, type IVersion, type ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
9
9
|
import { type MonitoringContext } from "@fluidframework/telemetry-utils/internal";
|
|
10
|
-
import { type ISerializableBlobContents } from "./containerStorageAdapter.js";
|
|
10
|
+
import { type ContainerStorageAdapter, type ISerializableBlobContents } from "./containerStorageAdapter.js";
|
|
11
11
|
/**
|
|
12
12
|
* This is very similar to {@link @fluidframework/protocol-definitions/internal#ISnapshot}, but the difference is
|
|
13
13
|
* that the blobs of ISnapshot are of type ArrayBufferLike, while the blobs of this interface are serializable because
|
|
@@ -47,7 +47,7 @@ export interface IPendingContainerState extends SnapshotWithBlobs {
|
|
|
47
47
|
/**
|
|
48
48
|
* Any group snapshots (aka delay-loaded) we've downloaded from the service for this container
|
|
49
49
|
*/
|
|
50
|
-
loadedGroupIdSnapshots?: Record<string,
|
|
50
|
+
loadedGroupIdSnapshots?: Record<string, SerializedSnapshotInfo>;
|
|
51
51
|
/**
|
|
52
52
|
* All ops since base snapshot sequence number up to the latest op
|
|
53
53
|
* seen when the container was closed. Used to apply stashed (saved pending)
|
|
@@ -87,11 +87,15 @@ export interface IPendingDetachedContainerState extends SnapshotWithBlobs {
|
|
|
87
87
|
*/
|
|
88
88
|
pendingRuntimeState?: unknown;
|
|
89
89
|
}
|
|
90
|
-
export interface
|
|
90
|
+
export interface SerializedSnapshotInfo extends SnapshotWithBlobs {
|
|
91
|
+
snapshotSequenceNumber: number;
|
|
92
|
+
}
|
|
93
|
+
interface ISnapshotInfo {
|
|
91
94
|
snapshotSequenceNumber: number;
|
|
92
95
|
snapshotFetchedTime?: number | undefined;
|
|
96
|
+
snapshot: ISnapshot | ISnapshotTree;
|
|
93
97
|
}
|
|
94
|
-
export type ISerializedStateManagerDocumentStorageService = Pick<
|
|
98
|
+
export type ISerializedStateManagerDocumentStorageService = Pick<ContainerStorageAdapter, "getSnapshot" | "getSnapshotTree" | "getVersions" | "readBlob" | "cacheSnapshotBlobs"> & {
|
|
95
99
|
loadedGroupIdSnapshots: Record<string, ISnapshot>;
|
|
96
100
|
};
|
|
97
101
|
interface ISerializerEvent extends IEvent {
|
|
@@ -112,7 +116,7 @@ export declare class SerializedStateManager implements IDisposable {
|
|
|
112
116
|
private readonly supportGetSnapshotApi;
|
|
113
117
|
private readonly processedOps;
|
|
114
118
|
private readonly mc;
|
|
115
|
-
private
|
|
119
|
+
private snapshotInfo;
|
|
116
120
|
private latestSnapshot;
|
|
117
121
|
private readonly refreshTracker;
|
|
118
122
|
private lastSavedOpSequenceNumber;
|
|
@@ -151,7 +155,7 @@ export declare class SerializedStateManager implements IDisposable {
|
|
|
151
155
|
* @returns The snapshot to boot the container from
|
|
152
156
|
*/
|
|
153
157
|
fetchSnapshot(specifiedVersion: string | undefined, pendingLocalState: IPendingContainerState | undefined): Promise<{
|
|
154
|
-
|
|
158
|
+
snapshot: ISnapshot | ISnapshotTree;
|
|
155
159
|
version: IVersion | undefined;
|
|
156
160
|
attributes: IDocumentAttributes;
|
|
157
161
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializedStateManager.d.ts","sourceRoot":"","sources":["../src/serializedStateManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,KAAK,EACX,cAAc,EACd,MAAM,EACN,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,EAEN,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,yBAAyB,EAC9B,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACN,KAAK,iBAAiB,EAItB,MAAM,0CAA0C,CAAC;AAElD,OAAO,
|
|
1
|
+
{"version":3,"file":"serializedStateManager.d.ts","sourceRoot":"","sources":["../src/serializedStateManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,KAAK,EACX,cAAc,EACd,MAAM,EACN,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,EAEN,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,yBAAyB,EAC9B,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACN,KAAK,iBAAiB,EAItB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAEN,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,MAAM,8BAA8B,CAAC;AAOtC;;;;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,sBAAsB,CAAC,CAAC;IAChE;;;;OAIG;IACH,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,8BAA+B,SAAQ,iBAAiB;IACxE;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IA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AE,EAAE,iBAAiB,EACrB,cAAc,EAAE,6CAA6C,EAC7D,qBAAqB,EAAE,OAAO,GAC5B,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAyCpC;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"}
|
|
@@ -17,10 +17,10 @@ var _RefreshPromiseTracker_promise, _SerializedStateManager_snapshotRefreshEnabl
|
|
|
17
17
|
import { stringToBuffer } from "@fluid-internal/client-utils";
|
|
18
18
|
import { Timer, assert } from "@fluidframework/core-utils/internal";
|
|
19
19
|
import { FetchSource, } from "@fluidframework/driver-definitions/internal";
|
|
20
|
-
import { getSnapshotTree } from "@fluidframework/driver-utils/internal";
|
|
20
|
+
import { getSnapshotTree, isInstanceOfISnapshot } from "@fluidframework/driver-utils/internal";
|
|
21
21
|
import { PerformanceEvent, UsageError, createChildMonitoringContext, } from "@fluidframework/telemetry-utils/internal";
|
|
22
22
|
import { getBlobContentsFromTree, } from "./containerStorageAdapter.js";
|
|
23
|
-
import {
|
|
23
|
+
import { convertISnapshotToSnapshotWithBlobs, convertSnapshotToSnapshotInfo, getDocumentAttributes, } from "./utils.js";
|
|
24
24
|
class RefreshPromiseTracker {
|
|
25
25
|
get hasPromise() {
|
|
26
26
|
return __classPrivateFieldGet(this, _RefreshPromiseTracker_promise, "f") !== undefined;
|
|
@@ -78,8 +78,9 @@ export class SerializedStateManager {
|
|
|
78
78
|
namespace: "serializedStateManager",
|
|
79
79
|
});
|
|
80
80
|
this.snapshotRefreshTimeoutMs = snapshotRefreshTimeoutMs ?? this.snapshotRefreshTimeoutMs;
|
|
81
|
-
__classPrivateFieldSet(this, _SerializedStateManager_snapshotRefreshEnabled,
|
|
82
|
-
this.mc.config.getBoolean("Fluid.Container.
|
|
81
|
+
__classPrivateFieldSet(this, _SerializedStateManager_snapshotRefreshEnabled, _offlineLoadEnabled &&
|
|
82
|
+
(this.mc.config.getBoolean("Fluid.Container.enableOfflineSnapshotRefresh") ??
|
|
83
|
+
this.mc.config.getBoolean("Fluid.Container.enableOfflineFull")) === true, "f");
|
|
83
84
|
this.refreshTimer = __classPrivateFieldGet(this, _SerializedStateManager_snapshotRefreshEnabled, "f")
|
|
84
85
|
? new Timer(this.snapshotRefreshTimeoutMs, () => this.tryRefreshSnapshot())
|
|
85
86
|
: undefined;
|
|
@@ -130,54 +131,49 @@ export class SerializedStateManager {
|
|
|
130
131
|
async fetchSnapshot(specifiedVersion, pendingLocalState) {
|
|
131
132
|
this.verifyNotDisposed();
|
|
132
133
|
if (pendingLocalState === undefined) {
|
|
133
|
-
const {
|
|
134
|
-
const baseSnapshotTree = getSnapshotTree(
|
|
134
|
+
const { snapshot, version } = await getSnapshot(this.mc, this.storageAdapter, this.supportGetSnapshotApi(), specifiedVersion);
|
|
135
|
+
const baseSnapshotTree = getSnapshotTree(snapshot);
|
|
135
136
|
const attributes = await getDocumentAttributes(this.storageAdapter, baseSnapshotTree);
|
|
136
|
-
// non-interactive clients will not have any pending state we want to save
|
|
137
137
|
if (this.offlineLoadEnabled) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
snapshotBlobs,
|
|
144
|
-
snapshotSequenceNumber: attributes.sequenceNumber,
|
|
145
|
-
};
|
|
146
|
-
this.refreshTimer?.start();
|
|
147
|
-
return attributes.sequenceNumber;
|
|
148
|
-
}));
|
|
138
|
+
this.refreshTimer?.start();
|
|
139
|
+
this.snapshotInfo = {
|
|
140
|
+
snapshot,
|
|
141
|
+
snapshotSequenceNumber: attributes.sequenceNumber,
|
|
142
|
+
};
|
|
149
143
|
}
|
|
150
|
-
return {
|
|
144
|
+
return { snapshot, version, attributes };
|
|
151
145
|
}
|
|
152
146
|
else {
|
|
153
147
|
const { baseSnapshot, snapshotBlobs, savedOps } = pendingLocalState;
|
|
154
|
-
// special case handle. Obtaining the last saved op seq num to avoid
|
|
155
|
-
// refreshing the snapshot before we have processed it. It could cause
|
|
156
|
-
// a subsequent stashing to have a newer snapshot than allowed.
|
|
157
|
-
if (savedOps.length > 0) {
|
|
158
|
-
const savedOpsSize = savedOps.length;
|
|
159
|
-
this.lastSavedOpSequenceNumber = savedOps[savedOpsSize - 1].sequenceNumber;
|
|
160
|
-
}
|
|
161
|
-
const attributes = await getDocumentAttributes(this.storageAdapter, baseSnapshot);
|
|
162
|
-
this.snapshot = {
|
|
163
|
-
baseSnapshot,
|
|
164
|
-
snapshotBlobs,
|
|
165
|
-
snapshotSequenceNumber: attributes.sequenceNumber,
|
|
166
|
-
};
|
|
167
|
-
this.tryRefreshSnapshot();
|
|
168
148
|
const blobContents = new Map();
|
|
169
149
|
for (const [id, value] of Object.entries(snapshotBlobs)) {
|
|
170
150
|
blobContents.set(id, stringToBuffer(value, "utf8"));
|
|
171
151
|
}
|
|
172
|
-
|
|
173
|
-
|
|
152
|
+
this.storageAdapter.cacheSnapshotBlobs(blobContents);
|
|
153
|
+
const attributes = await getDocumentAttributes(this.storageAdapter, baseSnapshot);
|
|
154
|
+
const snapshot = {
|
|
155
|
+
sequenceNumber: attributes.sequenceNumber,
|
|
174
156
|
snapshotTree: baseSnapshot,
|
|
175
157
|
blobContents,
|
|
176
158
|
latestSequenceNumber: undefined,
|
|
177
159
|
ops: [],
|
|
178
160
|
snapshotFormatV: 1,
|
|
179
161
|
};
|
|
180
|
-
|
|
162
|
+
if (this.offlineLoadEnabled) {
|
|
163
|
+
// special case handle. Obtaining the last saved op seq num to avoid
|
|
164
|
+
// refreshing the snapshot before we have processed it. It could cause
|
|
165
|
+
// a subsequent stashing to have a newer snapshot than allowed.
|
|
166
|
+
if (savedOps.length > 0) {
|
|
167
|
+
const savedOpsSize = savedOps.length;
|
|
168
|
+
this.lastSavedOpSequenceNumber = savedOps[savedOpsSize - 1].sequenceNumber;
|
|
169
|
+
}
|
|
170
|
+
this.snapshotInfo = {
|
|
171
|
+
snapshot,
|
|
172
|
+
snapshotSequenceNumber: attributes.sequenceNumber,
|
|
173
|
+
};
|
|
174
|
+
this.tryRefreshSnapshot();
|
|
175
|
+
}
|
|
176
|
+
return { snapshot, version: undefined, attributes };
|
|
181
177
|
}
|
|
182
178
|
}
|
|
183
179
|
tryRefreshSnapshot() {
|
|
@@ -242,7 +238,7 @@ export class SerializedStateManager {
|
|
|
242
238
|
snapshotSequenceNumber,
|
|
243
239
|
firstProcessedOpSequenceNumber,
|
|
244
240
|
lastProcessedOpSequenceNumber,
|
|
245
|
-
stashedSnapshotSequenceNumber: this.
|
|
241
|
+
stashedSnapshotSequenceNumber: this.snapshotInfo?.snapshotSequenceNumber,
|
|
246
242
|
});
|
|
247
243
|
this.latestSnapshot = undefined;
|
|
248
244
|
this.refreshTimer?.restart();
|
|
@@ -251,7 +247,7 @@ export class SerializedStateManager {
|
|
|
251
247
|
// Snapshot seq num is between the first and last processed op.
|
|
252
248
|
// Remove the ops that are already part of the snapshot
|
|
253
249
|
this.processedOps.splice(0, snapshotSequenceNumber - firstProcessedOpSequenceNumber + 1);
|
|
254
|
-
this.
|
|
250
|
+
this.snapshotInfo = this.latestSnapshot;
|
|
255
251
|
this.latestSnapshot = undefined;
|
|
256
252
|
this.refreshTimer?.restart();
|
|
257
253
|
this.mc.logger.sendTelemetryEvent({
|
|
@@ -272,13 +268,9 @@ export class SerializedStateManager {
|
|
|
272
268
|
setInitialSnapshot(snapshot) {
|
|
273
269
|
this.verifyNotDisposed();
|
|
274
270
|
if (this.offlineLoadEnabled) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
snapshot.sequenceNumber === 0, 0x939 /* trying to set a non attachment snapshot */);
|
|
279
|
-
this.snapshot = {
|
|
280
|
-
...convertISnapshotToSnapshotWithBlobs(snapshot),
|
|
281
|
-
snapshotSequenceNumber: snapshot.sequenceNumber,
|
|
271
|
+
this.snapshotInfo = {
|
|
272
|
+
snapshot,
|
|
273
|
+
snapshotSequenceNumber: snapshot.sequenceNumber ?? 0,
|
|
282
274
|
snapshotFetchedTime: Date.now(),
|
|
283
275
|
};
|
|
284
276
|
this.refreshTimer?.start();
|
|
@@ -290,6 +282,9 @@ export class SerializedStateManager {
|
|
|
290
282
|
*/
|
|
291
283
|
async getPendingLocalState(clientId, runtime, resolvedUrl) {
|
|
292
284
|
this.verifyNotDisposed();
|
|
285
|
+
if (!this.offlineLoadEnabled) {
|
|
286
|
+
throw new UsageError("Can't get pending local state unless offline load is enabled");
|
|
287
|
+
}
|
|
293
288
|
return PerformanceEvent.timedExecAsync(this.mc.logger, {
|
|
294
289
|
eventName: "getPendingLocalState",
|
|
295
290
|
details: {
|
|
@@ -300,21 +295,11 @@ export class SerializedStateManager {
|
|
|
300
295
|
},
|
|
301
296
|
clientId,
|
|
302
297
|
}, async () => {
|
|
303
|
-
|
|
304
|
-
throw new UsageError("Can't get pending local state unless offline load is enabled");
|
|
305
|
-
}
|
|
306
|
-
if (this.snapshot === undefined && this.refreshTracker.hasPromise) {
|
|
307
|
-
// we deferred the initial download of the snapshot to not block
|
|
308
|
-
// the container load flow, so if it is not resolved
|
|
309
|
-
// and we don't have a snapshot, we will wait for the download
|
|
310
|
-
// to finish.
|
|
311
|
-
await this.refreshTracker.Promise;
|
|
312
|
-
}
|
|
313
|
-
assert(this.snapshot !== undefined, 0x8e5 /* no base data */);
|
|
298
|
+
assert(this.snapshotInfo !== undefined, 0x8e5 /* no base data */);
|
|
314
299
|
const pendingRuntimeState = await runtime.getPendingLocalState({
|
|
315
300
|
notifyImminentClosure: false,
|
|
316
|
-
snapshotSequenceNumber: this.
|
|
317
|
-
sessionExpiryTimerStarted: this.
|
|
301
|
+
snapshotSequenceNumber: this.snapshotInfo.snapshotSequenceNumber,
|
|
302
|
+
sessionExpiryTimerStarted: this.snapshotInfo.snapshotFetchedTime,
|
|
318
303
|
});
|
|
319
304
|
// This conversion is required because ArrayBufferLike doesn't survive JSON.stringify
|
|
320
305
|
const loadedGroupIdSnapshots = {};
|
|
@@ -326,11 +311,13 @@ export class SerializedStateManager {
|
|
|
326
311
|
loadedGroupIdSnapshots[groupId] = convertSnapshotToSnapshotInfo(snapshot);
|
|
327
312
|
}
|
|
328
313
|
}
|
|
314
|
+
const snapshotWithBlobs = isInstanceOfISnapshot(this.snapshotInfo.snapshot)
|
|
315
|
+
? convertISnapshotToSnapshotWithBlobs(this.snapshotInfo.snapshot)
|
|
316
|
+
: await convertSnapshotTreeToSnapshotWithBlobs(this.snapshotInfo.snapshot, this.storageAdapter);
|
|
329
317
|
const pendingState = {
|
|
330
318
|
attached: true,
|
|
331
319
|
pendingRuntimeState,
|
|
332
|
-
|
|
333
|
-
snapshotBlobs: this.snapshot.snapshotBlobs,
|
|
320
|
+
...snapshotWithBlobs,
|
|
334
321
|
loadedGroupIdSnapshots: hasGroupIdSnapshots ? loadedGroupIdSnapshots : undefined,
|
|
335
322
|
savedOps: this.processedOps,
|
|
336
323
|
url: resolvedUrl.url,
|
|
@@ -341,6 +328,13 @@ export class SerializedStateManager {
|
|
|
341
328
|
}
|
|
342
329
|
}
|
|
343
330
|
_SerializedStateManager_snapshotRefreshEnabled = new WeakMap(), _SerializedStateManager_disposed = new WeakMap();
|
|
331
|
+
async function convertSnapshotTreeToSnapshotWithBlobs(snapshot, storageAdapter) {
|
|
332
|
+
const snapshotBlobs = await getBlobContentsFromTree(snapshot, storageAdapter);
|
|
333
|
+
return {
|
|
334
|
+
baseSnapshot: snapshot,
|
|
335
|
+
snapshotBlobs,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
344
338
|
/**
|
|
345
339
|
* Retrieves the most recent snapshot and returns its info.
|
|
346
340
|
*
|
|
@@ -350,24 +344,29 @@ _SerializedStateManager_snapshotRefreshEnabled = new WeakMap(), _SerializedState
|
|
|
350
344
|
* @returns a SnapshotInfo object containing the snapshot tree, snapshot blobs and its sequence number.
|
|
351
345
|
*/
|
|
352
346
|
export async function getLatestSnapshotInfo(mc, storageAdapter, supportGetSnapshotApi) {
|
|
353
|
-
return PerformanceEvent.timedExecAsync(mc.logger, { eventName: "GetLatestSnapshotInfo" }, async () => {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
347
|
+
return PerformanceEvent.timedExecAsync(mc.logger, { eventName: "GetLatestSnapshotInfo" }, async (event) => {
|
|
348
|
+
try {
|
|
349
|
+
// get the latest non cached snapshot version
|
|
350
|
+
const specifiedVersion = await storageAdapter.getVersions(
|
|
351
|
+
// eslint-disable-next-line unicorn/no-null
|
|
352
|
+
null, 1, "getLatestSnapshotInfo", FetchSource.noCache);
|
|
353
|
+
const { snapshot: baseSnapshot } = await getSnapshot(mc, storageAdapter, supportGetSnapshotApi, specifiedVersion[0]?.id);
|
|
354
|
+
const { sequenceNumber, snapshotTree } = isInstanceOfISnapshot(baseSnapshot)
|
|
355
|
+
? baseSnapshot
|
|
356
|
+
: { snapshotTree: baseSnapshot, sequenceNumber: undefined };
|
|
357
|
+
const snapshotSequenceNumber = sequenceNumber ??
|
|
358
|
+
(await getDocumentAttributes(storageAdapter, snapshotTree).then((a) => a.sequenceNumber));
|
|
359
|
+
return {
|
|
360
|
+
snapshot: baseSnapshot,
|
|
361
|
+
snapshotSequenceNumber,
|
|
362
|
+
snapshotFetchedTime: Date.now(),
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
catch (error) {
|
|
366
|
+
event.cancel(undefined, error);
|
|
367
|
+
}
|
|
368
|
+
return undefined;
|
|
369
|
+
});
|
|
371
370
|
}
|
|
372
371
|
/**
|
|
373
372
|
* Retrieves a snapshot from the storage adapter and transforms it into an ISnapshotTree object.
|
|
@@ -383,7 +382,7 @@ async function getSnapshot(mc, storageAdapter, supportGetSnapshotApi, specifiedV
|
|
|
383
382
|
? await fetchISnapshot(mc, storageAdapter, specifiedVersion)
|
|
384
383
|
: await fetchISnapshotTree(mc, storageAdapter, specifiedVersion);
|
|
385
384
|
assert(snapshot !== undefined, 0x8e4 /* Snapshot should exist */);
|
|
386
|
-
return {
|
|
385
|
+
return { snapshot, version };
|
|
387
386
|
}
|
|
388
387
|
/**
|
|
389
388
|
* Fetches an ISnapshot from a storage adapter based on the specified version.
|