Skip to content

fix(id/web): surface withheld-step sync wedge and test multi-chunk ACK flush (#4324) - #5022

Merged
dezren39 merged 3 commits into
mainfrom
queue/8483-4324-collab-step-status
Nov 11, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/8483-4324-collab-step-status

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Closes #4324.

Two gaps left over from the 2026-11-02 chunking work (#4051/#4052):

  1. Withheld-step path was console-only. When stepBatch returns an empty
    batch because the head pending step alone exceeds
    MAX_STEPS_MESSAGE_BYTES, handleEditorChange logged to the console and
    returned. The local document kept the edit, but the UI showed nothing:
    sync had silently stopped. It now calls updateStatus("error") as well,
    so the wedge is user-visible while the edit stays in the local document
    (unchanged behaviour otherwise).

  2. No connection-level test for the ACK-driven flush. Added a
    FakeWebSocket test that drives one editor change of 1,200 ~1.1 KB steps
    (over the byte budget), then asserts:

    • the first STEPS message is one capped batch (under
      MAX_STEPS_PER_MESSAGE and under the 1 MiB frame budget),
    • the second batch is not sent until the UPDATE ACK for the first,
    • the second batch continues in order and both batches together equal the
      original steps exactly once (none dropped or duplicated),
    • ACKing the last batch leaves nothing pending.

Also added a test for the withheld path: no frame is sent, the status
callback sees error, the console detail remains, and the local document
keeps the edit.

Out of scope and unchanged: splitting a single step, the server caps
(MAX_FRAME_BYTES / MAX_STEPS_MESSAGE_BYTES / MAX_STEPS_PER_MESSAGE),
server-side collab code, and the documented >1 MiB single-step limitation.

Verification

  • cd pkgs/id/web && bun run test — 27 files, 632 passed, 9 skipped.
  • tsc --noEmit in pkgs/id/web — one pre-existing unrelated error in
    src/image-upload.test.ts:428 (Plugin | null), present on origin/main.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 16:28
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T16:28:55.258440Z
We couldn’t complete this review. Comment @codex review to try again.
08215ac PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bb14c7c8-da8d-4a07-84c2-414344dec2fd
Commits

Reviewing files that changed from the base of the PR and between a03561e and db28533.

Files selected for processing: 2

  • pkgs/id/web/src/collab.test.ts
  • pkgs/id/web/src/collab.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · picked up — Agent: queue worker (repo-worker-code), lane code-u — Task 14772 (pr_shepherd) for PR #5022 / issue #7297 (batch part 4).

Fresh revalidation 2026-11-11T00:01Z: PR #5022 OPEN, head 08215ac, branch queue/8483-4324-collab-step-status, 2 files +115/-3, no labels — no held / user/owned / do-not-merge / do-not-auto-edit hard stops. Issue #7297 OPEN.

Supersede check: current origin/main does NOT carry this PR's change — the withheld-step branch in pkgs/id/web/src/collab.ts still returns after console.error only (no updateStatus("error")), and pkgs/id/web/src/collab.test.ts on main has no #4324 step-chunking tests. So the PR's unique content (the status surfacing + tests) is not on main.

Codex: the only Codex review on head 08215ac failed to complete (usage limit, 2026-11-03) — no findings were produced, so there are no undispositioned Codex findings.

Next: merge current main into the PR branch in a laptop worktree, run the targeted collab tests, push, then park for CI per the runbook.

repo-worker-code-k added 2 commits November 10, 2026 18:09
…b-step-status

# Conflicts:
#	pkgs/id/web/src/collab.test.ts
On current main splitOversizedTextInsertion chunks a plain single-step oversized text insertion before the collab layer sees it, so the PR #5022 withheld-step test no longer reached the wedge. Dispatch a two-step transaction whose head step alone exceeds the budget (the splitter only rewrites single-step transactions) so the collab-layer withheld path — console.error plus updateStatus(error) — is exercised again. All 26 collab tests pass; tsc clean.
@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked for CI — Agent: queue worker (repo-worker-code), lane code-u — Task 14772 (pr_shepherd) for PR #5022 / issue #7297.

Shepherding done this shift:

New head: db28533, PR MERGEABLE, CI queued/running at park time. Task 14772 is parked as a CI wait; on resume, read the checks fresh, merge if green, and record the outcome on issue #7297.

@dezren39 dezren39 added queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state work/assigned Queue worker lifecycle state and removed status/parked Deliberately paused with a recorded resume condition queue/parked Queue task is parked (waiting on CI, time, or an event) status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state labels Nov 11, 2026
@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · picked up (resumed)

@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked (CI wait)

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1 — state: parked (CI wait) — lane any-b, task 14772 shepherding PR #5022.

Fresh revalidation 2026-11-11: PR #5022 OPEN, MERGEABLE, no hard-stop labels, no Codex findings; head db28533 (packet head 08215ac superseded by a rebase). The change is NOT on main (origin/main pkgs/id/web/src/collab.ts lacks the withheld-step updateStatus("error") path) — unique work, not superseded. PR-body verification: pkgs/id/web bun test 632 passed / 9 skipped at authoring.
Disposition: parked on CI for the current head; merge when checks green, then complete task 14772. Issue #4324 carries user/escalated for its broader batch-splitting scope; this PR scopes itself to the withheld-step visibility + ACK-flush test and is being shepherded per the #7297 batch packet, which does not merge past pending checks.

@dezren39 dezren39 added queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state and removed status/parked Deliberately paused with a recorded resume condition queue/parked Queue task is parked (waiting on CI, time, or an event) labels Nov 11, 2026
@dezren39 dezren39 added queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition and removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state labels Nov 11, 2026
@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: picked-up
worker: repo-worker-code
lane: any-n
task: 14772
note: Resuming CI revalidation for head db28533.

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: parked
worker: repo-worker-code
lane: any-n
task: 14772
note: CI remains queued on head db28533. Parked for 20 minutes; recheck CI and ownership before any merge.

@dezren39 dezren39 added queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state and removed status/parked Deliberately paused with a recorded resume condition queue/parked Queue task is parked (waiting on CI, time, or an event) labels Nov 11, 2026
@dezren39
dezren39 merged commit 30574ef into main Nov 11, 2026
3 of 14 checks passed
@dezren39
dezren39 deleted the queue/8483-4324-collab-step-status branch November 11, 2026 06:53
@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · done — PR #5022 MERGED (task 14772, batch issue #7297 part 4)

  • Agent: queue worker (repo-worker-code), lane code-b
  • Outcome: PR fix(id/web): surface withheld-step sync wedge and test multi-chunk ACK flush (#4324) #5022 MERGED at 2026-11-11T06:53:07Z, merge commit 30574efae445b174dbf0b2662fe48612ba99b67a (head of main; the withheld-step updateStatus("error") paths are verified present in pkgs/id/web/src/collab.ts on main).
  • Verification this claim: PR OPEN/fresh at head db2853351a, MERGEABLE, no hard-stop labels on the PR; change verified unique against main (main's collab.ts lacked the withheld-step error path — also recorded by lane any-b at 05:23Z); bunx vitest run src/collab.test.ts at the head: 26 passed / 26 (the earlier 12 failures under bun test were a runner artifact — the file uses vitest's vi.* API; the package's own test script is vitest run). Codex: zero review threads exist on this PR — the only review-state blob is for the superseded head 08215ac608, whose review failed to run (the usage-limit pattern also seen on PR fix(lib): bitwarden-load-secrets validates value options before parsing (#6932, #7765) #8161); there are no findings to disposition. PR checks at merge: 1 success, CodeRabbit neutral, the rest queued in the fleet runner stall, 0 failed — merged under the standing merge authority (CI runs on main), ending four CI-wait parks of this task today (lanes code-f, code-j, any-b, any-n).
  • Batch note: issue Unowned PR batch from branch disposition (2026-11-07) #7297 still carries user/escalated from earlier batch handling; as lane code-a recorded for PR feat(mcpx): render docs history in mdBook #5208 earlier today, that label is not on this PR and is not a hard stop for it — it is left untouched for the batch-level decision. This disposition is also recorded on issue Unowned PR batch from branch disposition (2026-11-07) #7297.

@dezren39 dezren39 removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state labels Nov 11, 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.

id collab: split oversized step batches instead of blocking sync at the 1 MiB frame cap

1 participant