Remove deprecated ILoaderOptions.enableOfflineLoad#27290
Conversation
Removes the deprecated `enableOfflineLoad` field from `ILoaderOptions` and the legacy `Fluid.Container.enableOfflineLoad` config gate. Default offline-load behavior for interactive clients is preserved; opt-out is via `Fluid.Container.enableOfflineFull: false`. Container load now throws a `UsageError` if `pendingLocalState` is provided while `Fluid.Container.enableOfflineFull` is explicitly disabled, to prevent silent offline-load misconfiguration. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (41 lines, 6 files), I've queued these reviewers:
How this works
|
There was a problem hiding this comment.
Pull request overview
Removes the deprecated ILoaderOptions.enableOfflineLoad API surface and the legacy Fluid.Container.enableOfflineLoad config read, consolidating offline-load control onto Fluid.Container.enableOfflineFull while preserving the default “enabled for interactive clients” behavior. Adds a defensive UsageError to prevent loading from pendingLocalState when offline-load is explicitly disabled.
Changes:
- Remove
enableOfflineLoadfromILoaderOptionsand update the corresponding legacy beta API report. - Update container offline-load enablement to be driven solely by
Fluid.Container.enableOfflineFull, and throw onpendingLocalState+ explicit disable. - Remove
enableOfflineLoadfrom the test-service-load options matrix and adjust offline stashing logic accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/test/test-service-load/src/runner.ts | Removes dependency on deprecated loader option when deciding whether to stash pending local state. |
| packages/test/test-service-load/src/optionsMatrix.ts | Drops deprecated enableOfflineLoad from generated loader option permutations. |
| packages/loader/container-loader/src/container.ts | Consolidates offline-load enablement onto enableOfflineFull and adds a defensive UsageError on misconfiguration. |
| packages/common/container-definitions/src/loader.ts | Removes deprecated enableOfflineLoad from ILoaderOptions. |
| packages/common/container-definitions/api-report/container-definitions.legacy.beta.api.md | Updates legacy beta API report to reflect removal of enableOfflineLoad. |
| .changeset/remove-enable-offline-load.md | Adds changeset documenting the breaking removal and migration guidance. |
| this.mc.config.getBoolean("Fluid.Container.enableOfflineFull") ?? | ||
| options.enableOfflineLoad !== false); | ||
| const explicitOfflineFull = this.mc.config.getBoolean("Fluid.Container.enableOfflineFull"); | ||
| // paranoic defense mechanism while enableOfflineFull still exists in config. |
| export type ILoaderOptions = { | ||
| cache?: boolean; | ||
| client?: IClient; | ||
| enableOfflineLoad?: boolean; |
There was a problem hiding this comment.
this is a legacy breaking change and needs to wait for the next legacy breaking release
| options.enableOfflineLoad !== false); | ||
| const explicitOfflineFull = this.mc.config.getBoolean("Fluid.Container.enableOfflineFull"); | ||
| // paranoic defense mechanism while enableOfflineFull still exists in config. | ||
| if (pendingLocalState !== undefined && explicitOfflineFull === false) { |
There was a problem hiding this comment.
the user passing pending state is a signal they want to load from it, i don't think we should override that decision based on flag, and i don't think we did before. the flags are a bit of a mess, but i wouldn't expect new error cases
There was a problem hiding this comment.
It's not an override but a safeguard. In any case, given these change will need to wait I'd just ignore the depracated flag for now. I wanted to start with this one as it was the cleanest to remove. I agree flags are a mess right now.
Deep ReviewReviewed commit Readiness: 5/10 — MAKING PROGRESS Not ready for sign-off. Two concerns flagged inline: a silent runtime semantic flip for consumers using the legacy Path to Ready
Context for Reviewers
For human reviewer
|
| "Cannot load from pending local state when Fluid.Container.enableOfflineFull is explicitly disabled", | ||
| ); | ||
| } | ||
| const offlineLoadEnabled = this.isInteractiveClient && (explicitOfflineFull ?? true); |
There was a problem hiding this comment.
Deep Review: The new code replaces getBoolean("Fluid.Container.enableOfflineLoad") ?? getBoolean("Fluid.Container.enableOfflineFull") ?? options.enableOfflineLoad !== false with a single read of Fluid.Container.enableOfflineFull. A consumer who today sets Fluid.Container.enableOfflineLoad: false via the config provider to opt out of offline-load gets the opposite behaviour after this PR — offline silently re-enabled. The new UsageError only fires on explicitOfflineFull === false, so this case produces no UsageError, no telemetry, and no compile break (the config provider is a dynamic string surface).
PR #19306 (ChumpChief, 2024-02-02) established the transition-path rule for this exact option — anthony-murphy: "i like removing it, but i think its used today, so we need a transition path, i don't think we can just unilaterally remove". This PR satisfies that for the typed surface but not for the equally-public config-provider key. The changeset documents the rename but no runtime hint exists when the stale key is observed.
Two cheap local fixes, either works:
- (a) Emit a one-shot
mc.loggertelemetry warning whenFluid.Container.enableOfflineLoadis observed in the config provider, so partners notice they need to migrate before behaviour silently flips. - (b) Extend the new
UsageErrorguard to also throw when the legacy key is explicitlyfalse, mirroring thependingLocalState + enableOfflineFull=falsesafety net.
Either keeps the "single gate" goal of the PR while preserving a runtime signal for migrating consumers.
| enableOfflineLoad?: boolean; | ||
|
|
||
| /** | ||
| * Provide the current Loader through the scope object when creating Containers. It is added |
There was a problem hiding this comment.
Deep Review: This removes enableOfflineLoad?: boolean from the @legacy @beta ILoaderOptions surface (api-report change at container-definitions.legacy.beta.api.md:436-440). You flagged this yourself in the PR description: "This is a @legacy @beta break. Per the Beta-Break-Process it must land in a .N0 minor and may need to be staged on test/breaks/client/X.Y0/. Confirm we're in the right release window before merging."
The diff contains no entry under packages/test/breaks/client/... and no version-bump-policy / legacy.beta rename. Precedent #19306 (ChumpChief, 2024-02-02) took two steps over a long window — deprecate-then-remove — with explicit framing debate on the API surface.
Before merge:
- Confirm with the release manager and ChumpChief that this lands in a
.N0minor for@fluidframework/container-definitions. - If the Beta-Break-Process harness requires it for the current version, add the corresponding
test/breaks/client/X.Y0/staging entry in this PR. - Verify CI's type-compat pipeline produces the correct
validate*Previous.generated.tsartifacts (regenerate by hand if needed).
Description
Removes the deprecated
enableOfflineLoadfield fromILoaderOptions(@fluidframework/container-definitions) and the legacyFluid.Container.enableOfflineLoadfeature-gate read from the config provider. The field was already marked@deprecated Do not use.; this completes its removal.Offline-load default behavior is preserved: interactive clients still get offline load enabled by default. To opt out, set
Fluid.Container.enableOfflineFull: falsevia the config provider — that is now the single control surface.As a safety net for callers migrating from the legacy gate,
Containerload now throws aUsageErrorifpendingLocalStateis provided whileFluid.Container.enableOfflineFullis explicitly set tofalse. This prevents silently loading from pending state with offline-load disabled.Also drops the deprecated entry from the
test-service-loadoptions matrix and updates the stress-runner gate that referenced it.Breaking Changes
ILoaderOptions.enableOfflineLoad(@legacy @beta) is removed. Migration:enableOfflineLoadfrom anyILoaderOptionspassed to theLoader.Fluid.Container.enableOfflineLoadvia the config provider, setFluid.Container.enableOfflineFullinstead (same boolean value).See Breaking-vs-Non-breaking-Changes.
Reviewer Guidance
The review process is outlined on this wiki page.
@legacy @betabreak. Per the Beta-Break-Process it must land in a.N0minor and may need to be staged ontest/breaks/client/X.Y0/. Confirm we're in the right release window before merging.fluid-cr-apiwill be auto-assigned as a required reviewer.enableOfflineFullremains the control surface; happy to drop or relax it if reviewers prefer.