diff --git a/.changeset/shaky-queens-bake.md b/.changeset/shaky-queens-bake.md new file mode 100644 index 000000000000..ca392e8b457a --- /dev/null +++ b/.changeset/shaky-queens-bake.md @@ -0,0 +1,8 @@ +--- +"@fluidframework/container-runtime": minor +"__section": feature +--- + +`createBlobPayloadPending` runtime option now accepts `false` + +The `createBlobPayloadPending` property on `ContainerRuntimeOptions` (`@legacy @beta`) now has type `boolean | undefined` instead of `true | undefined`, allowing consumers to explicitly pass `false` to disable the feature. Passing `false` behaves the same as leaving the option `undefined` (disabled); this is a non-breaking, backwards-compatible widening of the accepted type. diff --git a/packages/framework/aqueduct/package.json b/packages/framework/aqueduct/package.json index c4a537b23673..3cdd704df2de 100644 --- a/packages/framework/aqueduct/package.json +++ b/packages/framework/aqueduct/package.json @@ -153,6 +153,9 @@ }, "typeValidation": { "broken": { + "Interface_ContainerRuntimeFactoryWithDefaultDataStoreProps": { + "backCompat": false + }, "Interface_DataObjectFactoryProps": { "backCompat": false }, diff --git a/packages/framework/aqueduct/src/test/types/validateAqueductPrevious.generated.ts b/packages/framework/aqueduct/src/test/types/validateAqueductPrevious.generated.ts index 66cf8d486222..13372667b96e 100644 --- a/packages/framework/aqueduct/src/test/types/validateAqueductPrevious.generated.ts +++ b/packages/framework/aqueduct/src/test/types/validateAqueductPrevious.generated.ts @@ -258,6 +258,7 @@ declare type old_as_current_for_Interface_ContainerRuntimeFactoryWithDefaultData * typeValidation.broken: * "Interface_ContainerRuntimeFactoryWithDefaultDataStoreProps": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_ContainerRuntimeFactoryWithDefaultDataStoreProps = requireAssignableTo, TypeOnly> /* diff --git a/packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md b/packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md index 037826e46b66..29e99ce7b4ef 100644 --- a/packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md +++ b/packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md @@ -36,7 +36,7 @@ export enum ContainerMessageType { export interface ContainerRuntimeOptions { readonly chunkSizeInBytes: number; readonly compressionOptions: ICompressionRuntimeOptions; - readonly createBlobPayloadPending: true | undefined; + readonly createBlobPayloadPending: boolean | undefined; readonly disableSchemaUpgrade: boolean; // @deprecated readonly enableGroupedBatching: boolean; diff --git a/packages/runtime/container-runtime/api-report/container-runtime.legacy.beta.api.md b/packages/runtime/container-runtime/api-report/container-runtime.legacy.beta.api.md index 456376f857d0..65a565bacf07 100644 --- a/packages/runtime/container-runtime/api-report/container-runtime.legacy.beta.api.md +++ b/packages/runtime/container-runtime/api-report/container-runtime.legacy.beta.api.md @@ -36,7 +36,7 @@ export enum ContainerMessageType { export interface ContainerRuntimeOptions { readonly chunkSizeInBytes: number; readonly compressionOptions: ICompressionRuntimeOptions; - readonly createBlobPayloadPending: true | undefined; + readonly createBlobPayloadPending: boolean | undefined; readonly disableSchemaUpgrade: boolean; // @deprecated readonly enableGroupedBatching: boolean; diff --git a/packages/runtime/container-runtime/package.json b/packages/runtime/container-runtime/package.json index f7d669660dad..24fce2afc165 100644 --- a/packages/runtime/container-runtime/package.json +++ b/packages/runtime/container-runtime/package.json @@ -233,6 +233,12 @@ "broken": { "Interface_LoadContainerRuntimeParams": { "backCompat": false + }, + "Interface_ContainerRuntimeOptions": { + "backCompat": false + }, + "TypeAlias_IContainerRuntimeOptions": { + "backCompat": false } }, "entrypoint": "legacy" diff --git a/packages/runtime/container-runtime/src/containerCompatibility.ts b/packages/runtime/container-runtime/src/containerCompatibility.ts index f7f4eda73509..6e8086070085 100644 --- a/packages/runtime/container-runtime/src/containerCompatibility.ts +++ b/packages/runtime/container-runtime/src/containerCompatibility.ts @@ -207,6 +207,7 @@ const runtimeOptionsAffectingDocSchemaConfigValidationMap: ConfigValidationMap runtimeOptionKeysThatRequireExplicitSchemaControl.includes( key as RuntimeOptionKeysThatRequireExplicitSchemaControl, - ) && runtimeOptions[key] !== undefined, + ) && + runtimeOptions[key] !== undefined && + // `false` is equivalent to the option being disabled/unset, so it doesn't require explicitSchemaControl. + runtimeOptions[key] !== false, ); if (disallowedKeys.length > 0) { throw new UsageError(`explicitSchemaControl must be enabled to use ${disallowedKeys}`); @@ -1280,7 +1283,9 @@ export class ContainerRuntime compressionLz4, idCompressorMode, opGroupingEnabled: enableGroupedBatching, - createBlobPayloadPending, + // Document schema only recognizes `true | undefined` for this feature (see DocumentSchemaValueType), + // so normalize an explicit `false` runtime option to `undefined` before persisting. + createBlobPayloadPending: createBlobPayloadPending === true ? true : undefined, disallowedVersions: [], }, (schema) => { diff --git a/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts b/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts index 8737c69cae68..b7a22f4bbcbc 100644 --- a/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts +++ b/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts @@ -105,6 +105,7 @@ declare type old_as_current_for_Interface_ContainerRuntimeOptions = requireAssig * typeValidation.broken: * "Interface_ContainerRuntimeOptions": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_ContainerRuntimeOptions = requireAssignableTo, TypeOnly> /* @@ -772,6 +773,7 @@ declare type old_as_current_for_TypeAlias_IContainerRuntimeOptions = requireAssi * typeValidation.broken: * "TypeAlias_IContainerRuntimeOptions": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_TypeAlias_IContainerRuntimeOptions = requireAssignableTo, TypeOnly> /* diff --git a/packages/test/test-service-load/src/optionsMatrix.ts b/packages/test/test-service-load/src/optionsMatrix.ts index 1f2ea5f05b40..010cb18abb07 100644 --- a/packages/test/test-service-load/src/optionsMatrix.ts +++ b/packages/test/test-service-load/src/optionsMatrix.ts @@ -144,7 +144,7 @@ export function generateRuntimeOptions( // Override explicitSchemaControl to enabled if createBlobPayloadPending is enabled pairwiseOptions.map((options) => { - if (options.createBlobPayloadPending) { + if (options.createBlobPayloadPending === true) { ( options as { // Remove readonly modifier to allow overriding