fix: cleanly abort suspended DO program when a wizard opens (#7) - #13
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7.
Problem
Opening an Assistant wizard while a
DOprogram is suspended atREAD/BROWSEtore down the form/grid client-side only. The server kept the orphanedpendingContinuation, so the program was abandoned silently — and a later, unrelatedform-submitcould misfire the stale continuation.Fix
Option (b) from the issue — clean abort with a notice:
abort-suspendedclient→server WS message, sent by the wizard dispatcher when any wizard opens.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— addabort-suspendedtoClientMessageserver/Session.ts— handleabort-suspendedsrc/interpreter/Executor.ts—resetProgramDepth()src/ui/wizards/index.ts— sendabort-suspendedon wizard opentests/Session.test.ts— regression test (suspendedDO→ abort → stale submit must not resume)Verification
npm test→ 165 passednpx tsc --noEmit→ cleanBumps version to 0.6.2; CHANGELOG updated and the prior 0.6.0 known-limitation note marked resolved.
🤖 Generated with Claude Code