@fluidframework/container-loader 2.0.0-rc.4.0.6 → 2.0.0-rc.5.0.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 +21 -0
- package/api-extractor/api-extractor-lint-bundle.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-public.esm.json +5 -0
- package/api-extractor.json +1 -1
- package/api-report/{container-loader.api.md → container-loader.alpha.api.md} +60 -17
- package/api-report/container-loader.beta.api.md +44 -0
- package/api-report/container-loader.public.api.md +44 -0
- package/biome.jsonc +4 -0
- package/dist/attachment.d.ts +1 -1
- package/dist/attachment.d.ts.map +1 -1
- package/dist/attachment.js.map +1 -1
- package/dist/audience.d.ts +3 -2
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js.map +1 -1
- package/dist/catchUpMonitor.d.ts.map +1 -1
- package/dist/catchUpMonitor.js.map +1 -1
- package/dist/connectionManager.d.ts +4 -3
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +7 -8
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +1 -1
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +8 -4
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +3 -2
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +78 -80
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +2 -2
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +5 -4
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +24 -8
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +2 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/debugLogger.d.ts.map +1 -1
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +6 -5
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +15 -16
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/deltaQueue.js.map +1 -1
- package/dist/disposal.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +5 -0
- package/dist/loadPaused.js.map +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/dist/memoryBlobStorage.d.ts.map +1 -1
- package/dist/memoryBlobStorage.js +4 -3
- package/dist/memoryBlobStorage.js.map +1 -1
- package/dist/noopHeuristic.d.ts +1 -1
- package/dist/noopHeuristic.d.ts.map +1 -1
- package/dist/noopHeuristic.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/protocol/index.d.ts +7 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +12 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/protocol.d.ts +52 -0
- package/dist/protocol/protocol.d.ts.map +1 -0
- package/dist/protocol/protocol.js +112 -0
- package/dist/protocol/protocol.js.map +1 -0
- package/dist/protocol/quorum.d.ts +185 -0
- package/dist/protocol/quorum.d.ts.map +1 -0
- package/dist/protocol/quorum.js +419 -0
- package/dist/protocol/quorum.js.map +1 -0
- package/dist/protocol.d.ts +4 -4
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +6 -6
- package/dist/protocol.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts +16 -9
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js +18 -9
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/quorum.d.ts +1 -1
- package/dist/quorum.d.ts.map +1 -1
- package/dist/quorum.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +2 -2
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +3 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/serializedStateManager.d.ts +5 -5
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js +16 -12
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/utils.d.ts +2 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +7 -7
- package/dist/utils.js.map +1 -1
- package/lib/attachment.d.ts +1 -1
- package/lib/attachment.d.ts.map +1 -1
- package/lib/attachment.js.map +1 -1
- package/lib/audience.d.ts +3 -2
- package/lib/audience.d.ts.map +1 -1
- package/lib/audience.js.map +1 -1
- package/lib/catchUpMonitor.d.ts.map +1 -1
- package/lib/catchUpMonitor.js.map +1 -1
- package/lib/connectionManager.d.ts +4 -3
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +6 -7
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +1 -1
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +8 -4
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +3 -2
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +20 -22
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +2 -2
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +5 -4
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +24 -8
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +2 -2
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/debugLogger.d.ts.map +1 -1
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +6 -5
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +8 -9
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaQueue.d.ts.map +1 -1
- package/lib/deltaQueue.js.map +1 -1
- package/lib/disposal.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +5 -0
- package/lib/loadPaused.js.map +1 -1
- package/lib/loader.d.ts +1 -1
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/lib/memoryBlobStorage.d.ts.map +1 -1
- package/lib/memoryBlobStorage.js +4 -3
- package/lib/memoryBlobStorage.js.map +1 -1
- package/lib/noopHeuristic.d.ts +1 -1
- package/lib/noopHeuristic.d.ts.map +1 -1
- package/lib/noopHeuristic.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/protocol/index.d.ts +7 -0
- package/lib/protocol/index.d.ts.map +1 -0
- package/lib/protocol/index.js +7 -0
- package/lib/protocol/index.js.map +1 -0
- package/lib/protocol/protocol.d.ts +52 -0
- package/lib/protocol/protocol.d.ts.map +1 -0
- package/lib/protocol/protocol.js +108 -0
- package/lib/protocol/protocol.js.map +1 -0
- package/lib/protocol/quorum.d.ts +185 -0
- package/lib/protocol/quorum.d.ts.map +1 -0
- package/lib/protocol/quorum.js +410 -0
- package/lib/protocol/quorum.js.map +1 -0
- package/lib/protocol.d.ts +4 -4
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +2 -2
- package/lib/protocol.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts +16 -9
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js +18 -9
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/quorum.d.ts +1 -1
- package/lib/quorum.d.ts.map +1 -1
- package/lib/quorum.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +2 -2
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +3 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/serializedStateManager.d.ts +5 -5
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js +17 -13
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/utils.d.ts +2 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +3 -3
- package/lib/utils.js.map +1 -1
- package/package.json +32 -31
- package/src/attachment.ts +8 -5
- package/src/audience.ts +4 -7
- package/src/catchUpMonitor.ts +4 -2
- package/src/connectionManager.ts +27 -24
- package/src/connectionStateHandler.ts +11 -10
- package/src/container.ts +64 -72
- package/src/containerContext.ts +5 -5
- package/src/containerStorageAdapter.ts +37 -22
- package/src/contracts.ts +4 -5
- package/src/debugLogger.ts +2 -3
- package/src/deltaManager.ts +13 -18
- package/src/deltaQueue.ts +4 -1
- package/src/error.ts +4 -1
- package/src/index.ts +7 -0
- package/src/loadPaused.ts +1 -1
- package/src/loader.ts +1 -1
- package/src/memoryBlobStorage.ts +6 -4
- package/src/noopHeuristic.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/protocol/README.md +10 -0
- package/src/protocol/index.ts +16 -0
- package/src/protocol/protocol.ts +185 -0
- package/src/protocol/quorum.ts +577 -0
- package/src/protocol.ts +6 -9
- package/src/protocolTreeDocumentStorageService.ts +30 -13
- package/src/quorum.ts +1 -1
- package/src/retriableDocumentStorageService.ts +6 -7
- package/src/serializedStateManager.ts +33 -34
- package/src/utils.ts +16 -10
- package/tsconfig.json +2 -0
- package/tsdoc.json +4 -0
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
|
+
import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
9
|
import {
|
|
9
10
|
FetchSource,
|
|
10
11
|
IDocumentStorageService,
|
|
@@ -12,15 +13,11 @@ import {
|
|
|
12
13
|
ISnapshot,
|
|
13
14
|
ISnapshotFetchOptions,
|
|
14
15
|
ISummaryContext,
|
|
15
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
16
|
-
import { runWithRetry } from "@fluidframework/driver-utils/internal";
|
|
17
|
-
import {
|
|
18
16
|
ICreateBlobResponse,
|
|
19
17
|
ISnapshotTree,
|
|
20
|
-
ISummaryHandle,
|
|
21
|
-
ISummaryTree,
|
|
22
18
|
IVersion,
|
|
23
|
-
} from "@fluidframework/
|
|
19
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
20
|
+
import { runWithRetry } from "@fluidframework/driver-utils/internal";
|
|
24
21
|
import {
|
|
25
22
|
ITelemetryLoggerExt,
|
|
26
23
|
GenericError,
|
|
@@ -34,7 +31,9 @@ export class RetriableDocumentStorageService implements IDocumentStorageService,
|
|
|
34
31
|
private readonly internalStorageServiceP: Promise<IDocumentStorageService>,
|
|
35
32
|
private readonly logger: ITelemetryLoggerExt,
|
|
36
33
|
) {
|
|
37
|
-
this.internalStorageServiceP
|
|
34
|
+
this.internalStorageServiceP
|
|
35
|
+
.then((s) => (this.internalStorageService = s))
|
|
36
|
+
.catch(() => {});
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
public get policies(): IDocumentStorageServicePolicies | undefined {
|
|
@@ -3,33 +3,39 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { stringToBuffer } from "@fluid-internal/client-utils";
|
|
6
7
|
import {
|
|
7
8
|
IGetPendingLocalStateProps,
|
|
8
9
|
IRuntime,
|
|
9
10
|
} from "@fluidframework/container-definitions/internal";
|
|
10
|
-
import {
|
|
11
|
+
import type {
|
|
12
|
+
IEventProvider,
|
|
13
|
+
IEvent,
|
|
14
|
+
ITelemetryBaseLogger,
|
|
15
|
+
} from "@fluidframework/core-interfaces";
|
|
11
16
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
12
17
|
import {
|
|
13
18
|
FetchSource,
|
|
14
19
|
IDocumentStorageService,
|
|
15
20
|
IResolvedUrl,
|
|
16
21
|
ISnapshot,
|
|
17
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
18
|
-
import { getSnapshotTree } from "@fluidframework/driver-utils/internal";
|
|
19
|
-
import {
|
|
20
22
|
type IDocumentAttributes,
|
|
21
|
-
ISequencedDocumentMessage,
|
|
22
23
|
ISnapshotTree,
|
|
23
24
|
IVersion,
|
|
24
|
-
|
|
25
|
+
ISequencedDocumentMessage,
|
|
26
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
27
|
+
import { getSnapshotTree } from "@fluidframework/driver-utils/internal";
|
|
25
28
|
import {
|
|
26
29
|
MonitoringContext,
|
|
27
30
|
PerformanceEvent,
|
|
28
31
|
UsageError,
|
|
29
32
|
createChildMonitoringContext,
|
|
30
33
|
} from "@fluidframework/telemetry-utils/internal";
|
|
31
|
-
|
|
32
|
-
import {
|
|
34
|
+
|
|
35
|
+
import {
|
|
36
|
+
ISerializableBlobContents,
|
|
37
|
+
getBlobContentsFromTree,
|
|
38
|
+
} from "./containerStorageAdapter.js";
|
|
33
39
|
import { convertSnapshotToSnapshotInfo, getDocumentAttributes } from "./utils.js";
|
|
34
40
|
|
|
35
41
|
/**
|
|
@@ -148,12 +154,16 @@ export class SerializedStateManager {
|
|
|
148
154
|
private readonly _offlineLoadEnabled: boolean,
|
|
149
155
|
containerEvent: IEventProvider<ISerializerEvent>,
|
|
150
156
|
private readonly containerDirty: () => boolean,
|
|
157
|
+
private readonly supportGetSnapshotApi: () => boolean,
|
|
151
158
|
) {
|
|
152
159
|
this.mc = createChildMonitoringContext({
|
|
153
160
|
logger: subLogger,
|
|
154
161
|
namespace: "serializedStateManager",
|
|
155
162
|
});
|
|
156
163
|
|
|
164
|
+
// special case handle. Obtaining the last saved op seq num to avoid
|
|
165
|
+
// refreshing the snapshot before we have processed it. It could cause
|
|
166
|
+
// a subsequent stashing to have a newer snapshot than allowed.
|
|
157
167
|
if (pendingLocalState && pendingLocalState.savedOps.length > 0) {
|
|
158
168
|
const savedOpsSize = pendingLocalState.savedOps.length;
|
|
159
169
|
this.lastSavedOpSequenceNumber =
|
|
@@ -193,15 +203,12 @@ export class SerializedStateManager {
|
|
|
193
203
|
* @param supportGetSnapshotApi - a boolean indicating whether to use the fetchISnapshot or fetchISnapshotTree.
|
|
194
204
|
* @returns The snapshot to boot the container from
|
|
195
205
|
*/
|
|
196
|
-
public async fetchSnapshot(
|
|
197
|
-
specifiedVersion: string | undefined,
|
|
198
|
-
supportGetSnapshotApi: boolean,
|
|
199
|
-
) {
|
|
206
|
+
public async fetchSnapshot(specifiedVersion: string | undefined) {
|
|
200
207
|
if (this.pendingLocalState === undefined) {
|
|
201
208
|
const { baseSnapshot, version } = await getSnapshot(
|
|
202
209
|
this.mc,
|
|
203
210
|
this.storageAdapter,
|
|
204
|
-
supportGetSnapshotApi,
|
|
211
|
+
this.supportGetSnapshotApi(),
|
|
205
212
|
specifiedVersion,
|
|
206
213
|
);
|
|
207
214
|
const baseSnapshotTree: ISnapshotTree | undefined = getSnapshotTree(baseSnapshot);
|
|
@@ -211,10 +218,7 @@ export class SerializedStateManager {
|
|
|
211
218
|
baseSnapshotTree,
|
|
212
219
|
this.storageAdapter,
|
|
213
220
|
);
|
|
214
|
-
const attributes = await getDocumentAttributes(
|
|
215
|
-
this.storageAdapter,
|
|
216
|
-
baseSnapshotTree,
|
|
217
|
-
);
|
|
221
|
+
const attributes = await getDocumentAttributes(this.storageAdapter, baseSnapshotTree);
|
|
218
222
|
this.snapshot = {
|
|
219
223
|
baseSnapshot: baseSnapshotTree,
|
|
220
224
|
snapshotBlobs,
|
|
@@ -236,7 +240,7 @@ export class SerializedStateManager {
|
|
|
236
240
|
this.mc.config.getBoolean("Fluid.Container.enableOfflineSnapshotRefresh") === true
|
|
237
241
|
) {
|
|
238
242
|
// Don't block on the refresh snapshot call - it is for the next time we serialize, not booting this incarnation
|
|
239
|
-
this.refreshSnapshotP = this.refreshLatestSnapshot(supportGetSnapshotApi);
|
|
243
|
+
this.refreshSnapshotP = this.refreshLatestSnapshot(this.supportGetSnapshotApi());
|
|
240
244
|
this.refreshSnapshotP.catch((e) => {
|
|
241
245
|
this.mc.logger.sendErrorEvent({
|
|
242
246
|
eventName: "RefreshLatestSnapshotFailed",
|
|
@@ -330,10 +334,7 @@ export class SerializedStateManager {
|
|
|
330
334
|
} else if (snapshotSequenceNumber <= lastProcessedOpSequenceNumber) {
|
|
331
335
|
// Snapshot seq num is between the first and last processed op.
|
|
332
336
|
// Remove the ops that are already part of the snapshot
|
|
333
|
-
this.processedOps.splice(
|
|
334
|
-
0,
|
|
335
|
-
snapshotSequenceNumber - firstProcessedOpSequenceNumber + 1,
|
|
336
|
-
);
|
|
337
|
+
this.processedOps.splice(0, snapshotSequenceNumber - firstProcessedOpSequenceNumber + 1);
|
|
337
338
|
this.snapshot = this.latestSnapshot;
|
|
338
339
|
this.latestSnapshot = undefined;
|
|
339
340
|
this.mc.logger.sendTelemetryEvent({
|
|
@@ -341,9 +342,7 @@ export class SerializedStateManager {
|
|
|
341
342
|
snapshotSequenceNumber,
|
|
342
343
|
firstProcessedOpSequenceNumber,
|
|
343
344
|
newFirstProcessedOpSequenceNumber:
|
|
344
|
-
this.processedOps.length === 0
|
|
345
|
-
? undefined
|
|
346
|
-
: this.processedOps[0].sequenceNumber,
|
|
345
|
+
this.processedOps.length === 0 ? undefined : this.processedOps[0].sequenceNumber,
|
|
347
346
|
});
|
|
348
347
|
}
|
|
349
348
|
}
|
|
@@ -389,15 +388,17 @@ export class SerializedStateManager {
|
|
|
389
388
|
this.mc.logger,
|
|
390
389
|
{
|
|
391
390
|
eventName: "getPendingLocalState",
|
|
392
|
-
|
|
393
|
-
|
|
391
|
+
details: {
|
|
392
|
+
notifyImminentClosure: props.notifyImminentClosure,
|
|
393
|
+
sessionExpiryTimerStarted: props.sessionExpiryTimerStarted,
|
|
394
|
+
snapshotSequenceNumber: props.snapshotSequenceNumber,
|
|
395
|
+
processedOpsSize: this.processedOps.length,
|
|
396
|
+
},
|
|
394
397
|
clientId,
|
|
395
398
|
},
|
|
396
399
|
async () => {
|
|
397
400
|
if (!this.offlineLoadEnabled) {
|
|
398
|
-
throw new UsageError(
|
|
399
|
-
"Can't get pending local state unless offline load is enabled",
|
|
400
|
-
);
|
|
401
|
+
throw new UsageError("Can't get pending local state unless offline load is enabled");
|
|
401
402
|
}
|
|
402
403
|
assert(this.snapshot !== undefined, 0x8e5 /* no base data */);
|
|
403
404
|
const pendingRuntimeState = await runtime.getPendingLocalState({
|
|
@@ -420,9 +421,7 @@ export class SerializedStateManager {
|
|
|
420
421
|
pendingRuntimeState,
|
|
421
422
|
baseSnapshot: this.snapshot.baseSnapshot,
|
|
422
423
|
snapshotBlobs: this.snapshot.snapshotBlobs,
|
|
423
|
-
loadedGroupIdSnapshots: hasGroupIdSnapshots
|
|
424
|
-
? loadedGroupIdSnapshots
|
|
425
|
-
: undefined,
|
|
424
|
+
loadedGroupIdSnapshots: hasGroupIdSnapshots ? loadedGroupIdSnapshots : undefined,
|
|
426
425
|
savedOps: this.processedOps,
|
|
427
426
|
url: resolvedUrl.url,
|
|
428
427
|
clientId,
|
|
@@ -521,7 +520,7 @@ export async function fetchISnapshot(
|
|
|
521
520
|
: {
|
|
522
521
|
id: snapshot.snapshotTree.id,
|
|
523
522
|
treeId: snapshot.snapshotTree.id,
|
|
524
|
-
|
|
523
|
+
};
|
|
525
524
|
|
|
526
525
|
if (snapshot === undefined && specifiedVersion !== undefined) {
|
|
527
526
|
mc.logger.sendErrorEvent({
|
package/src/utils.ts
CHANGED
|
@@ -3,9 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Uint8ArrayToString,
|
|
8
|
+
bufferToString,
|
|
9
|
+
stringToBuffer,
|
|
10
|
+
} from "@fluid-internal/client-utils";
|
|
7
11
|
import { assert, compareArrays, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
8
|
-
import {
|
|
12
|
+
import { ISummaryTree, SummaryType } from "@fluidframework/driver-definitions";
|
|
13
|
+
import {
|
|
14
|
+
DriverErrorTypes,
|
|
15
|
+
IDocumentAttributes,
|
|
16
|
+
ISnapshotTree,
|
|
17
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
9
18
|
import {
|
|
10
19
|
IDocumentStorageService,
|
|
11
20
|
type ISnapshot,
|
|
@@ -16,12 +25,6 @@ import {
|
|
|
16
25
|
isCombinedAppAndProtocolSummary,
|
|
17
26
|
readAndParse,
|
|
18
27
|
} from "@fluidframework/driver-utils/internal";
|
|
19
|
-
import {
|
|
20
|
-
IDocumentAttributes,
|
|
21
|
-
ISnapshotTree,
|
|
22
|
-
ISummaryTree,
|
|
23
|
-
SummaryType,
|
|
24
|
-
} from "@fluidframework/protocol-definitions";
|
|
25
28
|
import { LoggingError, UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
26
29
|
import { v4 as uuid } from "uuid";
|
|
27
30
|
|
|
@@ -90,7 +93,7 @@ export function tryParseCompatibleResolvedUrl(url: string): IParsedUrl | undefin
|
|
|
90
93
|
query,
|
|
91
94
|
// URLSearchParams returns null if the param is not provided.
|
|
92
95
|
version: parsed.searchParams.get("version") ?? undefined,
|
|
93
|
-
|
|
96
|
+
}
|
|
94
97
|
: undefined;
|
|
95
98
|
}
|
|
96
99
|
|
|
@@ -181,7 +184,10 @@ function convertSummaryToSnapshotAndBlobs(summary: ISummaryTree): SnapshotWithBl
|
|
|
181
184
|
* @param snapshot - ISnapshot
|
|
182
185
|
*/
|
|
183
186
|
export function convertSnapshotToSnapshotInfo(snapshot: ISnapshot): ISnapshotInfo {
|
|
184
|
-
assert(
|
|
187
|
+
assert(
|
|
188
|
+
snapshot.sequenceNumber !== undefined,
|
|
189
|
+
0x93a /* Snapshot sequence number is missing */,
|
|
190
|
+
);
|
|
185
191
|
const snapshotBlobs: ISerializableBlobContents = {};
|
|
186
192
|
for (const [blobId, arrayBufferLike] of snapshot.blobContents.entries()) {
|
|
187
193
|
snapshotBlobs[blobId] = bufferToString(arrayBufferLike, "utf8");
|
package/tsconfig.json
CHANGED
package/tsdoc.json
ADDED