@fluidframework/container-loader 2.0.0-internal.3.3.1 → 2.0.0-internal.3.4.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/dist/container.d.ts +1 -1
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +33 -21
- package/dist/container.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +17 -4
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +22 -7
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +7 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +18 -1
- package/dist/loader.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/protocolTreeDocumentStorageService.d.ts +6 -2
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js +7 -6
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/container.d.ts +1 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +34 -22
- package/lib/container.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +17 -4
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +22 -7
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +7 -1
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +16 -0
- package/lib/loader.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/protocolTreeDocumentStorageService.d.ts +6 -2
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js +7 -6
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/package.json +19 -20
- package/src/container.ts +41 -26
- package/src/containerStorageAdapter.ts +26 -8
- package/src/index.ts +1 -0
- package/src/loader.ts +22 -0
- package/src/packageVersion.ts +1 -1
- package/src/protocolTreeDocumentStorageService.ts +6 -8
package/dist/container.d.ts
CHANGED
|
@@ -119,7 +119,7 @@ export declare class Container extends EventEmitterWithErrorHandling<IContainerE
|
|
|
119
119
|
private setLoaded;
|
|
120
120
|
get closed(): boolean;
|
|
121
121
|
private _attachState;
|
|
122
|
-
private readonly
|
|
122
|
+
private readonly storageAdapter;
|
|
123
123
|
get storage(): IDocumentStorageService;
|
|
124
124
|
private readonly clientDetailsOverride;
|
|
125
125
|
private readonly _deltaManager;
|
package/dist/container.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,gBAAgB,EAChB,oBAAoB,EAEpB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EACN,SAAS,EAET,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EAEvB,WAAW,EAEX,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EAGjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAEN,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,gBAAgB,EAChB,oBAAoB,EAEpB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,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});
|
|
213
213
|
// Prefix all events in this file with container-loader
|
|
214
214
|
this.mc = (0, telemetry_utils_1.loggerToMonitoringContext)(telemetry_utils_1.ChildLogger.create(this.subLogger, "Container"));
|
|
215
|
-
|
|
216
|
-
this.options = Object.assign(Object.assign({}, this.loader.services.options), { summarizeProtocolTree });
|
|
215
|
+
this.options = Object.assign({}, this.loader.services.options);
|
|
217
216
|
this._deltaManager = this.createDeltaManager();
|
|
218
|
-
this._clientId = (
|
|
217
|
+
this._clientId = (_a = config.serializedContainerState) === null || _a === void 0 ? void 0 : _a.clientId;
|
|
219
218
|
this.connectionStateHandler = (0, connectionStateHandler_1.createConnectionStateHandler)({
|
|
220
219
|
logger: this.mc.logger,
|
|
221
220
|
connectionStateChanged: (value, oldState, reason) => {
|
|
@@ -258,7 +257,16 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
258
257
|
this.on(savedContainerEvent, () => {
|
|
259
258
|
this.connectionStateHandler.containerSaved();
|
|
260
259
|
});
|
|
261
|
-
|
|
260
|
+
// We expose our storage publicly, so it's possible others may call uploadSummaryWithContext() with a
|
|
261
|
+
// non-combined summary tree (in particular, ContainerRuntime.submitSummary). We'll intercept those calls
|
|
262
|
+
// using this callback and fix them up.
|
|
263
|
+
const addProtocolSummaryIfMissing = (summaryTree) => (0, driver_utils_1.isCombinedAppAndProtocolSummary)(summaryTree) === true
|
|
264
|
+
? summaryTree
|
|
265
|
+
: (0, driver_utils_1.combineAppAndProtocolSummary)(summaryTree, this.captureProtocolSummary());
|
|
266
|
+
// Whether the combined summary tree has been forced on by either the loader option or the monitoring context.
|
|
267
|
+
// Even if not forced on via this flag, combined summaries may still be enabled by service policy.
|
|
268
|
+
const forceEnableSummarizeProtocolTree = (_b = this.mc.config.getBoolean("Fluid.Container.summarizeProtocolTree2")) !== null && _b !== void 0 ? _b : this.loader.services.options.summarizeProtocolTree;
|
|
269
|
+
this.storageAdapter = new containerStorageAdapter_1.ContainerStorageAdapter(this.loader.services.detachedBlobStorage, this.mc.logger, addProtocolSummaryIfMissing, forceEnableSummarizeProtocolTree);
|
|
262
270
|
const isDomAvailable = typeof document === "object" &&
|
|
263
271
|
document !== null &&
|
|
264
272
|
typeof document.addEventListener === "function" &&
|
|
@@ -395,7 +403,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
395
403
|
this._lifecycleState === "disposed");
|
|
396
404
|
}
|
|
397
405
|
get storage() {
|
|
398
|
-
return this.
|
|
406
|
+
return this.storageAdapter;
|
|
399
407
|
}
|
|
400
408
|
get context() {
|
|
401
409
|
if (this._context === undefined) {
|
|
@@ -570,15 +578,19 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
570
578
|
try {
|
|
571
579
|
// Raise event first, to ensure we capture _lifecycleState before transition.
|
|
572
580
|
// This gives us a chance to know what errors happened on open vs. on fully loaded container.
|
|
581
|
+
// Log generic events instead of error events if container is in loading state, as most errors are not really FF errors
|
|
582
|
+
// which can pollute telemetry for real bugs
|
|
573
583
|
this.mc.logger.sendTelemetryEvent({
|
|
574
584
|
eventName: "ContainerClose",
|
|
575
|
-
category:
|
|
585
|
+
category: this._lifecycleState !== "loading" && error !== undefined
|
|
586
|
+
? "error"
|
|
587
|
+
: "generic",
|
|
576
588
|
}, error);
|
|
577
589
|
this._lifecycleState = "closing";
|
|
578
590
|
(_a = this._protocolHandler) === null || _a === void 0 ? void 0 : _a.close();
|
|
579
591
|
this.connectionStateHandler.dispose();
|
|
580
592
|
(_b = this._context) === null || _b === void 0 ? void 0 : _b.dispose(error !== undefined ? new Error(error.message) : undefined);
|
|
581
|
-
this.
|
|
593
|
+
this.storageAdapter.dispose();
|
|
582
594
|
// Notify storage about critical errors. They may be due to disconnect between client & server knowledge
|
|
583
595
|
// about file, like file being overwritten in storage, but client having stale local cache.
|
|
584
596
|
// Driver need to ensure all caches are cleared on critical errors
|
|
@@ -616,7 +628,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
616
628
|
(_a = this._protocolHandler) === null || _a === void 0 ? void 0 : _a.close();
|
|
617
629
|
this.connectionStateHandler.dispose();
|
|
618
630
|
(_b = this._context) === null || _b === void 0 ? void 0 : _b.dispose(error !== undefined ? new Error(error.message) : undefined);
|
|
619
|
-
this.
|
|
631
|
+
this.storageAdapter.dispose();
|
|
620
632
|
// Notify storage about critical errors. They may be due to disconnect between client & server knowledge
|
|
621
633
|
// about file, like file being overwritten in storage, but client having stale local cache.
|
|
622
634
|
// Driver need to ensure all caches are cleared on critical errors
|
|
@@ -713,7 +725,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
713
725
|
const resolvedUrl = this.service.resolvedUrl;
|
|
714
726
|
(0, driver_utils_1.ensureFluidResolvedUrl)(resolvedUrl);
|
|
715
727
|
this._resolvedUrl = resolvedUrl;
|
|
716
|
-
await this.
|
|
728
|
+
await this.storageAdapter.connectToService(this.service);
|
|
717
729
|
if (hasAttachmentBlobs) {
|
|
718
730
|
// upload blobs to storage
|
|
719
731
|
(0, common_utils_1.assert)(!!this.loader.services.detachedBlobStorage, 0x24e /* "assertion for type narrowing" */);
|
|
@@ -727,7 +739,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
727
739
|
.filter((id) => !redirectTable.has(id));
|
|
728
740
|
for (const id of newIds) {
|
|
729
741
|
const blob = await this.loader.services.detachedBlobStorage.readBlob(id);
|
|
730
|
-
const response = await this.
|
|
742
|
+
const response = await this.storageAdapter.createBlob(blob);
|
|
731
743
|
redirectTable.set(id, response.id);
|
|
732
744
|
}
|
|
733
745
|
}
|
|
@@ -737,7 +749,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
737
749
|
summary = (0, driver_utils_1.combineAppAndProtocolSummary)(appSummary, protocolSummary);
|
|
738
750
|
this._attachState = container_definitions_1.AttachState.Attaching;
|
|
739
751
|
this.context.notifyAttaching((0, utils_1.getSnapshotTreeFromSerializedContainer)(summary));
|
|
740
|
-
await this.
|
|
752
|
+
await this.storageAdapter.uploadSummaryWithContext(summary, {
|
|
741
753
|
referenceSequenceNumber: 0,
|
|
742
754
|
ackHandle: undefined,
|
|
743
755
|
proposalHandle: undefined,
|
|
@@ -872,7 +884,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
872
884
|
(_a = this.dispose) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
873
885
|
}
|
|
874
886
|
async getVersion(version) {
|
|
875
|
-
const versions = await this.
|
|
887
|
+
const versions = await this.storageAdapter.getVersions(version, 1);
|
|
876
888
|
return versions[0];
|
|
877
889
|
}
|
|
878
890
|
recordConnectStartTime() {
|
|
@@ -918,11 +930,11 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
918
930
|
this.connectToDeltaStream(connectionArgs);
|
|
919
931
|
}
|
|
920
932
|
if (!pendingLocalState) {
|
|
921
|
-
await this.
|
|
933
|
+
await this.storageAdapter.connectToService(this.service);
|
|
922
934
|
}
|
|
923
935
|
else {
|
|
924
936
|
// if we have pendingLocalState we can load without storage; don't wait for connection
|
|
925
|
-
this.
|
|
937
|
+
this.storageAdapter.connectToService(this.service).catch((error) => {
|
|
926
938
|
var _a;
|
|
927
939
|
this.close(error);
|
|
928
940
|
(_a = this.dispose) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
@@ -935,7 +947,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
935
947
|
: { snapshot: undefined, versionId: undefined };
|
|
936
948
|
(0, common_utils_1.assert)(snapshot !== undefined || pendingLocalState !== undefined, 0x237 /* "Snapshot should exist" */);
|
|
937
949
|
const attributes = pendingLocalState === undefined
|
|
938
|
-
? await this.getDocumentAttributes(this.
|
|
950
|
+
? await this.getDocumentAttributes(this.storageAdapter, snapshot)
|
|
939
951
|
: {
|
|
940
952
|
sequenceNumber: pendingLocalState.protocol.sequenceNumber,
|
|
941
953
|
minimumSequenceNumber: pendingLocalState.protocol.minimumSequenceNumber,
|
|
@@ -962,7 +974,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
962
974
|
// ...load in the existing quorum
|
|
963
975
|
// Initialize the protocol handler
|
|
964
976
|
if (pendingLocalState === undefined) {
|
|
965
|
-
await this.initializeProtocolStateFromSnapshot(attributes, this.
|
|
977
|
+
await this.initializeProtocolStateFromSnapshot(attributes, this.storageAdapter, snapshot);
|
|
966
978
|
}
|
|
967
979
|
else {
|
|
968
980
|
this.initializeProtocolState(attributes, {
|
|
@@ -1040,12 +1052,12 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1040
1052
|
delete detachedContainerSnapshot.tree[".hasAttachmentBlobs"];
|
|
1041
1053
|
}
|
|
1042
1054
|
const snapshotTree = (0, utils_1.getSnapshotTreeFromSerializedContainer)(detachedContainerSnapshot);
|
|
1043
|
-
this.
|
|
1044
|
-
const attributes = await this.getDocumentAttributes(this.
|
|
1055
|
+
this.storageAdapter.loadSnapshotForRehydratingContainer(snapshotTree);
|
|
1056
|
+
const attributes = await this.getDocumentAttributes(this.storageAdapter, snapshotTree);
|
|
1045
1057
|
await this.attachDeltaManagerOpHandler(attributes);
|
|
1046
1058
|
// Initialize the protocol handler
|
|
1047
1059
|
const baseTree = (0, utils_1.getProtocolSnapshotTree)(snapshotTree);
|
|
1048
|
-
const qValues = await (0, driver_utils_1.readAndParse)(this.
|
|
1060
|
+
const qValues = await (0, driver_utils_1.readAndParse)(this.storageAdapter, baseTree.blobs.quorumValues);
|
|
1049
1061
|
const codeDetails = (0, quorum_1.getCodeDetailsFromQuorumValues)(qValues);
|
|
1050
1062
|
this.initializeProtocolState(attributes, {
|
|
1051
1063
|
members: [],
|
|
@@ -1339,7 +1351,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1339
1351
|
if (summary.details === undefined) {
|
|
1340
1352
|
summary.details = {};
|
|
1341
1353
|
}
|
|
1342
|
-
summary.details.includesProtocolTree = this.
|
|
1354
|
+
summary.details.includesProtocolTree = this.storageAdapter.summarizeProtocolTree;
|
|
1343
1355
|
return this.submitMessage(protocol_definitions_1.MessageType.Summarize, JSON.stringify(summary), false /* batch */, undefined /* metadata */, undefined /* compression */, referenceSequenceNumber);
|
|
1344
1356
|
}
|
|
1345
1357
|
submitMessage(type, contents, batch, metadata, compression, referenceSequenceNumber) {
|
|
@@ -1404,7 +1416,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1404
1416
|
});
|
|
1405
1417
|
}
|
|
1406
1418
|
this._loadedFromVersion = version;
|
|
1407
|
-
const snapshot = (_a = (await this.
|
|
1419
|
+
const snapshot = (_a = (await this.storageAdapter.getSnapshotTree(version))) !== null && _a !== void 0 ? _a : undefined;
|
|
1408
1420
|
if (snapshot === undefined && version !== undefined) {
|
|
1409
1421
|
this.mc.logger.sendErrorEvent({ eventName: "getSnapshotTreeFailed", id: version.id });
|
|
1410
1422
|
}
|