Skip to content

Commit fa7091a

Browse files
readonlyInStagingMode default to false (#26004)
This pull request makes a small change to the default data store policies in the `dataStoreRuntime.ts` file. The change updates the default setting for `readonlyInStagingMode` to be `false` instead of `true`, allowing data stores to be writable in staging mode by default. This is to aid prototyping. StagingMode is still alpha, so this breaking change is acceptable.
1 parent 616f970 commit fa7091a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

packages/runtime/datastore/src/dataStoreRuntime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export interface ISharedObjectRegistry {
156156
}
157157

158158
const defaultPolicies: IFluidDataStorePolicies = {
159-
readonlyInStagingMode: true,
159+
readonlyInStagingMode: false,
160160
};
161161

162162
/**

packages/runtime/runtime-definitions/src/dataStoreContext.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,13 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
319319
*/
320320
export interface IFluidDataStorePolicies {
321321
/**
322-
* When set to true, data stores will appear to be readonly while in staging mode.
322+
* When set to true, the data store will appear readonly while in staging mode.
323323
*
324324
* @remarks
325-
* This policy is useful for data stores that do not support staging mode, such as those using consensus DDS.
326-
* It ensures that the data store appears readonly during staging mode to discourage unsupported operations.
325+
* In staging mode, operations are held locally until committed, so consensus-based operations
326+
* (e.g., `ConsensusRegisterCollection`, `ConsensusQueue`, `TaskManager`) won't resolve their promises until
327+
* staging mode exits. Set this to `true` for data stores that depend on consensus acknowledgments
328+
* to prevent modifications that would leave the data store in an unresponsive state.
327329
*/
328330
readonly readonlyInStagingMode: boolean;
329331
}

packages/test/local-server-tests/src/test/stagingMode.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ class DataObjectWithStagingMode extends DataObject {
128128
const dataObjectFactory = new DataObjectFactory({
129129
type: "TheDataObject",
130130
ctor: DataObjectWithStagingMode,
131-
policies: {
132-
readonlyInStagingMode: false,
133-
},
134131
});
135132

136133
// a simple container runtime factory with a single datastore aliased as default.

0 commit comments

Comments
 (0)