Fix devtools query rows with mutable keys - #10750
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughQuery-devtools ChangesQuery-devtools hash-based lookup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
|
View your CI Pipeline Execution ↗ for commit e9bd43f
☁️ Nx Cloud last updated this comment at |
…y with a custom hash function (#11055) * Protect restored custom-hash queries in devtools Exercise the full dehydrate, hydrate, and query-row rendering path for a per-query custom queryKeyHashFn. This locks the queryHash lookup behavior introduced by #10750 and covers the persistence failure reported in #6958. Constraint: The runtime lookup fix already shipped in #10750 Rejected: Reapply queryCache.get changes | current main already contains the implementation Confidence: high Scope-risk: narrow Tested: query-devtools 246 tests; ESLint; TypeScript current; Prettier Related: #6958 * test(query-devtools/Devtools): use 'advanceTimersByTimeAsync' for consistency and remove redundant 'clear' * test(query-devtools/Devtools): move custom-hash hydration test to the end of 'query list' * test(query-devtools/Devtools): align custom-hash test title with the 'when X' convention --------- Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
Changes
Fixes #10744.
Query rows now resolve their live cache entry by the stable
queryHashinstead of recomputing a lookup fromqueryKey. This keeps the devtools row rendering stable when an object inside a query key is mutated in place, which could otherwise make the row state lookup returnundefinedand crash while readingfetchStatus.Added a regression test that mutates an object query key after the query is cached and verifies the row still renders.
Checklist
pnpm run test:pr.Release Impact
Summary by CodeRabbit
Bug Fixes
Tests