Skip to content
Source
Sign inSign up
TanStack/db

fix(db): dedupe singleton join demand with equality #2134

ClosedKyleAMathews(GitHub profile, opens in a new tab)wants to merge 54 commits intocodex/query-db-published-core fromcodex/fix-joined-query-dedupeopened

Showing 21 changed files with 22 additions and 0 deletions (loading 18).

x
0 of 21 viewed, 21 left
9 additions and 0 deletions.changeset/fix-query-source-reuse-ownership.mdAdded
View file
@@ -0,0 +1,9 @@
+---
+'@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.
8 additions and 0 deletions.changeset/fix-singleton-demand-identity.mdAdded
View file
@@ -0,0 +1,8 @@
+---
+'@tanstack/db': patch
+'@tanstack/query-db-collection': patch
+---
+​
+Share an on-demand Query Collection request when one live query filters by equality and another joined live query requests the same value through singleton membership. These equivalent non-null predicates now use the same demand key.
+​
+Keep distinct reference-proxy values separate when they occur inside literal equality operands or IN lists. Query keys for non-null singleton IN requests change in this release. When a matching demand runs, persisted Query Collections revalidate and retire historical owners and retention markers, including owners left without markers by an interrupted process. A historical reference-proxy key can name different literal objects with the same path. Revalidating a matching proxy demand retires that ambiguous old key after the new result applies; a failed fetch preserves it.
5 additions and 0 deletions.changeset/reject-aborted-persisted-subset.mdAdded
View file
@@ -0,0 +1,5 @@
+---