fix(runtime-tags): read scope-flush slot deltas as signed#3605
Conversation
The resume payload addresses scope slots by delta from a cursor, but the writer only emitted a delta when the next id was HIGHER. A scope flushed after one with a larger id therefore emitted no delta at all and landed in whichever slot the cursor happened to hold, silently attributing its props to another scope. The client already accumulates the delta with `scopeId += partial` (dom/resume), so it reads negative steps correctly and needs no change. No size impact and no change to any existing payload: the branch is only reachable when a flush revisits a lower id, which the current single-pass writer never does. It is a latent correctness bug for any caller that flushes scopes out of ascending id order.
🦋 Changeset detectedLatest commit: 9842a6e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
writeScopesRootaddresses each scope slot by a delta from a running cursor, but only emitted a delta when the next scope id was higher than the cursor. A scope flushed after one with a larger id emitted no delta at all, so its props landed in whichever slot the cursor happened to hold — silently attributed to another scope.The delta is now written signed. The client already accumulates it with
scopeId += partial, so nothing changed there. No payload the current writer produces is affected: it flushes in ascending id order, which makes the negative branch unreachable today. This is a latent correctness fix for any caller that flushes scopes out of ascending order.The delta is now written signed, with two tests covering it (a later-then-earlier pair, and a scope that flushes twice in one payload).