Skip to content
Source
Sign inSign up
TanStack/query

fix(solid-query): show streamed chunks as they arrive instead of holding the first one 🤖🤖🤖 #12670

Opentydavid5(GitHub profile, opens in a new tab)wants to merge 1 commit intosolid-query-v6-pre fromrefs/pull/12670/headopened View on GitHub

Fixes #12665.

In solid-query v6, a query using experimental_streamedQuery only showed the first chunk until the whole stream finished, even though the cache already had every chunk. The hook kept waiting on the in-flight fetch promise instead of serving the fresh cache data.

This changes useBaseQuery so that when a cache write lands while a fetch is in flight, it serves the fresh data instead of waiting on the promise. An ordinary refetch still holds the committed value, since no cache write happens there.

Added three tests: streamed chunks show progressively, setQueryData during a refetch shows up, and the refetch hold still works when select is set.

    1. 🦋 Changeset detected

      Latest commit: f174c05f1e9dfa5283f7d3cb86303b40d1fb2e2d

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

      This PR includes no changesets

      When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

      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

    2. Important

      Review skipped

      Auto reviews are disabled on base/target branches other than the default branch.

      Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      Run configuration

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • Trigger review
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      Share

    3. tanstack-source added labelsbug

Sign in to join this conversation.