Fix: do not dedupe loadSubset calls in query collection#835
Merged
KyleAMathews merged 2 commits intomainfrom Nov 17, 2025
Merged
Fix: do not dedupe loadSubset calls in query collection#835KyleAMathews merged 2 commits intomainfrom
loadSubset calls in query collection#835KyleAMathews merged 2 commits intomainfrom
Conversation
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
Contributor
|
Size Change: 0 B Total Size: 86 kB ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 3.34 kB ℹ️ View Unchanged
|
KyleAMathews
approved these changes
Nov 17, 2025
Collaborator
KyleAMathews
left a comment
There was a problem hiding this comment.
Thanks for investigating! Let's get this merged/shipped to unbreak people.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #827 by temporarily disabling deduplication in the query collection. We do want to re-introduce it properly in the near future as described in #836.
The deduplication logic of
loadSubsetcalls in the query collection is currently causing problems because upon deduplicating aloadSubsetcall we do not track which other queries are the reason why we can deduplicate this one. As a result, when the original query (or queries) is/are GCed this deduplicated query doesn't know that and continues to load stale data from the local collection (and the local collection won't receive updates to these rows anymore).Keeping track of which queries are deduplicated because of which other queries would be quite complex. So instead, we remove this optimization for now and will rely on the query keys to deduplicate queries.