Skip to content
Source
Sign inSign up
TanStack/db

fix(query-db): preserve source ownership and refetch outcomes #2143

ClosedKyleAMathews(GitHub profile, opens in a new tab)wants to merge 8 commits intomain fromcodex/query-source-reuse-followupopened

Showing 10 changed files with 61 additions and 37 deletions (loading 8).

x
0 of 10 viewed, 10 left
13 additions and 0 deletions.changeset/fix-query-source-reuse-ownership.mdAdded
View file
@@ -0,0 +1,13 @@
+---
+'@tanstack/query-db-collection': patch
+---
+​
+Keep shared on-demand Query acquisitions and direct writes correctly owned
+across cancellation, reuse, and out-of-order source results. Wait for an
+applied source result before settling retained persisted ownership, and reject
+opaque persister results that cannot prove revalidation. Reject a canceled
+exact snapshot refetch instead of fulfilling from prior cached data.
+Preserve a Query behavior's setup error when it rejects before installing a
+physical fetch, including retained revalidation. Do not retry that failed
+acquisition automatically. Abort abandoned provider work and keep its late
+result out of Collection rows and Query cache.
48 additions and 37 deletionsdocs/collections/query-collection.mdModified
View file
@@ -212,11 +212,11 @@
​
`placeholderData` is intentionally unsupported. TanStack Query treats placeholder data as observer-local presentation state rather than cached Query data. Materializing it would expose temporary UI data as collection-wide normalized rows. Render placeholders in the consuming UI instead.
​
-### Request Cancellation with `QueryFunctionContext.signal`
+### Request Cancellation
​
-TanStack Query passes an `AbortSignal` to `queryFn` through the query function
-context. Forward `ctx.signal` to `fetch` or another abortable client to make the