Skip to content

fix: Apply FDv2 connection mode overrides after a network-driven offline - #2219

Draft
joker23 wants to merge 1 commit into
mainfrom
skz/fdv2-connection-mode-reconcile
Draft

joker23 wants to merge 1 commit into
mainfrom
skz/fdv2-connection-mode-reconcile

Conversation

@joker23

@joker23 joker23 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

fix: Prevent repeated setConnectionMode calls from delaying FDv2 mode changes

Summary

In the FDv2 data manager, setConnectionMode reached the debounce only through setRequestedMode, which ignores a mode that did not change. After the network moved the data system offline, an override that matched the foreground mode was recorded but never applied, so the data system stayed offline. Clearing an override had the same gap.

setConnectionMode now requests a reconcile through the new StateDebounceManager.requestReconcile() when the override changes. A repeated call with the same override returns early, so it cannot keep restarting the debounce window and hold back a pending network or lifecycle change. The override no longer goes through the requested mode, because mode resolution already reads the override first.

This affects every SDK that uses the shared FDv2 data manager: browser, React Native, node-client and Electron.

Additional context

The Electron SDK stack (above #2027) has regression tests for this against the real data manager. They land with its FDv2 layer after this merges.

setConnectionMode only reached the debounce through setRequestedMode, which
ignores an unchanged mode. An override that matched the foreground mode after
a network-driven offline never applied, and a cleared override had the same
gap. setConnectionMode now requests a reconcile when the override changes and
returns early when it does not, so repeated calls cannot hold back pending
mode changes.
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 19243 bytes
Compressed size limit: 33000
Uncompressed size: 106351 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26384 bytes
Compressed size limit: 44000
Uncompressed size: 171480 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 34637 bytes
Compressed size limit: 35500
Uncompressed size: 123503 bytes

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant