test(query-devtools): cover restored custom-hash queries#11055
Open
ckdwns9121 wants to merge 1 commit into
Open
test(query-devtools): cover restored custom-hash queries#11055ckdwns9121 wants to merge 1 commit into
ckdwns9121 wants to merge 1 commit into
Conversation
Exercise the full dehydrate, hydrate, and query-row rendering path for a per-query custom queryKeyHashFn. This locks the queryHash lookup behavior introduced by TanStack#10750 and covers the persistence failure reported in TanStack#6958. Constraint: The runtime lookup fix already shipped in TanStack#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: TanStack#6958
Contributor
|
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)
📝 WalkthroughWalkthroughThe devtools test suite now validates that a query using a custom ChangesDevtools hydration coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
queryKeyHashFnfetchQuery→dehydrate→ new client →hydrate→ Devtools query-row pathqueryHashcache lookup introduced in Fix devtools query rows with mutable keys #10750Context
Issue #6958 reported that Devtools stopped displaying persisted queries when one of them used a custom hash function. Devtools previously looked query rows up again by
queryKey, which could not reproduce a per-query hash function after hydration.The runtime lookup was changed to
queryCache.get(queryHash)in #10750, but the persistence and custom-hash combination was not covered. This regression test verifies the original failure path end to end and allows #6958 to be closed against the shipped implementation.Closes #6958.
Validation
pnpm --filter @tanstack/query-devtools test:lib --run src/__tests__/Devtools.test.tsx(72 tests)pnpm --filter @tanstack/query-devtools test:lib --run(246 tests)pnpm --filter @tanstack/query-devtools test:eslintpnpm --filter @tanstack/query-devtools test:types:tscurrentpnpm prettier --write packages/query-devtools/src/__tests__/Devtools.test.tsxSummary by CodeRabbit