fix(angular-db): config-object input to injectLiveQuery now syncs#1638
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughFixed the config-object branch of ChangesinjectLiveQuery config-object startSync fix
Estimated code review effort: 1 (Trivial) | ~5 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
More templates
@tanstack/angular-db
@tanstack/browser-db-sqlite-persistence
@tanstack/capacitor-db-sqlite-persistence
@tanstack/cloudflare-durable-objects-db-sqlite-persistence
@tanstack/db
@tanstack/db-ivm
@tanstack/db-sqlite-persistence-core
@tanstack/electric-db-collection
@tanstack/electron-db-sqlite-persistence
@tanstack/expo-db-sqlite-persistence
@tanstack/node-db-sqlite-persistence
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/react-native-db-sqlite-persistence
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/tauri-db-sqlite-persistence
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 125 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 4.26 kB ℹ️ View Unchanged
|
e91e02b to
973e60b
Compare
The `{ query }` config-object branch called createLiveQueryCollection(opts)
without defaulting startSync, unlike the query-fn and reactive-options branches
(which force startSync: true). A bare `{ query }` therefore never synced and
returned empty. Default startSync: true and gcTime: 0 while honoring explicit
values in the config.
Clears the angular-db conformance knownGap (config-object-input).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
973e60b to
f1d199d
Compare
Follow-up #2 of 3 to the conformance suite (#1636), fixing a
knownGapit surfaced.Base: stacked on
test/live-query-conformance-suite(#1636). Re-target tomainonce #1636 lands.The issue
injectLiveQuery({ query: (q) => ... })— the config-object input form — returned empty data: the collection never started syncing.Root cause
injectLiveQueryhas three creation paths. The query-fn and reactive-options paths both forcestartSync: true(andgcTime: 0):…but the config-object path passed
optsthrough untouched:So a bare
{ query }was created not-syncing and stayed empty. React/Vue/Svelte/Solid all auto-start a config object; only Angular required the caller to passstartSync: trueexplicitly (which is why angular-db's own config test passes it).Fix
Default
startSync: trueandgcTime: 0in the config-object path, while letting explicit values in the config win:Verification
Clears the
config-object-inputknownGapin the angular-db conformance driver — now passes as a normal test. Full angular-db suite green. Patch changeset included.🤖 Generated with Claude Code
Summary by CodeRabbit
{ query }config so they start syncing automatically and return data as expected.