-
Notifications
You must be signed in to change notification settings - Fork 576
Remove deprecated ILoaderOptions.enableOfflineLoad #27290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| "@fluidframework/container-definitions": minor | ||
| "@fluidframework/container-loader": minor | ||
| "__section": legacy | ||
| --- | ||
|
|
||
| Remove deprecated `ILoaderOptions.enableOfflineLoad` | ||
|
|
||
| The deprecated `enableOfflineLoad` property on `ILoaderOptions` has been removed, along with the legacy `Fluid.Container.enableOfflineLoad` feature gate read from the config provider. Offline load remains enabled by default for interactive clients. | ||
|
Check failure on line 9 in .changeset/remove-enable-offline-load.md
|
||
|
|
||
| To opt out, set `Fluid.Container.enableOfflineFull` to `false` via the config provider. To prevent silent misconfiguration, container load now throws a `UsageError` if a `pendingLocalState` is provided while `Fluid.Container.enableOfflineFull` is explicitly set to `false`. | ||
|
Check failure on line 11 in .changeset/remove-enable-offline-load.md
|
||
|
|
||
| #### Migration | ||
|
|
||
| - Remove any use of `enableOfflineLoad` from `ILoaderOptions` you pass to the `Loader`. | ||
| - If you previously set `Fluid.Container.enableOfflineLoad` via the config provider, set `Fluid.Container.enableOfflineFull` instead. | ||
|
Check failure on line 16 in .changeset/remove-enable-offline-load.md
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -610,11 +610,6 @@ export type ILoaderOptions = { | |
| */ | ||
| client?: IClient; | ||
|
|
||
| /** | ||
| * @deprecated Do not use. | ||
| */ | ||
| enableOfflineLoad?: boolean; | ||
|
|
||
| /** | ||
| * Provide the current Loader through the scope object when creating Containers. It is added | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deep Review: This removes The diff contains no entry under Before merge:
|
||
| * as the `ILoader` property, and will overwrite an existing property of the same name on the | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -961,11 +961,14 @@ export class Container | |
| enableSummarizeProtocolTree, | ||
| ); | ||
|
|
||
| const offlineLoadEnabled = | ||
| this.isInteractiveClient && | ||
| (this.mc.config.getBoolean("Fluid.Container.enableOfflineLoad") ?? | ||
| 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. | ||
|
|
||
| if (pendingLocalState !== undefined && explicitOfflineFull === false) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| throw new UsageError( | ||
| "Cannot load from pending local state when Fluid.Container.enableOfflineFull is explicitly disabled", | ||
| ); | ||
| } | ||
| const offlineLoadEnabled = this.isInteractiveClient && (explicitOfflineFull ?? true); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deep Review: The new code replaces 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:
Either keeps the "single gate" goal of the PR while preserving a runtime signal for migrating consumers. |
||
| this.serializedStateManager = new SerializedStateManager( | ||
| this.subLogger, | ||
| this.storageAdapter, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a legacy breaking change and needs to wait for the next legacy breaking release