Repository navigation
fix: respect falsy server snapshots and production context overrides - #2389
Merged
markerikson merged 7 commits intoSep 30, 2026
Merged
Conversation
Member
|
Can you add some tests to both verify the behavior and ensure this doesn't regress in the future? |
commit: |
aryaemami59
reviewed
Aug 28, 2026
aryaemami59
reviewed
Aug 28, 2026
Author
|
Applied both suggestions: the production-mode context test and falsy serverState test now use Vitest it.for parameterization. The current check suite is green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Provider serverState={0},false,'', andnullinstead of silently using the client store's state during server rendering and hydration.contextprop in production. Currently the context assignment is inside the development-only validation block: production either throws when only a custom provider exists or silently selects the default provider's store when both providers exist.Implementation
Use an explicit undefined check for the optional server snapshot, and move the custom-context assignment outside the development validation guard. The validation itself remains development-only. The diff changes three lines across two files; subscription and selector logic are unchanged.
Verification
git diff --checkpass.useSyncExternalStorecall inside try/catch; this patch does not alter that error-handling path. Full CI OS/React-version matrices and device tests were not run locally.Compatibility / breaking changes
No public API, types, dependencies, or supported-platform changes. Explicit falsy server snapshots now take effect as documented; production context overrides now match development behavior. Apps relying on either previous bug will see the corrected state selection. Omitted/undefined snapshots still fall back to
store.getState.