Skip to content
Source
Sign inSign up
TanStack/db

fix(query-db): clean up empty ownership sets #1672

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 10 commits intomain fromrefs/pull/1672/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

Showing 3 changed files with 41 additions and 10 deletions (loading 1).

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/clean-query-ownership.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/query-db-collection': patch
+---
+​
+Clean up empty query ownership state while preserving authoritative empty results and retained-row lifecycle behavior.
36 additions and 10 deletionspackages/query-db-collection/src/query.tsModified
View file
@@ -737,7 +737,8 @@
// hashedQueryKey → queryKey
const hashToQueryKey = new Map<string, QueryKey>()
​
- // queryKey → Set<RowKey>
+ // queryKey → Set<RowKey>. Entry presence means ownership is resolved;
+ // an empty set represents a resolved query that currently owns no rows.
Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)
const queryToRows = new Map<string, Set<string | number>>()
​