@fluidframework/container-runtime 2.43.0-343119 → 2.43.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/CHANGELOG.md +4 -0
- package/container-runtime.test-files.tar +0 -0
- package/dist/channelCollection.d.ts +1 -1
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +3 -1
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +1 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +15 -14
- package/dist/containerRuntime.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +1 -0
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +3 -2
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +1 -1
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +2 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/outbox.js +1 -1
- package/dist/opLifecycle/outbox.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/pendingStateManager.d.ts +7 -6
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +20 -15
- package/dist/pendingStateManager.js.map +1 -1
- package/lib/channelCollection.d.ts +1 -1
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +3 -1
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +1 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +15 -14
- package/lib/containerRuntime.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +1 -0
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +1 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +1 -1
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +1 -1
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/outbox.js +1 -1
- package/lib/opLifecycle/outbox.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/pendingStateManager.d.ts +7 -6
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +20 -15
- package/lib/pendingStateManager.js.map +1 -1
- package/package.json +19 -19
- package/src/channelCollection.ts +3 -1
- package/src/containerRuntime.ts +21 -23
- package/src/opLifecycle/batchManager.ts +1 -1
- package/src/opLifecycle/index.ts +1 -0
- package/src/opLifecycle/opGroupingManager.ts +1 -1
- package/src/opLifecycle/outbox.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +30 -22
package/lib/containerRuntime.js
CHANGED
|
@@ -621,15 +621,15 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
621
621
|
// eslint-disable-next-line import/no-deprecated
|
|
622
622
|
this.enterStagingMode = () => {
|
|
623
623
|
if (this.stageControls !== undefined) {
|
|
624
|
-
throw new UsageError("
|
|
624
|
+
throw new UsageError("Already in staging mode");
|
|
625
625
|
}
|
|
626
626
|
if (this.attachState === AttachState.Detached) {
|
|
627
|
-
throw new UsageError("
|
|
627
|
+
throw new UsageError("Cannot enter staging mode while Detached");
|
|
628
628
|
}
|
|
629
629
|
// Make sure Outbox is empty before entering staging mode,
|
|
630
630
|
// since we mark whole batches as "staged" or not to indicate whether to submit them.
|
|
631
631
|
this.flush();
|
|
632
|
-
const exitStagingMode = (discardOrCommit) =>
|
|
632
|
+
const exitStagingMode = (discardOrCommit) => {
|
|
633
633
|
try {
|
|
634
634
|
// Final flush of any last staged changes
|
|
635
635
|
// NOTE: We can't use this.flush() here, because orderSequentially uses StagingMode and in the rollback case we'll hit assert 0x24c
|
|
@@ -649,22 +649,23 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
649
649
|
};
|
|
650
650
|
// eslint-disable-next-line import/no-deprecated
|
|
651
651
|
const stageControls = {
|
|
652
|
-
discardChanges: exitStagingMode(() => {
|
|
652
|
+
discardChanges: () => exitStagingMode(() => {
|
|
653
653
|
// Pop all staged batches from the PSM and roll them back in LIFO order
|
|
654
654
|
this.pendingStateManager.popStagedBatches(({ runtimeOp, localOpMetadata }) => {
|
|
655
|
-
|
|
656
|
-
this.rollbackStagedChanges(runtimeOp, localOpMetadata);
|
|
655
|
+
this.rollbackStagedChange(runtimeOp, localOpMetadata);
|
|
657
656
|
});
|
|
658
657
|
this.updateDocumentDirtyState();
|
|
659
658
|
}),
|
|
660
|
-
commitChanges: (
|
|
661
|
-
const
|
|
662
|
-
|
|
659
|
+
commitChanges: (options) => {
|
|
660
|
+
const { squash } = { ...defaultStagingCommitOptions, ...options };
|
|
661
|
+
exitStagingMode(() => {
|
|
662
|
+
// Replay all staged batches in typical FIFO order.
|
|
663
|
+
// We'll be out of staging mode so they'll be sent to the service finally.
|
|
663
664
|
this.pendingStateManager.replayPendingStates({
|
|
664
|
-
|
|
665
|
-
squash
|
|
665
|
+
committingStagedBatches: true,
|
|
666
|
+
squash,
|
|
666
667
|
});
|
|
667
|
-
})
|
|
668
|
+
});
|
|
668
669
|
},
|
|
669
670
|
};
|
|
670
671
|
this.stageControls = stageControls;
|
|
@@ -2076,7 +2077,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2076
2077
|
try {
|
|
2077
2078
|
checkpoint.rollback((message) =>
|
|
2078
2079
|
// These changes are staged since we entered staging mode above
|
|
2079
|
-
this.
|
|
2080
|
+
this.rollbackStagedChange(message.runtimeOp, message.localOpMetadata));
|
|
2080
2081
|
this.updateDocumentDirtyState();
|
|
2081
2082
|
stageControls?.discardChanges();
|
|
2082
2083
|
stageControls = undefined;
|
|
@@ -3055,7 +3056,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
3055
3056
|
/**
|
|
3056
3057
|
* Rollback the given op which was only staged but not yet submitted.
|
|
3057
3058
|
*/
|
|
3058
|
-
|
|
3059
|
+
rollbackStagedChange({ type, contents }, localOpMetadata) {
|
|
3059
3060
|
assert(canStageMessageOfType(type), 0xbbc /* Unexpected message type to be rolled back */);
|
|
3060
3061
|
switch (type) {
|
|
3061
3062
|
case ContainerMessageType.FluidDataStoreOp: {
|