Skip to content

fix: refetch queries after a refreshAll navigation when the cached query survives it - #16546

Open
Nic-Polumeyv wants to merge 5 commits into
sveltejs:version-3from
Nic-Polumeyv:fix-remote-query-reset-lost-v3
Open

fix: refetch queries after a refreshAll navigation when the cached query survives it#16546
Nic-Polumeyv wants to merge 5 commits into
sveltejs:version-3from
Nic-Polumeyv:fix-remote-query-reset-lost-v3

Conversation

@Nic-Polumeyv

@Nic-Polumeyv Nic-Polumeyv commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Replaces #16453 now that main is winding down; fixes #16444.

#promise ??= this.#run() compiles to an unconditional $.set (sveltejs/svelte#18592), so a render that evaluates while the resetting batch from a refreshAll navigation is still pending reads the pre-reset promise through the batch overlay and writes it straight back, erasing the reset. The deferred restart in client.js then sees a non-null promise and never refetches. Whether the cached query survives the navigation at all is GC timing, which is why this mostly shows up in Firefox.

This affects any refreshAll navigation: remote form redirects, applyAction, goto(url, { refreshAll: true }). Verified against the reproduction in #16444 on version-3 in Firefox: 10/10 stale before, 0/10 after, with the ??= line being the only difference. The spec fails without the runtime change.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 27, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 4df372e:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/4df372e75ae1f673831e838cbdc68fd073f4cc8c

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16546

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4df372e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@Nic-Polumeyv Nic-Polumeyv changed the title fix: refetch queries after a redirect when the cached query survives the navigation fix: refetch queries after a refreshAll navigation when the cached query survives it Jul 28, 2026
@Nic-Polumeyv
Nic-Polumeyv force-pushed the fix-remote-query-reset-lost-v3 branch from b2e55e5 to 4df372e Compare August 1, 2026 03:09
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.

Remote form redirect sometimes does not refresh queries in Firefox

1 participant