@fluidframework/container-loader 0.59.4000-71130 → 1.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/.eslintrc.js +1 -1
- package/README.md +1 -1
- package/dist/connectionState.d.ts +15 -3
- package/dist/connectionState.d.ts.map +1 -1
- package/dist/connectionState.js +15 -3
- package/dist/connectionState.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +6 -4
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +21 -6
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +18 -26
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +54 -88
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +6 -4
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +8 -7
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +2 -3
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +0 -3
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/deltaManagerProxy.d.ts +0 -1
- package/dist/deltaManagerProxy.d.ts.map +1 -1
- package/dist/deltaManagerProxy.js +0 -3
- package/dist/deltaManagerProxy.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -13
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +2 -3
- package/dist/loader.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/protocolTreeDocumentStorageService.d.ts +0 -1
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js +0 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +1 -2
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +0 -3
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/lib/connectionState.d.ts +15 -3
- package/lib/connectionState.d.ts.map +1 -1
- package/lib/connectionState.js +15 -3
- package/lib/connectionState.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +6 -4
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +21 -6
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +18 -26
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +54 -88
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +6 -4
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +8 -7
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +2 -3
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +0 -3
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/deltaManagerProxy.d.ts +0 -1
- package/lib/deltaManagerProxy.d.ts.map +1 -1
- package/lib/deltaManagerProxy.js +0 -3
- package/lib/deltaManagerProxy.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +1 -13
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +2 -3
- package/lib/loader.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/protocolTreeDocumentStorageService.d.ts +0 -1
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js +0 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +1 -2
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +0 -3
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/package.json +27 -27
- package/src/connectionState.ts +20 -6
- package/src/connectionStateHandler.ts +29 -8
- package/src/container.ts +77 -100
- package/src/containerContext.ts +10 -10
- package/src/containerStorageAdapter.ts +1 -6
- package/src/deltaManagerProxy.ts +0 -4
- package/src/index.ts +1 -0
- package/src/loader.ts +4 -21
- package/src/packageVersion.ts +1 -1
- package/src/protocolTreeDocumentStorageService.ts +0 -1
- package/src/retriableDocumentStorageService.ts +0 -8
package/dist/container.js
CHANGED
|
@@ -42,7 +42,7 @@ const savedContainerEvent = "saved";
|
|
|
42
42
|
* Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being
|
|
43
43
|
* up to date. Host may chose to wait in such case and retry resolving URI.
|
|
44
44
|
* Warning: Will wait infinitely for connection to establish if there is no connection.
|
|
45
|
-
* May result in deadlock if Container.
|
|
45
|
+
* May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().
|
|
46
46
|
* @returns true: container is up to date, it processed all the ops that were know at the time of first connection
|
|
47
47
|
* false: storage does not provide indication of how far the client is. Container processed
|
|
48
48
|
* all the ops known to it, but it maybe still behind.
|
|
@@ -64,7 +64,8 @@ async function waitContainerToCatchUp(container) {
|
|
|
64
64
|
};
|
|
65
65
|
container.on("closed", closedCallback);
|
|
66
66
|
const waitForOps = () => {
|
|
67
|
-
(0, common_utils_1.assert)(container.connectionState
|
|
67
|
+
(0, common_utils_1.assert)(container.connectionState === connectionState_1.ConnectionState.CatchingUp
|
|
68
|
+
|| container.connectionState === connectionState_1.ConnectionState.Connected, 0x0cd /* "Container disconnected while waiting for ops!" */);
|
|
68
69
|
const hasCheckpointSequenceNumber = deltaManager.hasCheckpointSequenceNumber;
|
|
69
70
|
const connectionOpSeqNumber = deltaManager.lastKnownSeqNumber;
|
|
70
71
|
(0, common_utils_1.assert)(deltaManager.lastSequenceNumber <= connectionOpSeqNumber, 0x266 /* "lastKnownSeqNumber should never be below last processed sequence number" */);
|
|
@@ -95,9 +96,7 @@ async function waitContainerToCatchUp(container) {
|
|
|
95
96
|
waitForOps();
|
|
96
97
|
};
|
|
97
98
|
container.on(telemetry_utils_1.connectedEventName, callback);
|
|
98
|
-
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
100
|
-
container.resume();
|
|
99
|
+
container.connect();
|
|
101
100
|
});
|
|
102
101
|
}
|
|
103
102
|
exports.waitContainerToCatchUp = waitContainerToCatchUp;
|
|
@@ -107,7 +106,7 @@ const getCodeProposal =
|
|
|
107
106
|
const summarizerClientType = "summarizer";
|
|
108
107
|
class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
109
108
|
constructor(loader, config) {
|
|
110
|
-
var _a;
|
|
109
|
+
var _a, _b;
|
|
111
110
|
super((name, error) => {
|
|
112
111
|
this.mc.logger.sendErrorEvent({
|
|
113
112
|
eventName: "ContainerEventHandlerException",
|
|
@@ -179,7 +178,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
179
178
|
// its own join op. Attempt recovery option.
|
|
180
179
|
this._deltaManager.logConnectionIssue({
|
|
181
180
|
eventName,
|
|
182
|
-
duration: common_utils_1.performance.now() - this.connectionTransitionTimes[connectionState_1.ConnectionState.
|
|
181
|
+
duration: common_utils_1.performance.now() - this.connectionTransitionTimes[connectionState_1.ConnectionState.CatchingUp],
|
|
183
182
|
});
|
|
184
183
|
},
|
|
185
184
|
connectionStateChanged: () => {
|
|
@@ -187,7 +186,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
187
186
|
this.propagateConnectionState();
|
|
188
187
|
}
|
|
189
188
|
},
|
|
190
|
-
}, this.mc.logger);
|
|
189
|
+
}, this.mc.logger, (_b = config.serializedContainerState) === null || _b === void 0 ? void 0 : _b.clientId);
|
|
191
190
|
this.on(savedContainerEvent, () => {
|
|
192
191
|
this.connectionStateHandler.containerSaved();
|
|
193
192
|
});
|
|
@@ -265,16 +264,17 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
265
264
|
clientDetailsOverride: loadOptions.clientDetailsOverride,
|
|
266
265
|
resolvedUrl: loadOptions.resolvedUrl,
|
|
267
266
|
canReconnect: loadOptions.canReconnect,
|
|
267
|
+
serializedContainerState: pendingLocalState,
|
|
268
268
|
});
|
|
269
269
|
return telemetry_utils_1.PerformanceEvent.timedExecAsync(container.mc.logger, { eventName: "Load" }, async (event) => new Promise((resolve, reject) => {
|
|
270
|
-
var _a;
|
|
270
|
+
var _a, _b;
|
|
271
271
|
container._lifecycleState = "loading";
|
|
272
272
|
const version = loadOptions.version;
|
|
273
|
-
// always load unpaused with pending ops!
|
|
274
|
-
// It is also default mode in general.
|
|
275
273
|
const defaultMode = { opsBeforeReturn: "cached" };
|
|
276
|
-
|
|
277
|
-
|
|
274
|
+
// if we have pendingLocalState, anything we cached is not useful and we shouldn't wait for connection
|
|
275
|
+
// to return container, so ignore this value and use undefined for opsBeforeReturn
|
|
276
|
+
const mode = pendingLocalState
|
|
277
|
+
? Object.assign(Object.assign({}, ((_a = loadOptions.loadMode) !== null && _a !== void 0 ? _a : defaultMode)), { opsBeforeReturn: undefined }) : (_b = loadOptions.loadMode) !== null && _b !== void 0 ? _b : defaultMode;
|
|
278
278
|
const onClosed = (err) => {
|
|
279
279
|
// pre-0.58 error message: containerClosedWithoutErrorDuringLoad
|
|
280
280
|
reject(err !== null && err !== void 0 ? err : new container_utils_1.GenericError("Container closed without error during load"));
|
|
@@ -493,9 +493,13 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
493
493
|
// a new clientId and a future container using stale pending state without the new clientId would resubmit them
|
|
494
494
|
(0, common_utils_1.assert)(this.attachState === container_definitions_1.AttachState.Attached, 0x0d1 /* "Container should be attached before close" */);
|
|
495
495
|
(0, common_utils_1.assert)(this.resolvedUrl !== undefined && this.resolvedUrl.type === "fluid", 0x0d2 /* "resolved url should be valid Fluid url" */);
|
|
496
|
+
(0, common_utils_1.assert)(!!this._protocolHandler, 0x2e3 /* "Must have a valid protocol handler instance" */);
|
|
496
497
|
const pendingState = {
|
|
497
498
|
pendingRuntimeState: this.context.getPendingLocalState(),
|
|
498
499
|
url: this.resolvedUrl.url,
|
|
500
|
+
protocol: this._protocolHandler.getProtocolState(),
|
|
501
|
+
term: this._protocolHandler.term,
|
|
502
|
+
clientId: this.clientId,
|
|
499
503
|
};
|
|
500
504
|
this.close();
|
|
501
505
|
return JSON.stringify(pendingState);
|
|
@@ -539,7 +543,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
539
543
|
// starting to attach the container to storage.
|
|
540
544
|
// Also, this should only be fired in detached container.
|
|
541
545
|
this._attachState = container_definitions_1.AttachState.Attaching;
|
|
542
|
-
this.context.notifyAttaching();
|
|
546
|
+
this.context.notifyAttaching((0, utils_1.getSnapshotTreeFromSerializedContainer)(summary));
|
|
543
547
|
}
|
|
544
548
|
// Actually go and create the resolved document
|
|
545
549
|
const createNewResolvedUrl = await this.urlResolver.resolve(request);
|
|
@@ -574,7 +578,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
574
578
|
const protocolSummary = this.captureProtocolSummary();
|
|
575
579
|
summary = (0, driver_utils_1.combineAppAndProtocolSummary)(appSummary, protocolSummary);
|
|
576
580
|
this._attachState = container_definitions_1.AttachState.Attaching;
|
|
577
|
-
this.context.notifyAttaching();
|
|
581
|
+
this.context.notifyAttaching((0, utils_1.getSnapshotTreeFromSerializedContainer)(summary));
|
|
578
582
|
await this.storageService.uploadSummaryWithContext(summary, {
|
|
579
583
|
referenceSequenceNumber: 0,
|
|
580
584
|
ackHandle: undefined,
|
|
@@ -604,27 +608,6 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
604
608
|
async request(path) {
|
|
605
609
|
return telemetry_utils_1.PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: "Request" }, async () => this.context.request(path), { end: true, cancel: "error" });
|
|
606
610
|
}
|
|
607
|
-
/**
|
|
608
|
-
* Dictates whether or not the current container will automatically attempt to reconnect to the delta stream
|
|
609
|
-
* after receiving a disconnect event
|
|
610
|
-
* @param reconnect - Boolean indicating if reconnect should automatically occur
|
|
611
|
-
* @deprecated - 0.58, This API will be removed in 1.0
|
|
612
|
-
* Use `connect()` and `disconnect()` instead of `setAutoReconnect(true)` and `setAutoReconnect(false)` respectively
|
|
613
|
-
* See https://github.com/microsoft/FluidFramework/issues/9167 for context
|
|
614
|
-
*/
|
|
615
|
-
setAutoReconnect(reconnect) {
|
|
616
|
-
if (this.closed) {
|
|
617
|
-
throw new Error("Attempting to setAutoReconnect() a closed Container");
|
|
618
|
-
}
|
|
619
|
-
const mode = reconnect ? contracts_1.ReconnectMode.Enabled : contracts_1.ReconnectMode.Disabled;
|
|
620
|
-
this.setAutoReconnectInternal(mode);
|
|
621
|
-
// If container state is not attached and resumed, then don't connect to delta stream. Also don't set the
|
|
622
|
-
// manual reconnection flag to true as we haven't made the initial connection yet.
|
|
623
|
-
if (reconnect && this._attachState === container_definitions_1.AttachState.Attached && this.resumedOpProcessingAfterLoad) {
|
|
624
|
-
// Ensure connection to web socket
|
|
625
|
-
this.connectToDeltaStream({ reason: "autoReconnect" });
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
611
|
setAutoReconnectInternal(mode) {
|
|
629
612
|
const currentMode = this._deltaManager.connectionManager.reconnectMode;
|
|
630
613
|
if (currentMode === mode) {
|
|
@@ -678,22 +661,8 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
678
661
|
const mode = contracts_1.ReconnectMode.Disabled;
|
|
679
662
|
this.setAutoReconnectInternal(mode);
|
|
680
663
|
}
|
|
681
|
-
/**
|
|
682
|
-
* Have the container attempt to resume processing ops
|
|
683
|
-
* @deprecated - 0.58, This API will be removed in 1.0
|
|
684
|
-
* Use `connect()` instead
|
|
685
|
-
* See https://github.com/microsoft/FluidFramework/issues/9167 for context
|
|
686
|
-
*/
|
|
687
|
-
resume() {
|
|
688
|
-
if (!this.closed) {
|
|
689
|
-
// Note: no need to fetch ops as we do it preemptively as part of DeltaManager.attachOpHandler().
|
|
690
|
-
// If there is gap, we will learn about it once connected, but the gap should be small (if any),
|
|
691
|
-
// assuming that resume() is called quickly after initial container boot.
|
|
692
|
-
this.resumeInternal({ reason: "DocumentOpenResume", fetchOpsFromStorage: false });
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
664
|
resumeInternal(args) {
|
|
696
|
-
(0, common_utils_1.assert)(!this.closed, 0x0d9 /* "Attempting to
|
|
665
|
+
(0, common_utils_1.assert)(!this.closed, 0x0d9 /* "Attempting to connect() a closed DeltaManager" */);
|
|
697
666
|
// Resume processing ops
|
|
698
667
|
if (!this.resumedOpProcessingAfterLoad) {
|
|
699
668
|
this.resumedOpProcessingAfterLoad = true;
|
|
@@ -782,12 +751,26 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
782
751
|
if (loadMode.deltaConnection === undefined) {
|
|
783
752
|
this.connectToDeltaStream(connectionArgs);
|
|
784
753
|
}
|
|
785
|
-
|
|
754
|
+
if (!pendingLocalState) {
|
|
755
|
+
await this.connectStorageService();
|
|
756
|
+
}
|
|
757
|
+
else {
|
|
758
|
+
// if we have pendingLocalState we can load without storage; don't wait for connection
|
|
759
|
+
this.connectStorageService().catch((error) => this.close(error));
|
|
760
|
+
}
|
|
786
761
|
this._attachState = container_definitions_1.AttachState.Attached;
|
|
787
762
|
// Fetch specified snapshot.
|
|
788
|
-
const { snapshot, versionId } =
|
|
789
|
-
|
|
790
|
-
|
|
763
|
+
const { snapshot, versionId } = pendingLocalState === undefined
|
|
764
|
+
? await this.fetchSnapshotTree(specifiedVersion)
|
|
765
|
+
: { snapshot: undefined, versionId: undefined };
|
|
766
|
+
(0, common_utils_1.assert)(snapshot !== undefined || pendingLocalState !== undefined, 0x237 /* "Snapshot should exist" */);
|
|
767
|
+
const attributes = pendingLocalState === undefined
|
|
768
|
+
? await this.getDocumentAttributes(this.storageService, snapshot)
|
|
769
|
+
: {
|
|
770
|
+
sequenceNumber: pendingLocalState.protocol.sequenceNumber,
|
|
771
|
+
minimumSequenceNumber: pendingLocalState.protocol.minimumSequenceNumber,
|
|
772
|
+
term: pendingLocalState.term,
|
|
773
|
+
};
|
|
791
774
|
let opsBeforeReturnP;
|
|
792
775
|
// Attach op handlers to finish initialization and be able to start processing ops
|
|
793
776
|
// Kick off any ops fetching if required.
|
|
@@ -808,11 +791,12 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
808
791
|
}
|
|
809
792
|
// ...load in the existing quorum
|
|
810
793
|
// Initialize the protocol handler
|
|
811
|
-
this._protocolHandler =
|
|
812
|
-
await this.initializeProtocolStateFromSnapshot(attributes, this.storageService, snapshot)
|
|
794
|
+
this._protocolHandler = pendingLocalState === undefined
|
|
795
|
+
? await this.initializeProtocolStateFromSnapshot(attributes, this.storageService, snapshot)
|
|
796
|
+
: await this.initializeProtocolState(attributes, pendingLocalState.protocol.members, pendingLocalState.protocol.proposals, pendingLocalState.protocol.values);
|
|
813
797
|
const codeDetails = this.getCodeDetailsFromQuorum();
|
|
814
798
|
await this.instantiateContext(true, // existing
|
|
815
|
-
codeDetails, snapshot, pendingLocalState);
|
|
799
|
+
codeDetails, snapshot, pendingLocalState === null || pendingLocalState === void 0 ? void 0 : pendingLocalState.pendingRuntimeState);
|
|
816
800
|
// Propagate current connection state through the system.
|
|
817
801
|
this.propagateConnectionState();
|
|
818
802
|
// Internal context is fully loaded at this point
|
|
@@ -829,7 +813,10 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
829
813
|
}
|
|
830
814
|
switch (loadMode.deltaConnection) {
|
|
831
815
|
case undefined:
|
|
832
|
-
|
|
816
|
+
// Note: no need to fetch ops as we do it preemptively as part of DeltaManager.attachOpHandler().
|
|
817
|
+
// If there is gap, we will learn about it once connected, but the gap should be small (if any),
|
|
818
|
+
// assuming that resumeInternal() is called quickly after initial container boot.
|
|
819
|
+
this.resumeInternal({ reason: "DocumentLoad", fetchOpsFromStorage: false });
|
|
833
820
|
break;
|
|
834
821
|
case "delayed":
|
|
835
822
|
this.resumedOpProcessingAfterLoad = true;
|
|
@@ -952,12 +939,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
952
939
|
protocolLogger.sendErrorEvent(error);
|
|
953
940
|
});
|
|
954
941
|
// Track membership changes and update connection state accordingly
|
|
955
|
-
|
|
956
|
-
this.connectionStateHandler.receivedAddMemberEvent(clientId);
|
|
957
|
-
});
|
|
958
|
-
protocol.quorum.on("removeMember", (clientId) => {
|
|
959
|
-
this.connectionStateHandler.receivedRemoveMemberEvent(clientId);
|
|
960
|
-
});
|
|
942
|
+
this.connectionStateHandler.initProtocol(protocol);
|
|
961
943
|
protocol.quorum.on("addProposal", (proposal) => {
|
|
962
944
|
if (proposal.key === "code" || proposal.key === "code2") {
|
|
963
945
|
this.emit("codeDetailsProposed", proposal.value, proposal);
|
|
@@ -1092,6 +1074,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1092
1074
|
}, prefetchType);
|
|
1093
1075
|
}
|
|
1094
1076
|
logConnectionStateChangeTelemetry(value, oldState, reason) {
|
|
1077
|
+
var _a;
|
|
1095
1078
|
// Log actual event
|
|
1096
1079
|
const time = common_utils_1.performance.now();
|
|
1097
1080
|
this.connectionTransitionTimes[value] = time;
|
|
@@ -1127,7 +1110,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1127
1110
|
durationFromDisconnected,
|
|
1128
1111
|
reason,
|
|
1129
1112
|
connectionInitiationReason, pendingClientId: this.connectionStateHandler.pendingClientId, clientId: this.clientId, autoReconnect,
|
|
1130
|
-
opsBehind, online: driver_utils_1.OnlineStatus[(0, driver_utils_1.isOnline)()], lastVisible: this.lastVisible !== undefined ? common_utils_1.performance.now() - this.lastVisible : undefined, checkpointSequenceNumber }, this._deltaManager.connectionProps));
|
|
1113
|
+
opsBehind, online: driver_utils_1.OnlineStatus[(0, driver_utils_1.isOnline)()], lastVisible: this.lastVisible !== undefined ? common_utils_1.performance.now() - this.lastVisible : undefined, checkpointSequenceNumber, quorumSize: (_a = this._protocolHandler) === null || _a === void 0 ? void 0 : _a.quorum.getMembers().size }, this._deltaManager.connectionProps));
|
|
1131
1114
|
if (value === connectionState_1.ConnectionState.Connected) {
|
|
1132
1115
|
this.firstConnection = false;
|
|
1133
1116
|
}
|
|
@@ -1186,6 +1169,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1186
1169
|
return this._deltaManager.submit(type, contents, batch, metadata);
|
|
1187
1170
|
}
|
|
1188
1171
|
processRemoteMessage(message) {
|
|
1172
|
+
var _a, _b;
|
|
1189
1173
|
// Check and report if we're getting messages from a clientId that we previously
|
|
1190
1174
|
// flagged as shouldHaveLeft, or from a client that's not in the quorum but should be
|
|
1191
1175
|
if (message.clientId != null) {
|
|
@@ -1218,35 +1202,17 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1218
1202
|
// That means that if relay service changes settings, such changes will impact only newly booted
|
|
1219
1203
|
// clients.
|
|
1220
1204
|
// All existing will continue to use settings they got earlier.
|
|
1221
|
-
|
|
1205
|
+
(0, common_utils_1.assert)(this.serviceConfiguration !== undefined, 0x2e4 /* "there should be service config for active connection" */);
|
|
1222
1206
|
this.collabWindowTracker = new collabWindowTracker_1.CollabWindowTracker((type, contents) => {
|
|
1223
1207
|
(0, common_utils_1.assert)(this.activeConnection(), 0x241 /* "disconnect should result in stopSequenceNumberUpdate() call" */);
|
|
1224
1208
|
this.submitMessage(type, contents);
|
|
1225
|
-
}, noopTimeFrequency, noopCountFrequency);
|
|
1209
|
+
}, (_a = this.serviceConfiguration) === null || _a === void 0 ? void 0 : _a.noopTimeFrequency, (_b = this.serviceConfiguration) === null || _b === void 0 ? void 0 : _b.noopCountFrequency);
|
|
1226
1210
|
}
|
|
1227
1211
|
this.collabWindowTracker.scheduleSequenceNumberUpdate(message, result.immediateNoOp === true);
|
|
1228
1212
|
}
|
|
1229
1213
|
this.emit("op", message);
|
|
1230
1214
|
return result;
|
|
1231
1215
|
}
|
|
1232
|
-
/**
|
|
1233
|
-
* #260 (ADO)
|
|
1234
|
-
* back-compat: noopTimeFrequency & noopCountFrequency properties were added to
|
|
1235
|
-
* IClientConfiguration in 0.59.3000. During the integration, we must read the
|
|
1236
|
-
* available configuration from the loader options.
|
|
1237
|
-
*/
|
|
1238
|
-
getNoopConfig() {
|
|
1239
|
-
var _a, _b;
|
|
1240
|
-
(0, common_utils_1.assert)(this.serviceConfiguration !== undefined, 0x2e2);
|
|
1241
|
-
if (this.serviceConfiguration.noopTimeFrequency !== undefined ||
|
|
1242
|
-
this.serviceConfiguration.noopCountFrequency !== undefined) {
|
|
1243
|
-
return [
|
|
1244
|
-
this.serviceConfiguration.noopTimeFrequency,
|
|
1245
|
-
this.serviceConfiguration.noopCountFrequency,
|
|
1246
|
-
];
|
|
1247
|
-
}
|
|
1248
|
-
return [(_a = this.loader.services.options) === null || _a === void 0 ? void 0 : _a.noopTimeFrequency, (_b = this.loader.services.options) === null || _b === void 0 ? void 0 : _b.noopCountFrequency];
|
|
1249
|
-
}
|
|
1250
1216
|
submitSignal(message) {
|
|
1251
1217
|
this._deltaManager.submitSignal(JSON.stringify(message));
|
|
1252
1218
|
}
|
|
@@ -1287,12 +1253,12 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1287
1253
|
}
|
|
1288
1254
|
return { snapshot, versionId: version === null || version === void 0 ? void 0 : version.id };
|
|
1289
1255
|
}
|
|
1290
|
-
async instantiateContextDetached(existing, snapshot
|
|
1256
|
+
async instantiateContextDetached(existing, snapshot) {
|
|
1291
1257
|
const codeDetails = this.getCodeDetailsFromQuorum();
|
|
1292
1258
|
if (codeDetails === undefined) {
|
|
1293
1259
|
throw new Error("pkg should be provided in create flow!!");
|
|
1294
1260
|
}
|
|
1295
|
-
await this.instantiateContext(existing, codeDetails, snapshot
|
|
1261
|
+
await this.instantiateContext(existing, codeDetails, snapshot);
|
|
1296
1262
|
}
|
|
1297
1263
|
async instantiateContext(existing, codeDetails, snapshot, pendingLocalState) {
|
|
1298
1264
|
var _a;
|