Skip to content

Conversation

@delphinaubin
Copy link

@delphinaubin delphinaubin commented Dec 12, 2025

🎯 Changes

This PR addresses the issue #998 and restores the complete TanStack Query lifecycle when using on-demand collection synchronization.

βœ… Checklist

πŸš€ Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

πŸ¦‹ Changeset detected

Latest commit: ed2944d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/query-db-collection Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@delphinaubin delphinaubin changed the title fix(query-db-collection): sync=on-demand tanstack-query lifecycle fix(query-db-collection): sync on-demand tanstack-query lifecycle Dec 12, 2025
@delphinaubin delphinaubin force-pushed the fix-query-on-demand-sync-db-collection branch from fce1597 to d6e09f5 Compare December 12, 2025 15:44
Copy link
Collaborator

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Could you make the one tweak & add a changeset to the .changeset? Thanks for putting up the fix!

queries: {
gcTime: 5 * 60 * 1000, // 5 minutes
staleTime: 0,
staleTime: 100, // set a minimal staleTime to prevent a refetch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use Infinity as this could flake potentially on slow CI

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done βœ…

@delphinaubin delphinaubin force-pushed the fix-query-on-demand-sync-db-collection branch from 5e72a27 to 1b0ac9f Compare December 17, 2025 15:59
@delphinaubin delphinaubin force-pushed the fix-query-on-demand-sync-db-collection branch from 1b0ac9f to ed2944d Compare December 17, 2025 16:07
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