@fluidframework/container-runtime 2.1.0 → 2.1.2
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/container-runtime.test-files.tar +0 -0
- package/dist/containerRuntime.d.ts +1 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +40 -34
- package/dist/containerRuntime.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +7 -7
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +7 -18
- package/dist/opLifecycle/remoteMessageProcessor.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/pendingStateManager.d.ts +2 -12
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +0 -12
- package/dist/pendingStateManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +1 -0
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +40 -34
- package/lib/containerRuntime.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +7 -7
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +7 -18
- package/lib/opLifecycle/remoteMessageProcessor.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/pendingStateManager.d.ts +2 -12
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +0 -12
- package/lib/pendingStateManager.js.map +1 -1
- package/package.json +19 -32
- package/src/containerRuntime.ts +48 -39
- package/src/opLifecycle/remoteMessageProcessor.ts +9 -27
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +2 -21
package/lib/containerRuntime.js
CHANGED
|
@@ -675,13 +675,14 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
675
675
|
isAttached: () => this.attachState !== AttachState.Detached,
|
|
676
676
|
}, pendingRuntimeState?.pending, this.logger);
|
|
677
677
|
let outerDeltaManager;
|
|
678
|
-
|
|
678
|
+
this.useDeltaManagerOpsProxy =
|
|
679
|
+
this.mc.config.getBoolean("Fluid.ContainerRuntime.DeltaManagerOpsProxy") === true;
|
|
679
680
|
// The summarizerDeltaManager Proxy is used to lie to the summarizer to convince it is in the right state as a summarizer client.
|
|
680
681
|
const summarizerDeltaManagerProxy = new DeltaManagerSummarizerProxy(this.innerDeltaManager);
|
|
681
682
|
outerDeltaManager = summarizerDeltaManagerProxy;
|
|
682
683
|
// The DeltaManagerPendingOpsProxy is used to control the minimum sequence number
|
|
683
684
|
// It allows us to lie to the layers below so that they can maintain enough local state for rebasing ops.
|
|
684
|
-
if (useDeltaManagerOpsProxy) {
|
|
685
|
+
if (this.useDeltaManagerOpsProxy) {
|
|
685
686
|
const pendingOpsDeltaManagerProxy = new DeltaManagerPendingOpsProxy(summarizerDeltaManagerProxy, this.pendingStateManager);
|
|
686
687
|
outerDeltaManager = pendingOpsDeltaManagerProxy;
|
|
687
688
|
}
|
|
@@ -1478,36 +1479,33 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1478
1479
|
const messageCopy = { ...messageArg };
|
|
1479
1480
|
// We expect runtime messages to have JSON contents - deserialize it in place.
|
|
1480
1481
|
ensureContentsDeserialized(messageCopy, modernRuntimeMessage, logLegacyCase);
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
const
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
message,
|
|
1482
|
+
const processResult = this.remoteMessageProcessor.process(messageCopy);
|
|
1483
|
+
if (processResult === undefined) {
|
|
1484
|
+
// This means the incoming message is an incomplete part of a message or batch
|
|
1485
|
+
// and we need to process more messages before the rest of the system can understand it.
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
for (const message of processResult.messages) {
|
|
1489
|
+
const msg = modernRuntimeMessage
|
|
1490
|
+
? {
|
|
1491
|
+
// Cast it since we expect it to be this based on modernRuntimeMessage computation above.
|
|
1492
|
+
// There is nothing really ensuring that anytime original message.type is Operation that
|
|
1493
|
+
// the result messages will be so. In the end modern bool being true only directs to
|
|
1494
|
+
// throw error if ultimately unrecognized without compat details saying otherwise.
|
|
1495
|
+
message: message,
|
|
1496
1496
|
local,
|
|
1497
1497
|
modernRuntimeMessage,
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
savedOp,
|
|
1510
|
-
};
|
|
1498
|
+
batchStartCsn: processResult.batchStartCsn,
|
|
1499
|
+
}
|
|
1500
|
+
: // Unrecognized message will be ignored.
|
|
1501
|
+
{
|
|
1502
|
+
message,
|
|
1503
|
+
local,
|
|
1504
|
+
modernRuntimeMessage,
|
|
1505
|
+
batchStartCsn: processResult.batchStartCsn,
|
|
1506
|
+
};
|
|
1507
|
+
msg.savedOp = savedOp;
|
|
1508
|
+
// ensure that we observe any re-entrancy, and if needed, rebase ops
|
|
1511
1509
|
this.ensureNoDataModelChanges(() => this.processCore(msg));
|
|
1512
1510
|
}
|
|
1513
1511
|
}
|
|
@@ -1515,11 +1513,12 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1515
1513
|
* Direct the message to the correct subsystem for processing, and implement other side effects
|
|
1516
1514
|
*/
|
|
1517
1515
|
processCore(messageWithContext) {
|
|
1518
|
-
const { message, local
|
|
1516
|
+
const { message, local } = messageWithContext;
|
|
1519
1517
|
// Intercept to reduce minimum sequence number to the delta manager's minimum sequence number.
|
|
1520
1518
|
// Sequence numbers are not guaranteed to follow any sort of order. Re-entrancy is one of those situations
|
|
1521
|
-
if (this.
|
|
1522
|
-
|
|
1519
|
+
if (this.useDeltaManagerOpsProxy &&
|
|
1520
|
+
this.deltaManager.minimumSequenceNumber <
|
|
1521
|
+
messageWithContext.message.minimumSequenceNumber) {
|
|
1523
1522
|
messageWithContext.message.minimumSequenceNumber =
|
|
1524
1523
|
this.deltaManager.minimumSequenceNumber;
|
|
1525
1524
|
}
|
|
@@ -1529,8 +1528,15 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1529
1528
|
this.scheduleManager.beforeOpProcessing(message);
|
|
1530
1529
|
this._processedClientSequenceNumber = message.clientSequenceNumber;
|
|
1531
1530
|
try {
|
|
1532
|
-
//
|
|
1531
|
+
// See commit that added this assert for more details.
|
|
1532
|
+
// These calls should be made for all but chunked ops:
|
|
1533
|
+
// 1) this.pendingStateManager.processPendingLocalMessage() below
|
|
1534
|
+
// 2) this.resetReconnectCount() below
|
|
1533
1535
|
assert(message.type !== ContainerMessageType.ChunkedOp, 0x93b /* we should never get here with chunked ops */);
|
|
1536
|
+
let localOpMetadata;
|
|
1537
|
+
if (local && messageWithContext.modernRuntimeMessage) {
|
|
1538
|
+
localOpMetadata = this.pendingStateManager.processPendingLocalMessage(messageWithContext.message, messageWithContext.batchStartCsn);
|
|
1539
|
+
}
|
|
1534
1540
|
// If there are no more pending messages after processing a local message,
|
|
1535
1541
|
// the document is no longer dirty.
|
|
1536
1542
|
if (!this.hasPendingMessages()) {
|