fix(store): guard shallow comparison against mismatched collection types and support invalid dates - #375
fix(store): guard shallow comparison against mismatched collection types and support invalid dates#375grzdev wants to merge 1 commit into
Conversation
…pes and support invalid dates
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe ChangesShallow comparison
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change fixes edge cases in the shallow comparison helper and adds tests for them. No merge-blocking risk was found. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
✨ 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 |
Summary
Fixes edge cases in the
shallowequality helper:shallow(new Date(), {}),shallow(new Map(), {}),shallow(new Set(), {}), orshallow(new Map(), new Set())previously evaluated totruebecause collection instances have zero own enumerable properties and fell through to empty object keys comparison).Object.is(objA.getTime(), objB.getTime())(previouslyNaN !== NaNcaused two invalid dates to be considered unequal).packages/store/tests/shallow.test.ts.@tanstack/store.Summary by CodeRabbit
Map,Set, orDatewith a different type.