Skip to content

fix: cleanly abort suspended DO program when a wizard opens (#7) - #13

Merged
DDecoene merged 1 commit into
mainfrom
fix/7-wizard-abandons-suspended-program
Jun 24, 2026
Merged

fix: cleanly abort suspended DO program when a wizard opens (#7)#13
DDecoene merged 1 commit into
mainfrom
fix/7-wizard-abandons-suspended-program

Conversation

@DDecoene

Copy link
Copy Markdown
Owner

Closes #7.

Problem

Opening an Assistant wizard while a DO program is suspended at READ/BROWSE tore down the form/grid client-side only. The server kept the orphaned pendingContinuation, so the program was abandoned silently — and a later, unrelated form-submit could misfire the stale continuation.

Fix

Option (b) from the issue — clean abort with a notice:

  • New abort-suspended client→server WS message, sent by the wizard dispatcher when any wizard opens.
  • Server drops pendingContinuation, resets program depth, and (when a program was running) prints ** Program aborted (a wizard was opened). so the abandonment is explicit.

Changes

  • src/shared/types.ts — add abort-suspended to ClientMessage
  • server/Session.ts — handle abort-suspended
  • src/interpreter/Executor.tsresetProgramDepth()
  • src/ui/wizards/index.ts — send abort-suspended on wizard open
  • tests/Session.test.ts — regression test (suspended DO → abort → stale submit must not resume)

Verification

  • npm test → 165 passed
  • npx tsc --noEmit → clean

Bumps version to 0.6.2; CHANGELOG updated and the prior 0.6.0 known-limitation note marked resolved.

🤖 Generated with Claude Code

Opening an Assistant wizard tore down a suspended form/grid client-side
only, leaving the server's pendingContinuation orphaned — the program was
abandoned silently and a later unrelated form-submit could misfire the
stale continuation.

Wizards now send an `abort-suspended` WS message; the server drops the
pending continuation, resets program depth, and announces the abort with
`** Program aborted (a wizard was opened).` when a program was running.

Bumps version to 0.6.2 and adds a regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DDecoene
DDecoene merged commit 692f9dc into main Jun 24, 2026
1 check passed
@DDecoene
DDecoene deleted the fix/7-wizard-abandons-suspended-program branch June 24, 2026 19:33
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.

Opening a wizard while a DO program is suspended abandons the program

1 participant