fix: refetch queries after a redirect when the cached query survives the navigation#16453
Open
Nic-Polumeyv wants to merge 3 commits into
Open
fix: refetch queries after a redirect when the cached query survives the navigation#16453Nic-Polumeyv wants to merge 3 commits into
Nic-Polumeyv wants to merge 3 commits into
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/fa645e9dd2dda34adda8e5efdd50b9a2ee61e019Open in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: fa645e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 #16444, a regression from #16014 (2.65.1). Root cause analysis is in #16444 (comment).
This moves reset validity into a plain non-reactive field, where batch snapshotting can't hide it.
reset()sets a plain#staleflag,#get_promisere-runs the query when the promise it sees is stale or missing, and installing any new promise clears the flag. The??=write-back goes away with it. On the issue's repro Firefox goes from stale on every submit to correct on every submit, with exactly one refetch per redirect in both engines.The regression test reproduces the race deterministically in the client unit suite, so it doesn't depend on Firefox. A mounted harness with a persistent layout boundary and a conditionally rendered page boundary, and a gated fetch that keeps the reset batch pending while the page re-renders from a separate batch. It fails on
main(the page never refetches) and passes with the fix. Two supporting changes, the client vitest project resolves thebrowsercondition so specs canmountcomponents, and*.spec.sveltefixtures are excluded from the published package.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits