fix: align persisted query retention fallback with effective gcTime#1400
Open
fix: align persisted query retention fallback with effective gcTime#1400
Conversation
When persistedGcTime is omitted, query collections now derive persisted retention ttl from the query's effective gcTime instead of skipping retention and cleaning rows too early. This preserves expected cache lifecycle behavior and adds coverage for the fallback path. Made-with: Cursor
Document the query-db-collection patch release for the persistedGcTime fallback so versioning captures the retention behavior fix. Made-with: Cursor
Make effective persisted retention tracking unambiguous by storing only defined ttl values, and remove a redundant assertion from the fallback regression test while preserving expiry bounds validation. Made-with: Cursor
Read fallback gcTime from the runtime query entry so persisted retention follows TanStack Query's effective gcTime even when defaults are implicit. Add a regression test covering implicit gcTime resolution. Made-with: Cursor
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-browser-wa-sqlite-persisted-collection
@tanstack/db-capacitor-sqlite-persisted-collection
@tanstack/db-cloudflare-do-sqlite-persisted-collection
@tanstack/db-electron-sqlite-persisted-collection
@tanstack/db-expo-sqlite-persisted-collection
@tanstack/db-ivm
@tanstack/db-node-sqlite-persisted-collection
@tanstack/db-react-native-sqlite-persisted-collection
@tanstack/db-sqlite-persisted-collection-core
@tanstack/db-tauri-sqlite-persisted-collection
@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: 111 kB ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 4.23 kB ℹ️ View Unchanged
|
thruflo
approved these changes
Mar 22, 2026
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.
Summary
gcTimewhenpersistedGcTimeis omittedgcTimebehavior is respected@tanstack/query-db-collectionpatch releaseTest plan
pnpm --filter query-db-collection test -- query.test.ts -t \"default persisted retention ttl to query gcTime when persistedGcTime is undefined\"pnpm --filter query-db-collection test -- query.test.ts -t \"runtime-ttl-retention\"Made with Cursor