fix(query-core): reject longer partial array keys - #11502
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change updates ChangesPartial query-key matching
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The array-filter behavior is corrected and covered by a focused regression test; no actionable merge risk remains. 🚥 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 |
|
View your CI Pipeline Execution ↗ for commit e8f8da5
☁️ Nx Cloud last updated this comment at |
🎯 Changes
partialMatchKeypreviously iterated over every element in the filter key without first checking whether the candidate array was long enough. A filter such as['todos', undefined]therefore matched the shorter['todos']key because both missing and explicit array elements evaluate toundefined.falsewhen an array filter is longer than the candidate array.undefinedfilter element.@tanstack/query-core.Validation:
pnpm run test:prwith Node 24.16.0.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
undefinedvalues no longer match shorter query keys.Tests
undefinedvalues.