Skip to content
Source
Sign inSign up
TanStack/db

fix(query-db-collection): isolate query cache lifecycle ownership #1826

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/1826/headmerged by tannerlinsley

Showing 7 changed files with 27 additions and 19 deletions (loading 4).

x
0 of 7 viewed, 7 left
5 additions and 0 deletions.changeset/fix-query-cache-scope-invalidation.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/query-db-collection': patch
+---
+​
+Keep on-demand Query cache ownership and post-write readiness isolated across collections, co-owners, deferred cleanup, errors, and custom query hashes. Active enabled scopes revalidate from post-write provider results, while inactive collection-owned entries are removed without disturbing unrelated or foreign-observed Queries.
14 additions and 12 deletionsdocs/collections/query-collection.mdModified
View file
@@ -340,9 +340,9 @@
​
If a stale initial response triggers a fetch, the initial rows remain available
while it is in flight. A successful response reconciles them through the normal
-row ownership pipeline; an error retains the initial rows. Direct writes use the
-same Query cache-patching rules as fetched data, and a later successful server
-response may reconcile or replace those writes.
+row ownership pipeline; an error retains the initial rows. Direct writes patch
+the eager Query cache in place. On-demand direct writes revalidate scoped
+entries as described below.
​
### Selecting Rows from Wrapped Responses
​
@@ -382,7 +382,7 @@
​