@fluidframework/container-runtime 2.5.0 → 2.10.0-305357
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-report/container-runtime.legacy.alpha.api.md +1 -1
- package/container-runtime.test-files.tar +0 -0
- package/dist/connectionTelemetry.d.ts +2 -3
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +2 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +22 -15
- package/dist/containerRuntime.js.map +1 -1
- package/dist/deltaManagerProxies.d.ts +8 -8
- package/dist/deltaManagerProxies.d.ts.map +1 -1
- package/dist/deltaManagerProxies.js.map +1 -1
- package/dist/deltaScheduler.d.ts +3 -3
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.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/scheduleManager.d.ts +3 -3
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +2 -3
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +2 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +23 -16
- package/lib/containerRuntime.js.map +1 -1
- package/lib/deltaManagerProxies.d.ts +8 -8
- package/lib/deltaManagerProxies.d.ts.map +1 -1
- package/lib/deltaManagerProxies.js.map +1 -1
- package/lib/deltaScheduler.d.ts +3 -3
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.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/scheduleManager.d.ts +3 -3
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js.map +1 -1
- package/package.json +68 -20
- package/src/connectionTelemetry.ts +3 -3
- package/src/containerRuntime.ts +27 -23
- package/src/deltaManagerProxies.ts +5 -18
- package/src/deltaScheduler.ts +4 -7
- package/src/packageVersion.ts +1 -1
- package/src/scheduleManager.ts +3 -3
package/src/containerRuntime.ts
CHANGED
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
IRuntime,
|
|
20
20
|
LoaderHeader,
|
|
21
21
|
IDeltaManager,
|
|
22
|
+
IDeltaManagerFull,
|
|
23
|
+
isIDeltaManagerFull,
|
|
22
24
|
} from "@fluidframework/container-definitions/internal";
|
|
23
25
|
import {
|
|
24
26
|
IContainerRuntime,
|
|
@@ -1259,16 +1261,18 @@ export class ContainerRuntime
|
|
|
1259
1261
|
* accesses such as sets "read-only" mode for the summarizer client. This is the default delta manager that should
|
|
1260
1262
|
* be used unless the innerDeltaManager is required.
|
|
1261
1263
|
*/
|
|
1262
|
-
public
|
|
1264
|
+
public get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
|
|
1265
|
+
return this._deltaManager;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
private readonly _deltaManager: IDeltaManagerFull;
|
|
1269
|
+
|
|
1263
1270
|
/**
|
|
1264
1271
|
* The delta manager provided by the container context. By default, using the default delta manager (proxy)
|
|
1265
1272
|
* should be sufficient. This should be used only if necessary. For example, for validating and propagating connected
|
|
1266
1273
|
* events which requires access to the actual real only info, this is needed.
|
|
1267
1274
|
*/
|
|
1268
|
-
private readonly innerDeltaManager:
|
|
1269
|
-
ISequencedDocumentMessage,
|
|
1270
|
-
IDocumentMessage
|
|
1271
|
-
>;
|
|
1275
|
+
private readonly innerDeltaManager: IDeltaManagerFull;
|
|
1272
1276
|
|
|
1273
1277
|
// internal logger for ContainerRuntime. Use this.logger for stores, summaries, etc.
|
|
1274
1278
|
private readonly mc: MonitoringContext;
|
|
@@ -1528,6 +1532,7 @@ export class ContainerRuntime
|
|
|
1528
1532
|
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
1529
1533
|
};
|
|
1530
1534
|
|
|
1535
|
+
assert(isIDeltaManagerFull(deltaManager), "Invalid delta manager");
|
|
1531
1536
|
this.innerDeltaManager = deltaManager;
|
|
1532
1537
|
|
|
1533
1538
|
// Here we could wrap/intercept on these functions to block/modify outgoing messages if needed.
|
|
@@ -1644,7 +1649,7 @@ export class ContainerRuntime
|
|
|
1644
1649
|
this.logger,
|
|
1645
1650
|
);
|
|
1646
1651
|
|
|
1647
|
-
let outerDeltaManager:
|
|
1652
|
+
let outerDeltaManager: IDeltaManagerFull;
|
|
1648
1653
|
this.useDeltaManagerOpsProxy =
|
|
1649
1654
|
this.mc.config.getBoolean("Fluid.ContainerRuntime.DeltaManagerOpsProxy") === true;
|
|
1650
1655
|
// The summarizerDeltaManager Proxy is used to lie to the summarizer to convince it is in the right state as a summarizer client.
|
|
@@ -1663,7 +1668,7 @@ export class ContainerRuntime
|
|
|
1663
1668
|
outerDeltaManager = pendingOpsDeltaManagerProxy;
|
|
1664
1669
|
}
|
|
1665
1670
|
|
|
1666
|
-
this.
|
|
1671
|
+
this._deltaManager = outerDeltaManager;
|
|
1667
1672
|
|
|
1668
1673
|
this.handleContext = new ContainerFluidHandleContext("", this);
|
|
1669
1674
|
|
|
@@ -2034,7 +2039,7 @@ export class ContainerRuntime
|
|
|
2034
2039
|
initialSequenceNumber: this.deltaManager.initialSequenceNumber,
|
|
2035
2040
|
});
|
|
2036
2041
|
|
|
2037
|
-
ReportOpPerfTelemetry(this.clientId, this.
|
|
2042
|
+
ReportOpPerfTelemetry(this.clientId, this._deltaManager, this, this.logger);
|
|
2038
2043
|
BindBatchTracker(this, this.logger);
|
|
2039
2044
|
|
|
2040
2045
|
this.entryPoint = new LazyPromise(async () => {
|
|
@@ -2239,8 +2244,8 @@ export class ContainerRuntime
|
|
|
2239
2244
|
});
|
|
2240
2245
|
// If the inbound deltas queue is paused or disconnected, we expect a reconnect and unpause
|
|
2241
2246
|
// as long as it's not a summarizer client.
|
|
2242
|
-
if (this.
|
|
2243
|
-
props.inboundPaused = this.
|
|
2247
|
+
if (this._deltaManager.inbound.paused) {
|
|
2248
|
+
props.inboundPaused = this._deltaManager.inbound.paused; // reusing telemetry
|
|
2244
2249
|
}
|
|
2245
2250
|
const defP = new Deferred<boolean>();
|
|
2246
2251
|
this.deltaManager.on("op", (message: ISequencedDocumentMessage) => {
|
|
@@ -2819,17 +2824,6 @@ export class ContainerRuntime
|
|
|
2819
2824
|
: false /* groupedBatch */,
|
|
2820
2825
|
);
|
|
2821
2826
|
} else {
|
|
2822
|
-
if (!runtimeBatch) {
|
|
2823
|
-
// The DeltaManager used to do this, but doesn't anymore as of Loader v2.4
|
|
2824
|
-
// Anyone listening to our "op" event would expect the contents to be parsed per this same logic
|
|
2825
|
-
if (
|
|
2826
|
-
typeof messageCopy.contents === "string" &&
|
|
2827
|
-
messageCopy.contents !== "" &&
|
|
2828
|
-
messageCopy.type !== MessageType.ClientLeave
|
|
2829
|
-
) {
|
|
2830
|
-
messageCopy.contents = JSON.parse(messageCopy.contents);
|
|
2831
|
-
}
|
|
2832
|
-
}
|
|
2833
2827
|
this.processInboundMessages(
|
|
2834
2828
|
[{ message: messageCopy, localOpMetadata: undefined }],
|
|
2835
2829
|
{ batchStart: true, batchEnd: true }, // Single message
|
|
@@ -2996,6 +2990,16 @@ export class ContainerRuntime
|
|
|
2996
2990
|
this.updateDocumentDirtyState(false);
|
|
2997
2991
|
}
|
|
2998
2992
|
|
|
2993
|
+
// The DeltaManager used to do this, but doesn't anymore as of Loader v2.4
|
|
2994
|
+
// Anyone listening to our "op" event would expect the contents to be parsed per this same logic
|
|
2995
|
+
if (
|
|
2996
|
+
typeof message.contents === "string" &&
|
|
2997
|
+
message.contents !== "" &&
|
|
2998
|
+
message.type !== MessageType.ClientLeave
|
|
2999
|
+
) {
|
|
3000
|
+
message.contents = JSON.parse(message.contents);
|
|
3001
|
+
}
|
|
3002
|
+
|
|
2999
3003
|
this.emit("op", message, false /* runtimeMessage */);
|
|
3000
3004
|
}
|
|
3001
3005
|
|
|
@@ -3947,7 +3951,7 @@ export class ContainerRuntime
|
|
|
3947
3951
|
) === true;
|
|
3948
3952
|
|
|
3949
3953
|
try {
|
|
3950
|
-
await this.
|
|
3954
|
+
await this._deltaManager.inbound.pause();
|
|
3951
3955
|
if (shouldPauseInboundSignal) {
|
|
3952
3956
|
await this.deltaManager.inboundSignal.pause();
|
|
3953
3957
|
}
|
|
@@ -4212,7 +4216,7 @@ export class ContainerRuntime
|
|
|
4212
4216
|
this._summarizer?.recordSummaryAttempt?.(summaryRefSeqNum);
|
|
4213
4217
|
|
|
4214
4218
|
// Restart the delta manager
|
|
4215
|
-
this.
|
|
4219
|
+
this._deltaManager.inbound.resume();
|
|
4216
4220
|
if (shouldPauseInboundSignal) {
|
|
4217
4221
|
this.deltaManager.inboundSignal.resume();
|
|
4218
4222
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import type {
|
|
8
8
|
IConnectionDetails,
|
|
9
|
-
IDeltaManager,
|
|
10
9
|
IDeltaManagerEvents,
|
|
10
|
+
IDeltaManagerFull,
|
|
11
11
|
IDeltaQueue,
|
|
12
12
|
IDeltaSender,
|
|
13
13
|
ReadOnlyInfo,
|
|
@@ -33,7 +33,7 @@ import { summarizerClientType } from "./summary/index.js";
|
|
|
33
33
|
*/
|
|
34
34
|
export abstract class BaseDeltaManagerProxy
|
|
35
35
|
extends TypedEventEmitter<IDeltaManagerEvents>
|
|
36
|
-
implements
|
|
36
|
+
implements IDeltaManagerFull
|
|
37
37
|
{
|
|
38
38
|
public get IDeltaSender(): IDeltaSender {
|
|
39
39
|
return this;
|
|
@@ -99,12 +99,7 @@ export abstract class BaseDeltaManagerProxy
|
|
|
99
99
|
return this.deltaManager.readOnlyInfo;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
constructor(
|
|
103
|
-
protected readonly deltaManager: IDeltaManager<
|
|
104
|
-
ISequencedDocumentMessage,
|
|
105
|
-
IDocumentMessage
|
|
106
|
-
>,
|
|
107
|
-
) {
|
|
102
|
+
constructor(protected readonly deltaManager: IDeltaManagerFull) {
|
|
108
103
|
super();
|
|
109
104
|
|
|
110
105
|
// We are expecting this class to have many listeners, so we suppress noisy "MaxListenersExceededWarning" logging.
|
|
@@ -194,12 +189,7 @@ export class DeltaManagerSummarizerProxy extends BaseDeltaManagerProxy {
|
|
|
194
189
|
|
|
195
190
|
private readonly isSummarizerClient: boolean;
|
|
196
191
|
|
|
197
|
-
constructor(
|
|
198
|
-
protected readonly deltaManager: IDeltaManager<
|
|
199
|
-
ISequencedDocumentMessage,
|
|
200
|
-
IDocumentMessage
|
|
201
|
-
>,
|
|
202
|
-
) {
|
|
192
|
+
constructor(protected readonly deltaManager: IDeltaManagerFull) {
|
|
203
193
|
super(deltaManager);
|
|
204
194
|
this.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;
|
|
205
195
|
}
|
|
@@ -250,10 +240,7 @@ export class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {
|
|
|
250
240
|
};
|
|
251
241
|
|
|
252
242
|
constructor(
|
|
253
|
-
protected readonly deltaManager:
|
|
254
|
-
ISequencedDocumentMessage,
|
|
255
|
-
IDocumentMessage
|
|
256
|
-
>,
|
|
243
|
+
protected readonly deltaManager: IDeltaManagerFull,
|
|
257
244
|
private readonly pendingStateManager: Pick<
|
|
258
245
|
PendingStateManager,
|
|
259
246
|
"minimumPendingMessageSequenceNumber"
|
package/src/deltaScheduler.ts
CHANGED
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { performance } from "@fluid-internal/client-utils";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
IDocumentMessage,
|
|
10
|
-
ISequencedDocumentMessage,
|
|
11
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
7
|
+
import { IDeltaManagerFull } from "@fluidframework/container-definitions/internal";
|
|
8
|
+
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
12
9
|
import { ITelemetryLoggerExt, formatTick } from "@fluidframework/telemetry-utils/internal";
|
|
13
10
|
|
|
14
11
|
/**
|
|
@@ -25,7 +22,7 @@ import { ITelemetryLoggerExt, formatTick } from "@fluidframework/telemetry-utils
|
|
|
25
22
|
* processed, the time and number of turns it took to process the ops.
|
|
26
23
|
*/
|
|
27
24
|
export class DeltaScheduler {
|
|
28
|
-
private readonly deltaManager:
|
|
25
|
+
private readonly deltaManager: IDeltaManagerFull;
|
|
29
26
|
// The time for processing ops in a single turn.
|
|
30
27
|
public static readonly processingTime = 50;
|
|
31
28
|
|
|
@@ -53,7 +50,7 @@ export class DeltaScheduler {
|
|
|
53
50
|
| undefined;
|
|
54
51
|
|
|
55
52
|
constructor(
|
|
56
|
-
deltaManager:
|
|
53
|
+
deltaManager: IDeltaManagerFull,
|
|
57
54
|
private readonly logger: ITelemetryLoggerExt,
|
|
58
55
|
) {
|
|
59
56
|
this.deltaManager = deltaManager;
|
package/src/packageVersion.ts
CHANGED
package/src/scheduleManager.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type { EventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import { performance } from "@fluid-internal/client-utils";
|
|
8
|
-
import {
|
|
8
|
+
import { IDeltaManagerFull } from "@fluidframework/container-definitions/internal";
|
|
9
9
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
10
10
|
import {
|
|
11
11
|
IDocumentMessage,
|
|
@@ -43,7 +43,7 @@ export class ScheduleManager {
|
|
|
43
43
|
private readonly deltaScheduler: DeltaScheduler;
|
|
44
44
|
|
|
45
45
|
constructor(
|
|
46
|
-
private readonly deltaManager:
|
|
46
|
+
private readonly deltaManager: IDeltaManagerFull,
|
|
47
47
|
private readonly emitter: EventEmitter,
|
|
48
48
|
readonly getClientId: () => string | undefined,
|
|
49
49
|
private readonly logger: ITelemetryLoggerExt,
|
|
@@ -78,7 +78,7 @@ class ScheduleManagerCore {
|
|
|
78
78
|
private batchCount = 0;
|
|
79
79
|
|
|
80
80
|
constructor(
|
|
81
|
-
private readonly deltaManager:
|
|
81
|
+
private readonly deltaManager: IDeltaManagerFull,
|
|
82
82
|
private readonly getClientId: () => string | undefined,
|
|
83
83
|
private readonly logger: ITelemetryLoggerExt,
|
|
84
84
|
) {
|