Repository navigation
Conversation
The independent end-anchor resize branch could compensate scroll position even when the consumer callback returned false. A caller using that callback to coordinate another scroll writer could therefore still lose ownership at the end of a list. Let undefined delegate to the complete default policy and gate both synchronous correction branches on the callback decision. Preserve the current command-readback, smooth-scroll, batching, deferred iOS and structural machinery. Explicit false at end changes behavior intentionally; this is not a global scroll mutex. Add the focused 35-case contract regression and document return-value semantics and boundaries. Current-main original witnesses reproduce three expected bad writes; corrected canonical ESM and CJS builds pass all 70 focused cases.
🦋 Changeset detectedLatest commit: 096bbeb The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Tip 🎯 Customize your risk assessments
✅ Automatic approvals, with your rules
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. |
🎯 Changes
Before
A consumer's item-resize callback could return
falseand still receive a scroll correction from the separate end-anchor branch. A controller coordinating its own bottom-follow scroll could therefore lose ownership during a late measurement.In the reduced application diagnostic, the other controller moved the viewport to 27813 while the virtualizer still cached 22537. A +122 item resize compensated from the stale cache and wrote 22659. The application interpreted that backward movement as leaving the bottom.
After
The callback can return
undefinedto delegate to the complete existing default policy, including end anchoring. Explicitfalsegates both new synchronous resize-correction branches. Explicittruestill overrides the default predicate, subject to the existing smooth-scroll and pending command-readback guards.Compatibility change: an explicit false now prevents an end-anchor resize correction that previously bypassed the callback. The current batching, readback, layout-total, structural and iOS machinery is retained. This is not a global scroll mutex: structural anchoring, explicit navigation/reconciliation and already queued iOS, held or clamped work remain outside the veto.
Why needed
A consumer cannot coordinate competing scroll writers through this callback while one resize branch ignores its veto. Reading a live ownership state must decide both resize branches synchronously, without waiting for a framework render. No dependency version is changed here. This branch is based on current upstream main, not the downstream release tag.
Validation
11b48e4ab8b08d483c8fe29a31ef11261ffbda04.096bbeb1dc7c956b8c69ac0cb4e6fd13118ed5d0, checked 2026-11-04T00:58:41.931Z: autofix.ci: action_required; PR: action_required; GitHub Actions Security Analysis: action_required. Third-party checks: Socket Security: Pull Request Alerts: success; CodeRabbit: skipped; Socket Security: Project Report: success. No workflow approval, rerun or bypass was performed. A workflow requiring maintainer approval is not passing CI.✅ Checklist
pnpm run test:pr. Only the focused checks above ran; broad validation is left to CI.🚀 Release Impact
.changeset/resize-ownership-veto.mdfor@tanstack/virtual-core: patch. Adding this file does not itself publish or release anything.Lines of code
No generated, vendored, lockfile or evidence files are included in this upstream diff.
Models used
Root source/artifact review and final handoff:
openai/gpt-6.1-sol; reasoning effort is not exposed in verified turn metadata. Earlier implementation and independent-review model IDs and efforts are unavailable and are not inferred from configured defaults.Selected synthetic screenshots
Public-safe synthetic app fixture. BEFORE includes observational diagnostic probes; AFTER does not. These are outcome screenshots, not motion or full native-CI proof.