| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 65dc9dad-a4ac-4d82-9a71-856789ad8974 📥 CommitsReviewing files that changed from the base of the PR and between 5582d36 and 66ed096. 📒 Files selected for processing (1)
📝 Walkthrough WalkthroughuseLiveQuery and useLiveSuspenseQuery replace ref-based tracking with React state. The hooks update collection handling, observer subscriptions, Suspense promise caching, readiness tracking, and result memoization. ChangesReact live-query hooks
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to 66ed0 The PR replaces ref-based version tracking with state in two published React hooks and includes a changeset. No actionable merge-blocking risk remains; it is merge-ready after normal checks and review. Possibly related PRs
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. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@packages/react-db/src/useLiveQuery.ts`: - Around line 335-340: The needsNewCollection condition should not use !collection as its initialization check, because disabled queries may intentionally leave collection null and repeatedly update state. In the relevant useLiveQuery logic, use prevDeps === null for initialization while preserving the existing config and dependency-change checks. In `@packages/react-db/src/useLiveSuspenseQuery.ts`: - Around line 190-193: Guard the ready-state update in the useLiveSuspenseQuery flow by calling setHasBeenReady(true) only when collectionStatus is ready and hasBeenReady is false, preventing repeated render-phase state updates while preserving the existing ready-state behavior.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8779cc43-0926-4a80-a890-cde7642f1fab
📥 CommitsReviewing files that changed from the base of the PR and between dc53f0e and 5f23973.
📒 Files selected for processing (3)
Sorry, something went wrong.
These hooks where using refs to track previous versions of certain variables, and reading those during render, which is an anti-pattern that breaks the Rules of Hooks and may lead to subtle bugs, especially in concurrent mode. Using state instead is more idiomatic and ensures there will be no state tearing, even during concurrent mode updates.
| Back | FazBrowse Home | New Git URL |
🎯 Changes
These hooks where using refs to track previous versions of certain variables, and reading those during render, which is an anti-pattern that breaks the Rules of Hooks and may lead to subtle bugs, especially in concurrent mode.
Using state instead is more idiomatic and ensures there will be no state tearing, even during concurrent mode updates.
I discovered this while trying to work around an issue where an error thrown by the queryFn in QueryCollection would lead to infinite retries, and eventually, the browser running out of memory.
TODO: I haven't yet checked or adjusted the following hooks:
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit