@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.
Files changed (69) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/channelCollection.d.ts +1 -1
  4. package/dist/channelCollection.d.ts.map +1 -1
  5. package/dist/channelCollection.js +3 -1
  6. package/dist/channelCollection.js.map +1 -1
  7. package/dist/containerRuntime.d.ts +1 -1
  8. package/dist/containerRuntime.d.ts.map +1 -1
  9. package/dist/containerRuntime.js +15 -14
  10. package/dist/containerRuntime.js.map +1 -1
  11. package/dist/opLifecycle/batchManager.d.ts +1 -0
  12. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  13. package/dist/opLifecycle/batchManager.js +3 -2
  14. package/dist/opLifecycle/batchManager.js.map +1 -1
  15. package/dist/opLifecycle/index.d.ts +1 -1
  16. package/dist/opLifecycle/index.d.ts.map +1 -1
  17. package/dist/opLifecycle/index.js +2 -1
  18. package/dist/opLifecycle/index.js.map +1 -1
  19. package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
  20. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  21. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  22. package/dist/opLifecycle/outbox.js +1 -1
  23. package/dist/opLifecycle/outbox.js.map +1 -1
  24. package/dist/packageVersion.d.ts +1 -1
  25. package/dist/packageVersion.d.ts.map +1 -1
  26. package/dist/packageVersion.js +1 -1
  27. package/dist/packageVersion.js.map +1 -1
  28. package/dist/pendingStateManager.d.ts +7 -6
  29. package/dist/pendingStateManager.d.ts.map +1 -1
  30. package/dist/pendingStateManager.js +20 -15
  31. package/dist/pendingStateManager.js.map +1 -1
  32. package/lib/channelCollection.d.ts +1 -1
  33. package/lib/channelCollection.d.ts.map +1 -1
  34. package/lib/channelCollection.js +3 -1
  35. package/lib/channelCollection.js.map +1 -1
  36. package/lib/containerRuntime.d.ts +1 -1
  37. package/lib/containerRuntime.d.ts.map +1 -1
  38. package/lib/containerRuntime.js +15 -14
  39. package/lib/containerRuntime.js.map +1 -1
  40. package/lib/opLifecycle/batchManager.d.ts +1 -0
  41. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  42. package/lib/opLifecycle/batchManager.js +1 -1
  43. package/lib/opLifecycle/batchManager.js.map +1 -1
  44. package/lib/opLifecycle/index.d.ts +1 -1
  45. package/lib/opLifecycle/index.d.ts.map +1 -1
  46. package/lib/opLifecycle/index.js +1 -1
  47. package/lib/opLifecycle/index.js.map +1 -1
  48. package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
  49. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  50. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  51. package/lib/opLifecycle/outbox.js +1 -1
  52. package/lib/opLifecycle/outbox.js.map +1 -1
  53. package/lib/packageVersion.d.ts +1 -1
  54. package/lib/packageVersion.d.ts.map +1 -1
  55. package/lib/packageVersion.js +1 -1
  56. package/lib/packageVersion.js.map +1 -1
  57. package/lib/pendingStateManager.d.ts +7 -6
  58. package/lib/pendingStateManager.d.ts.map +1 -1
  59. package/lib/pendingStateManager.js +20 -15
  60. package/lib/pendingStateManager.js.map +1 -1
  61. package/package.json +19 -19
  62. package/src/channelCollection.ts +3 -1
  63. package/src/containerRuntime.ts +21 -23
  64. package/src/opLifecycle/batchManager.ts +1 -1
  65. package/src/opLifecycle/index.ts +1 -0
  66. package/src/opLifecycle/opGroupingManager.ts +1 -1
  67. package/src/opLifecycle/outbox.ts +1 -1
  68. package/src/packageVersion.ts +1 -1
  69. package/src/pendingStateManager.ts +30 -22
@@ -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("already in staging mode");
624
+ throw new UsageError("Already in staging mode");
625
625
  }
626
626
  if (this.attachState === AttachState.Detached) {
627
- throw new UsageError("cannot enter staging mode while detached");
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
- assert(runtimeOp !== undefined, 0xb82 /* Staged batches expected to have runtimeOp defined */);
656
- this.rollbackStagedChanges(runtimeOp, localOpMetadata);
655
+ this.rollbackStagedChange(runtimeOp, localOpMetadata);
657
656
  });
658
657
  this.updateDocumentDirtyState();
659
658
  }),
660
- commitChanges: (optionsParam) => {
661
- const options = { ...defaultStagingCommitOptions, ...optionsParam };
662
- return exitStagingMode(() => {
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
- onlyStagedBatches: true,
665
- squash: options.squash ?? false,
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.rollbackStagedChanges(message.runtimeOp, message.localOpMetadata));
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
- rollbackStagedChanges({ type, contents }, localOpMetadata) {
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: {