Prevent older preloads from overwriting mutations - #4329
Open
ryux1 wants to merge 1 commit into
Open
Conversation
A preloaded response can outlive a newer keyed mutation when revalidation is disabled. A later mount then consumes that older response instead of issuing a fresh request. Discard the key’s existing preload at mutation start and cover the ordering with a regression that distinguishes the obsolete response from the subsequent fetch.
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.
What
Why
A keyed mutation with revalidation disabled can leave an older response in
PRELOAD. When the hook mounts later, it consumes that response and overwrites the newer cached value. Invalidating the old preload makes the mount issue a fresh request instead.Fixes #4327
Testing
pnpm format:checkpnpm buildpnpm types:checkpnpm lintpnpm test-typingpnpm test --runInBand(35 suites, 389 passed, 5 skipped)pnpm test:build --runInBand(35 suites, 389 passed, 5 skipped)npm pack --ignore-scriptspnpm attw --pack .