Skip to content

Conversation

@github-actions
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@tanstack/angular-db@0.1.31

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/db@0.5.5

Patch Changes

  • Fix data loss on component remount by implementing reference counting for QueryObserver lifecycle (#870)

    What changed vs main:

    Previously, when live query subscriptions unsubscribed, there was no tracking of which rows were still needed by other active queries. This caused data loss during remounts.

    This PR adds reference counting infrastructure to properly manage QueryObserver lifecycle:

    1. Pass same predicates to unloadSubset that were passed to loadSubset
    2. Use them to compute the queryKey (via generateQueryKeyFromOptions)
    3. Use existing machinery (queryToRows map) to find rows that query loaded
    4. Decrement the ref count
    5. GC rows where count reaches 0 (no longer referenced by any active query)

    Impact:

    • Navigation back to previously loaded pages shows cached data immediately
    • No unnecessary refetches during quick remounts (< gcTime)
    • Multiple live queries with identical predicates correctly share QueryObservers
    • Proper row-level cleanup when last subscriber leaves
    • TanStack Query's cache lifecycle (gcTime) is fully respected
    • No data leakage from in-flight requests when unsubscribing

@tanstack/electric-db-collection@0.2.5

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/powersync-db-collection@0.1.9

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/query-db-collection@1.0.4

Patch Changes

  • Fix data loss on component remount by implementing reference counting for QueryObserver lifecycle (#870)

    What changed vs main:

    Previously, when live query subscriptions unsubscribed, there was no tracking of which rows were still needed by other active queries. This caused data loss during remounts.

    This PR adds reference counting infrastructure to properly manage QueryObserver lifecycle:

    1. Pass same predicates to unloadSubset that were passed to loadSubset
    2. Use them to compute the queryKey (via generateQueryKeyFromOptions)
    3. Use existing machinery (queryToRows map) to find rows that query loaded
    4. Decrement the ref count
    5. GC rows where count reaches 0 (no longer referenced by any active query)

    Impact:

    • Navigation back to previously loaded pages shows cached data immediately
    • No unnecessary refetches during quick remounts (< gcTime)
    • Multiple live queries with identical predicates correctly share QueryObservers
    • Proper row-level cleanup when last subscriber leaves
    • TanStack Query's cache lifecycle (gcTime) is fully respected
    • No data leakage from in-flight requests when unsubscribing
  • Updated dependencies [077fc1a]:

    • @tanstack/db@0.5.5

@tanstack/react-db@0.1.49

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/rxdb-db-collection@0.1.37

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/solid-db@0.1.48

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/svelte-db@0.1.48

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/trailbase-db-collection@0.1.49

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/vue-db@0.0.81

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/db@0.5.5

@tanstack/db-collection-e2e@0.0.7

Patch Changes

  • Updated dependencies [077fc1a]:
    • @tanstack/query-db-collection@1.0.4
    • @tanstack/db@0.5.5
    • @tanstack/electric-db-collection@0.2.5

@KyleAMathews KyleAMathews merged commit 9f7cac6 into main Nov 22, 2025
@KyleAMathews KyleAMathews deleted the changeset-release/main branch November 22, 2025 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants