@fluidframework/container-loader 2.0.0-dev-rc.5.0.0.271717 → 2.0.0-dev-rc.5.0.0.272889
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/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/dist/attachment.d.ts.map +1 -1
- package/dist/attachment.js.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.map +1 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +3 -8
- package/dist/container.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/deltaQueue.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/memoryBlobStorage.d.ts.map +1 -1
- package/dist/memoryBlobStorage.js +2 -1
- package/dist/memoryBlobStorage.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/quorum.d.ts.map +1 -1
- package/dist/protocol/quorum.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- 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.map +1 -1
- package/dist/serializedStateManager.js +2 -6
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/lib/attachment.d.ts.map +1 -1
- package/lib/attachment.js.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.map +1 -1
- package/lib/connectionManager.js +1 -1
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +5 -10
- package/lib/container.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaQueue.d.ts.map +1 -1
- package/lib/deltaQueue.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/memoryBlobStorage.d.ts.map +1 -1
- package/lib/memoryBlobStorage.js +2 -1
- package/lib/memoryBlobStorage.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/quorum.d.ts.map +1 -1
- package/lib/protocol/quorum.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- 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.map +1 -1
- package/lib/serializedStateManager.js +3 -7
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +20 -14
- package/src/attachment.ts +7 -4
- package/src/audience.ts +1 -1
- package/src/catchUpMonitor.ts +3 -1
- package/src/connectionManager.ts +14 -4
- package/src/connectionStateHandler.ts +1 -4
- package/src/container.ts +25 -34
- package/src/containerStorageAdapter.ts +5 -4
- package/src/deltaManager.ts +7 -10
- package/src/deltaQueue.ts +4 -1
- package/src/error.ts +4 -1
- package/src/memoryBlobStorage.ts +2 -1
- package/src/packageVersion.ts +1 -1
- package/src/protocol/quorum.ts +2 -9
- package/src/protocolTreeDocumentStorageService.ts +1 -1
- package/src/retriableDocumentStorageService.ts +3 -1
- package/src/serializedStateManager.ts +15 -20
- package/src/utils.ts +10 -3
- package/tsdoc.json +4 -0
|
@@ -8,7 +8,11 @@ import {
|
|
|
8
8
|
IGetPendingLocalStateProps,
|
|
9
9
|
IRuntime,
|
|
10
10
|
} from "@fluidframework/container-definitions/internal";
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
IEventProvider,
|
|
13
|
+
IEvent,
|
|
14
|
+
ITelemetryBaseLogger,
|
|
15
|
+
} from "@fluidframework/core-interfaces";
|
|
12
16
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
13
17
|
import {
|
|
14
18
|
FetchSource,
|
|
@@ -28,7 +32,10 @@ import {
|
|
|
28
32
|
createChildMonitoringContext,
|
|
29
33
|
} from "@fluidframework/telemetry-utils/internal";
|
|
30
34
|
|
|
31
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
ISerializableBlobContents,
|
|
37
|
+
getBlobContentsFromTree,
|
|
38
|
+
} from "./containerStorageAdapter.js";
|
|
32
39
|
import { convertSnapshotToSnapshotInfo, getDocumentAttributes } from "./utils.js";
|
|
33
40
|
|
|
34
41
|
/**
|
|
@@ -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,
|
|
@@ -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
|
}
|
|
@@ -399,9 +398,7 @@ export class SerializedStateManager {
|
|
|
399
398
|
},
|
|
400
399
|
async () => {
|
|
401
400
|
if (!this.offlineLoadEnabled) {
|
|
402
|
-
throw new UsageError(
|
|
403
|
-
"Can't get pending local state unless offline load is enabled",
|
|
404
|
-
);
|
|
401
|
+
throw new UsageError("Can't get pending local state unless offline load is enabled");
|
|
405
402
|
}
|
|
406
403
|
assert(this.snapshot !== undefined, 0x8e5 /* no base data */);
|
|
407
404
|
const pendingRuntimeState = await runtime.getPendingLocalState({
|
|
@@ -424,9 +421,7 @@ export class SerializedStateManager {
|
|
|
424
421
|
pendingRuntimeState,
|
|
425
422
|
baseSnapshot: this.snapshot.baseSnapshot,
|
|
426
423
|
snapshotBlobs: this.snapshot.snapshotBlobs,
|
|
427
|
-
loadedGroupIdSnapshots: hasGroupIdSnapshots
|
|
428
|
-
? loadedGroupIdSnapshots
|
|
429
|
-
: undefined,
|
|
424
|
+
loadedGroupIdSnapshots: hasGroupIdSnapshots ? loadedGroupIdSnapshots : undefined,
|
|
430
425
|
savedOps: this.processedOps,
|
|
431
426
|
url: resolvedUrl.url,
|
|
432
427
|
clientId,
|
|
@@ -525,7 +520,7 @@ export async function fetchISnapshot(
|
|
|
525
520
|
: {
|
|
526
521
|
id: snapshot.snapshotTree.id,
|
|
527
522
|
treeId: snapshot.snapshotTree.id,
|
|
528
|
-
|
|
523
|
+
};
|
|
529
524
|
|
|
530
525
|
if (snapshot === undefined && specifiedVersion !== undefined) {
|
|
531
526
|
mc.logger.sendErrorEvent({
|
package/src/utils.ts
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
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
12
|
import { ISummaryTree, SummaryType } from "@fluidframework/driver-definitions";
|
|
9
13
|
import {
|
|
@@ -89,7 +93,7 @@ export function tryParseCompatibleResolvedUrl(url: string): IParsedUrl | undefin
|
|
|
89
93
|
query,
|
|
90
94
|
// URLSearchParams returns null if the param is not provided.
|
|
91
95
|
version: parsed.searchParams.get("version") ?? undefined,
|
|
92
|
-
|
|
96
|
+
}
|
|
93
97
|
: undefined;
|
|
94
98
|
}
|
|
95
99
|
|
|
@@ -180,7 +184,10 @@ function convertSummaryToSnapshotAndBlobs(summary: ISummaryTree): SnapshotWithBl
|
|
|
180
184
|
* @param snapshot - ISnapshot
|
|
181
185
|
*/
|
|
182
186
|
export function convertSnapshotToSnapshotInfo(snapshot: ISnapshot): ISnapshotInfo {
|
|
183
|
-
assert(
|
|
187
|
+
assert(
|
|
188
|
+
snapshot.sequenceNumber !== undefined,
|
|
189
|
+
0x93a /* Snapshot sequence number is missing */,
|
|
190
|
+
);
|
|
184
191
|
const snapshotBlobs: ISerializableBlobContents = {};
|
|
185
192
|
for (const [blobId, arrayBufferLike] of snapshot.blobContents.entries()) {
|
|
186
193
|
snapshotBlobs[blobId] = bufferToString(arrayBufferLike, "utf8");
|
package/tsdoc.json
ADDED