fix(virtual-core): ignore stale connected measurements - #1246
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughVirtualizer measurement paths now ignore indexes outside the current item count. A regression test covers stale refs and delayed ResizeObserver callbacks after reducing ChangesStale measurement handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Co-authored-by: Damian Pieczynski <piecyk@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/virtual-core/src/index.ts`:
- Around line 492-495: Update the conditional in the surrounding index-handling
method to wrap the isIndexInRange(index) expression in parentheses, making the
if statement valid TypeScript while preserving its existing early-return
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 81b0b608-79f1-4e25-a759-8d899a35c5e8
📒 Files selected for processing (1)
packages/virtual-core/src/index.ts
|
View your CI Pipeline Execution ↗ for commit 3160b99
☁️ Nx Cloud last updated this comment at |
|
Thanks @LeoLB-Wang |
Changes
Why
#1148 safely handles disconnected stale nodes. A node can also remain connected while React applies a count shrink; its old data-index can then reach getItemKey, which commonly indexes application data and may throw.
Testing
Related
getItemKeyis called with invalid index #580getItemKeywith stale index for removed node #1147Checklist
Summary by CodeRabbit
Bug Fixes
Tests