@fluidframework/container-loader 2.0.0-internal.2.1.1 → 2.0.0-internal.2.2.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 +21 -11
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js +6 -1
- package/dist/audience.js.map +1 -1
- package/dist/collabWindowTracker.js +5 -4
- package/dist/collabWindowTracker.js.map +1 -1
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +13 -2
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +20 -11
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +65 -36
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +8 -0
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +23 -7
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +5 -1
- package/dist/containerContext.js.map +1 -1
- package/dist/contracts.d.ts +8 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/deltaManager.d.ts +1 -1
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +4 -3
- package/dist/deltaManager.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/lib/audience.d.ts.map +1 -1
- package/lib/audience.js +6 -1
- package/lib/audience.js.map +1 -1
- package/lib/collabWindowTracker.js +5 -4
- package/lib/collabWindowTracker.js.map +1 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +13 -2
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +20 -11
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +65 -36
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +8 -0
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +22 -7
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +5 -1
- package/lib/containerContext.js.map +1 -1
- package/lib/contracts.d.ts +8 -0
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/deltaManager.d.ts +1 -1
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +4 -3
- package/lib/deltaManager.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/package.json +22 -15
- package/prettier.config.cjs +8 -0
- package/src/audience.ts +6 -1
- package/src/collabWindowTracker.ts +5 -5
- package/src/connectionManager.ts +15 -3
- package/src/connectionStateHandler.ts +87 -39
- package/src/container.ts +26 -6
- package/src/containerContext.ts +8 -2
- package/src/contracts.ts +8 -0
- package/src/deltaManager.ts +4 -3
- package/src/packageVersion.ts +1 -1
package/dist/container.js
CHANGED
|
@@ -7,7 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Container = exports.waitContainerToCatchUp = void 0;
|
|
10
|
+
exports.Container = exports.ReportIfTooLong = exports.waitContainerToCatchUp = void 0;
|
|
11
11
|
// eslint-disable-next-line import/no-internal-modules
|
|
12
12
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
13
13
|
const uuid_1 = require("uuid");
|
|
@@ -121,10 +121,11 @@ const getCodeProposal =
|
|
|
121
121
|
async function ReportIfTooLong(logger, eventName, action) {
|
|
122
122
|
const event = telemetry_utils_1.PerformanceEvent.start(logger, { eventName });
|
|
123
123
|
const props = await action();
|
|
124
|
-
if (event.duration >
|
|
124
|
+
if (event.duration > 200) {
|
|
125
125
|
event.end(props);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
+
exports.ReportIfTooLong = ReportIfTooLong;
|
|
128
129
|
const summarizerClientType = "summarizer";
|
|
129
130
|
class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
130
131
|
constructor(loader, config, protocolHandlerBuilder) {
|
|
@@ -209,9 +210,23 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
209
210
|
shouldClientJoinWrite: () => this._deltaManager.connectionManager.shouldJoinWrite(),
|
|
210
211
|
maxClientLeaveWaitTime: this.loader.services.options.maxClientLeaveWaitTime,
|
|
211
212
|
logConnectionIssue: (eventName, details) => {
|
|
213
|
+
const mode = this.connectionMode;
|
|
212
214
|
// We get here when socket does not receive any ops on "write" connection, including
|
|
213
215
|
// its own join op. Attempt recovery option.
|
|
214
|
-
this._deltaManager.logConnectionIssue(Object.assign({ eventName,
|
|
216
|
+
this._deltaManager.logConnectionIssue(Object.assign({ eventName,
|
|
217
|
+
mode, duration: common_utils_1.performance.now() - this.connectionTransitionTimes[connectionState_1.ConnectionState.CatchingUp] }, (details === undefined ? {} : { details: JSON.stringify(details) })));
|
|
218
|
+
// If this is "write" connection, it took too long to receive join op. But in most cases that's due
|
|
219
|
+
// to very slow op fetches and we will eventually get there.
|
|
220
|
+
// For "read" connections, we get here due to self join signal not arriving on time. We will need to
|
|
221
|
+
// better understand when and why it may happen.
|
|
222
|
+
// For now, attempt to recover by reconnecting. In future, maybe we can query relay service for
|
|
223
|
+
// current state of audience.
|
|
224
|
+
// Other possible recovery path - move to connected state (i.e. ConnectionStateHandler.joinOpTimer
|
|
225
|
+
// to call this.applyForConnectedState("addMemberEvent") for "read" connections)
|
|
226
|
+
if (mode === "read") {
|
|
227
|
+
this.disconnect();
|
|
228
|
+
this.connect();
|
|
229
|
+
}
|
|
215
230
|
},
|
|
216
231
|
}, this.deltaManager, this._clientId);
|
|
217
232
|
this.on(savedContainerEvent, () => {
|
|
@@ -1032,7 +1047,8 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1032
1047
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
1033
1048
|
deltaManager.inboundSignal.pause();
|
|
1034
1049
|
deltaManager.on("connect", (details, _opsBehind) => {
|
|
1035
|
-
|
|
1050
|
+
(0, common_utils_1.assert)(this.connectionMode === details.mode, 0x4b7 /* mismatch */);
|
|
1051
|
+
this.connectionStateHandler.receivedConnectEvent(details);
|
|
1036
1052
|
});
|
|
1037
1053
|
deltaManager.on("disconnect", (reason) => {
|
|
1038
1054
|
var _a;
|
|
@@ -1145,7 +1161,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1145
1161
|
let clientSequenceNumber = -1;
|
|
1146
1162
|
for (const message of batch) {
|
|
1147
1163
|
clientSequenceNumber = this.submitMessage(protocol_definitions_1.MessageType.Operation, message.contents, true, // batch
|
|
1148
|
-
message.metadata);
|
|
1164
|
+
message.metadata, message.compression);
|
|
1149
1165
|
}
|
|
1150
1166
|
this._deltaManager.flush();
|
|
1151
1167
|
return clientSequenceNumber;
|
|
@@ -1162,7 +1178,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1162
1178
|
this.options.summarizeProtocolTree === true;
|
|
1163
1179
|
return this.submitMessage(protocol_definitions_1.MessageType.Summarize, JSON.stringify(summary), false /* batch */);
|
|
1164
1180
|
}
|
|
1165
|
-
submitMessage(type, contents, batch, metadata) {
|
|
1181
|
+
submitMessage(type, contents, batch, metadata, compression) {
|
|
1166
1182
|
var _a;
|
|
1167
1183
|
if (this.connectionState !== connectionState_1.ConnectionState.Connected) {
|
|
1168
1184
|
this.mc.logger.sendErrorEvent({ eventName: "SubmitMessageWithNoConnection", type });
|
|
@@ -1170,7 +1186,7 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1170
1186
|
}
|
|
1171
1187
|
this.messageCountAfterDisconnection += 1;
|
|
1172
1188
|
(_a = this.collabWindowTracker) === null || _a === void 0 ? void 0 : _a.stopSequenceNumberUpdate();
|
|
1173
|
-
return this._deltaManager.submit(type, contents, batch, metadata);
|
|
1189
|
+
return this._deltaManager.submit(type, contents, batch, metadata, compression);
|
|
1174
1190
|
}
|
|
1175
1191
|
processRemoteMessage(message) {
|
|
1176
1192
|
const local = this.clientId === message.clientId;
|