Remove FlushModeExperimental.Async and all associated infrastructure#26579
Remove FlushModeExperimental.Async and all associated infrastructure#26579anthony-murphy merged 6 commits intomainfrom
Conversation
Co-authored-by: anthony-murphy <1951092+anthony-murphy@users.noreply.github.com>
|
/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid, Build - protocol-definitions, Build site |
|
/azp run Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR removes the unused FlushModeExperimental.Async flush mode and the associated runtime/test infrastructure, simplifying flush-mode handling and eliminating dead/never-promoted API surface in the runtime layer.
Changes:
- Removed
FlushModeExperimentalfrom@fluidframework/runtime-definitionsand stopped exporting it from the package index. - Simplified
ContainerRuntimeflush-mode logic by removing Async handling and the loader feature-detection fallback path. - Deleted/updated tests that exercised Async flush mode and cleaned up now-unused imports.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/test/test-end-to-end-tests/src/test/fewerBatches.spec.ts | Removes the Async flush-mode test case and simplifies test naming to rely only on FlushMode. |
| packages/runtime/runtime-definitions/src/index.ts | Stops exporting FlushModeExperimental from the runtime-definitions barrel. |
| packages/runtime/runtime-definitions/src/dataStoreContext.ts | Deletes the FlushModeExperimental enum definition. |
| packages/runtime/container-runtime/src/test/containerRuntime.spec.ts | Removes Async-related test coverage and associated feature-detection/fallback tests and imports. |
| packages/runtime/container-runtime/src/containerRuntime.ts | Removes Async-specific constructor fallback logic and the Async branch in scheduleFlush(). |
Co-authored-by: anthony-murphy <1951092+anthony-murphy@users.noreply.github.com>
Co-authored-by: anthony-murphy <1951092+anthony-murphy@users.noreply.github.com>
…p tracking Co-authored-by: anthony-murphy <1951092+anthony-murphy@users.noreply.github.com>
|
/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid, Build - protocol-definitions, Build site |
|
/azp run Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
| this._flushMode = runtimeOptions.flushMode; | ||
| // TODO: Added in 2.90.0 - Remove this validation once we've released and confirmed no consumer passes an invalid flushMode value. | ||
| if (this._flushMode !== FlushMode.Immediate && this._flushMode !== FlushMode.TurnBased) { | ||
| const error = new UsageError( | ||
| "Invalid flushMode runtime option. Expected FlushMode.Immediate or FlushMode.TurnBased.", | ||
| ); | ||
| this.closeFn(error); | ||
| throw error; |
There was a problem hiding this comment.
The new constructor validation for runtimeOptions.flushMode is important behavior (rejecting stale/invalid numeric values like the former Async = 2). There isn’t a unit test asserting that ContainerRuntime.loadRuntime2() throws a UsageError (and closes) when an invalid flushMode is provided. Adding a test would prevent regressions and confirm the temporary guard works as intended.
There was a problem hiding this comment.
Added a unit test "Throws UsageError and calls closeFn for invalid flushMode" in the Batching describe block in afba4e0. The test passes 2 (the former FlushModeExperimental.Async value) as an invalid flushMode and verifies that loadRuntime2 rejects with a UsageError and that closeFn is called with the same error.
|
@copilot the build is failing. you need ensure it passes. looks like the build is generating edits, which is allowed, and those need to be part of the PR |
Co-authored-by: anthony-murphy <1951092+anthony-murphy@users.noreply.github.com>
Fixed in afba4e0. The biome formatter wanted to collapse two-item arrays to a single line after |
|
/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid, Build - protocol-definitions, Build site |
|
/azp run Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
FlushModeExperimental.Asyncwas dead code — never promoted to a real API (cast viaas unknown as FlushMode), incompatible with offline mode, and unused in practice. This removes it entirely.Description
runtime-definitions: DeletedFlushModeExperimentalenum; removed from index exports.containerRuntime.ts:FlushModeExperimentalimport.FlushModeFallbackconstructor logic (thereferenceSequenceNumbersloader feature check and conditional fallback toTurnBased)._flushModeis now set directly fromruntimeOptions.flushMode.supportedFeaturesfrom context destructuring (no longer read).case FlushModeExperimental.Async as unknown as FlushModebranch fromscheduleFlush().UsageError(and callscloseFn) ifflushModeis notFlushMode.ImmediateorFlushMode.TurnBased, ensuring hosts passing invalid/stale values get a clear error instead of hitting an internal assertion. The validation is annotated with// TODO: Added in 2.90.0 - Remove this validation once we've released and confirmed no consumer passes an invalid flushMode value.to make it easy to identify when it is safe to remove.containerRuntime.spec.ts:FlushModeExperimental.AsyncfromorderSequentiallyflush mode arrays, removed it from container load statsruntimeOptions, and cleaned up unused imports (ILayerCompatDetails,IProvideLayerCompatDetails).orderSequentiallyflush mode arrays (collapsed to single-line after removal of the third element).Batchingdescribe block, asserting that passing a stale numeric value (e.g., the formerFlushModeExperimental.Async = 2) rejects with aUsageErrorand invokescloseFnwith the same error.fewerBatches.spec.ts: Removed theFlushModeExperimental.Asyncbatch count test case and import.Breaking Changes
FlushModeExperimentalis removed from@fluidframework/runtime-definitions. Any code importing or referencingFlushModeExperimental.Asyncwill break. Since this was@internaland@experimental, no public API consumers should be affected.Reviewer Guidance
The
FlushMode.Immediatelegacy path (1.x compat) is intentionally left untouched per the issue scope — that's a separate cleanup.The
flushModevalidation block in the constructor is intentionally temporary — it guards against hosts that may still pass the oldAsyncnumeric value (2) from plain JS. It is tagged with the version it was introduced in (2.90.0) so it can be safely removed once we've released and confirmed no consumer hits it.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.