Skip to content

fix(server): collect every query for revalidate "*" in single flight - #713

Open
brenelz wants to merge 1 commit into
solidjs:nextfrom
brenelz:fix/flight-revalidate-all
Open

brenelz wants to merge 1 commit into
solidjs:nextfrom
brenelz:fix/flight-revalidate-all

Conversation

@brenelz

@brenelz brenelz commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

A single-flight mutation answered with revalidate: "*" collects no queries for the target page, so the client gets an empty flight payload. I found this while bug hunting on Solid next (rc.20); there is no issue for it.

Core (@solidjs/web server functions) passes the declared keys through as revalidateKeys: ["*"]. createFlightDataCollector used that array directly as event.router.dataOnly, and matchKey prefix-matches each key, so "*" matched no query key. On the client, readRevalidateKeys already treats "*" as "everything" and returns undefined.

The collector now uses dataOnly: true (collect everything) when the keys include "*", the same rule the client applies. REVALIDATE_ALL in src/data/query.ts is exported so both sides read the same constant. It is not re-exported from the package entry.

Verification:

  • New test/server/flight-revalidate-all.spec.tsx calls the collector with revalidateKeys: ["*"] and expects the page's query in the payload. It fails on next d034252 and passes with the fix.
  • pnpm test: 728 client tests, 106 server tests and tsc all pass.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: aa5e4be

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

This PR includes changesets to release 1 package
Name Type
@solidjs/router 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

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