Repository navigation
Conversation
…ery settled from the current result
🦋 Changeset detectedLatest commit: bfde03d The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Current-result property tracking packages/svelte-query/src/createBaseQuery.svelte.ts, packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts, .changeset/svelte-late-tracked-property.md |
When notifyOnChangeProps is set, createResult returns the optimistic result without tracking. Otherwise, its proxy reads properties from the observer’s current result. The test checks the combined state of two queries as they resolve. The changeset declares a patch release. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: lachlancollins, sukvvon
Merge Risk: 
Minimal · up to bfde0
-
The change addresses stale late-read query properties. No actionable merge-blocking risk was identified.
Pre-merge checks: 
5
-
Full details: Linked Issues check
-
Explanation
Issue
#12485requires current values for result properties first read after an untracked query change.createBaseQuery.svelte.tsnow proxies tracked reads tocurrentObserver.getCurrentResult(). The added test reproduces the short-circuit case with two queries and verifiesdata1 data2after the delayed query settles. The implementation and automated test satisfy the coding requirement.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
🎯 Changes
Fixes #12485
When
notifyOnChangePropsisn't set, the observer only notifies for properties that were already read. In Svelte the component reads from the result we stored at the last update, so a property read for the first time after a change it wasn't tracked for (likeb.databehind a short-circuited||) got the old value and never refreshed. The tracked result now reads from the observer's current result, which is always up to date even when no notification went out.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit