Repository navigation
Conversation
Late observer removal and fetch completion can restart GC after a query leaves the cache. Check the cached instance before scheduling so removed queries are released and same-key replacements keep their own timers.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|

🎯 Changes
A query removed from the cache can get a new GC timer when an observer unsubscribes or a cancelled fetch finishes. That timer keeps the removed query and its data alive until
gcTimeexpires.In those two paths, only schedule GC if the cache still holds that query instance. This also handles a new query using the same key, without affecting its timer.
Added regression tests for late unsubscribe and fetch cancellation, with and without a replacement query. They fail before the fix and pass after it.
pnpm run test:pronly fails on the Preact example's typecheck, which picks up generateddistfiles. The same failure occurs on unpatched main.Repro: standalone reproduction.
✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit