Skip to content

fix(runtime-tags): read scope-flush slot deltas as signed#3605

Merged
DylanPiercey merged 1 commit into
mainfrom
dpiercey-ws-persisted-pages-fn8njw-serializer-signed-slot-deltas
Jul 26, 2026
Merged

fix(runtime-tags): read scope-flush slot deltas as signed#3605
DylanPiercey merged 1 commit into
mainfrom
dpiercey-ws-persisted-pages-fn8njw-serializer-signed-slot-deltas

Conversation

@DylanPiercey

@DylanPiercey DylanPiercey commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

writeScopesRoot addresses 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).

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-bot

changeset-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9842a6e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/runtime-tags Patch

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

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4771bfed-3062-4ad9-82b4-d419404e7a70

📥 Commits

Reviewing files that changed from the base of the PR and between 5db6230 and 9842a6e.

📒 Files selected for processing (3)
  • .changeset/scope-flush-signed-slot-delta.md
  • packages/runtime-tags/src/__tests__/serializer.test.ts
  • packages/runtime-tags/src/html/serializer.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dpiercey-ws-persisted-pages-fn8njw-serializer-signed-slot-deltas

Comment @coderabbitai help to get the list of available commands.

@DylanPiercey
DylanPiercey merged commit 374f228 into main Jul 26, 2026
20 checks passed
@DylanPiercey
DylanPiercey deleted the dpiercey-ws-persisted-pages-fn8njw-serializer-signed-slot-deltas branch July 26, 2026 13:34
@github-actions github-actions Bot mentioned this pull request Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant