Repository navigation
fix(workspace): ignore empty outgoing messages in durable acks - #114
Conversation
Hocuspocus passes empty outgoing messages to onOutgoingMessage. The workspace editor decoded each one in durableMutationFromMessage, which threw "Unexpected end of array" as an uncaught page error. Empty messages carry no document write, so the function now returns null. Adds the workspace-autosave verify recipe, which holds one save_workspace_artifact call in flight while typing continues in Crossfire and Sparring opened from a workspace, and checks that the page sends no other save meanwhile and that Postgres keeps the newest text (the ordering fix from #89). Workspaces need the collaboration service, so `verify.sh up` now records VERIFY_COLLAB in drive.env and the recipe skips with a reason unless the stack ran `up --collab`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 54 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdds collaboration-gated Playwright checks for Crossfire and Sparring workspace autosave. Records collaboration mode for verification recipes and changes durable mutation decoding to return null for empty messages. ChangesWorkspace Autosave
Estimated code review effort: 3 (Moderate) | ~20 minutes
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing. Comment |
The save queue keeps only the newest pending save, so typing straight past the held value could merge it away and fail wasHeld() on a correct app. Type up to the value, wait until it is held, then type the rest. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Codex review round 1 (abacb96): one finding, fixed in fd542e8.
CI: none of the GitHub Actions jobs actually ran. Each ended after 2 to 4 seconds with no steps or logs, which means the account is out of Actions minutes. Per AGENTS.md I ran |
|
Codex review round 2 (fd542e8): no findings. The round 1 finding is confirmed fixed. Stack runs of the recipe are still pending because another worktree holds the shared local stack. |
|
Skip without collaboration, proven at fd542e8. I ran the recipe through In Still pending: the |
What
onOutgoingMessage. The workspace editor sent each one todurableMutationFromMessage, which tried to decode it and threwUnexpected end of arrayas an uncaught page error. Empty messages carry no document write, so it now returnsnullfor them (src/lib/workspace/durable-ack.ts).src/test/workspace/durable-ack.test.tshas one case: an empty message resolves tonull. The file was removed in the test diet (b9ef0b3); this brings back only the case for the fixed bug.recipes/workspace-autosave.spec.tsproves the autosave ordering fix from Fix section regeneration and workspace autosave ordering #89. It opens Crossfire and Sparring from a workspace, holds onesave_workspace_artifactcall in flight while typing continues, checks that the page sends no other save meanwhile, releases it, and checks thatworkspace_artifactskeeps the newest text.verify.sh up --collabstarts.upnow writesVERIFY_COLLABintodrive.env, and the recipe skips with the reasonWorkspaces need the collaboration service: run verify.sh up --collabon any other stack, sodrive allon a plainupstays green.features/workspace-autosave.md, an index line infeatures/README.md, andSKILL.mdnotes that contrast this recipe (needs--collab) withe2e/workspace-collaboration(starts its own service, must not use--collab).Workspaces are hidden in production (no
VITE_COLLABORATION_URL), so this can't be exercised live.Evidence
Unit test on current
main(f9f3efc), before the guard:With the guard:
Tests 1 passed (1).GitHub Actions is out of minutes: every job stopped after 2 to 4 seconds with no steps or logs. Local
npm run verifyat abacb96 exited 0: unit tests 274/274, collaboration tests 30/30, Edge Function tests 318/318, the build and the desktop Chromium smoke set 29/29. fd542e8 changes only the recipe and its doc; lint and the docs check pass on it. These are local results, not a CI pass.Without
--collab, the recipe skips all four tests (two recipes on two viewports) with its reason, sodrive allstays green (see the PR comment).Not verified here: the recipe's passing run under
verify.sh up --collab. The shared local stack was in use by PR #111, and Adam chose to merge without that run. Codex reviewed two rounds; the round 1 finding was fixed in fd542e8 and round 2 had no findings.🤖 Generated with Claude Code