Skip to content

fix(query): stamp query flights with their fetch's start - #685

Merged
ryansolid merged 1 commit into
nextfrom
fix/stamp-query-flights
Oct 16, 2026
Merged

ryansolid merged 1 commit into
nextfrom
fix/stamp-query-flights

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Before: a route's preload starts a query() fetch, and the page reads it a render pass later, behind its lazy chunk. The read gets a fresh .then wrapper, so in dev and observe builds both waterfall checks (the client's ASYNC_WATERFALL and the server's SSR_BOUNDARY_WATERFALL) treat the work as starting at the read. That turns parallel route data into a false waterfall lead (solidjs/solid#4105).

After: query() stamps the fetch when it starts, and stamps each wrapper it hands out with that same start, through OBSERVE.attribution.markFlight. Both checks then see the data was already in flight and leave it out of the chain.

How: one internal stampFlight helper, called at the fetch and in settle(). Both calls sit behind OBSERVE &&, the same pattern the router already uses for withOrigin, so they fold out of shipped bundles. The slot's markFlight and flightOrigin come from solidjs/solid#4108. They're called optionally, so a solid-js without them is left alone.

Tests: the new test/data/query-flight-stamp.spec.ts covers a preloaded fetch read later through a wrapper, a fresh fetch, and an older solid-js. The first two fail without the change. The full suite passes (711 client + 96 server), and so do tsc and prettier.

🤖 Generated with Claude Code

https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1


Generated by Claude Code

query() hands each reader a fresh `.then` wrapper over the fetch. A route's
preload starts the fetch; the page reads it a render pass later behind its
lazy chunk, and the waterfall checks (ASYNC_WATERFALL on the client,
SSR_BOUNDARY_WATERFALL on the server) read that wrapper as work that only
started then. Stamp the fetch when it starts and each wrapper with the
fetch's start through `OBSERVE.attribution.markFlight` (solidjs/solid#4108).
Observe and dev only: `OBSERVE` folds out of shipped bundles, and a solid-js
without the stamp functions is left alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1
@changeset-bot

changeset-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 97b22e9

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

@ryansolid
ryansolid marked this pull request as ready for review October 16, 2026 05:19
@ryansolid
ryansolid merged commit 3c0fe32 into next Oct 16, 2026
4 checks passed
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.

2 participants