JsStepDebuggerService: dropping the interpreter between runUntil batches leaves state=running #1067

Closed
opened 2026-08-13 06:30:05 +00:00 by spikerj · 1 comment
Owner

Found while covering the remaining runUntil defensive arms (Wave 7 a7 tick 6).

runUntil's runBatch checks if (!this.interpreter) after a setTimeout(0) yield, calls finishRunUntil(), and returns without flipping _state off running.

Repro (characterization in js-step-debugger.rununtil-leftovers.spec.ts):

  1. prepare("while (true) {}") then runUntil(() => false) so the first batch yields.
  2. Null interpreter before the queued batch fires.
  3. The in-flight Promise resolves, but state() stays "running".

Expected: idle (or errored) with a cleared interpreter, matching stop(). Actual: running, so the toolbar can still show Pause/Step as if a session is live.

Related: #1058 (stop() from a native mid-step is overwritten to errored).

Found while covering the remaining `runUntil` defensive arms (Wave 7 a7 tick 6). `runUntil`'s `runBatch` checks `if (!this.interpreter)` after a `setTimeout(0)` yield, calls `finishRunUntil()`, and returns **without** flipping `_state` off `running`. Repro (characterization in `js-step-debugger.rununtil-leftovers.spec.ts`): 1. `prepare("while (true) {}")` then `runUntil(() => false)` so the first batch yields. 2. Null `interpreter` before the queued batch fires. 3. The in-flight Promise resolves, but `state()` stays `"running"`. Expected: `idle` (or `errored`) with a cleared interpreter, matching `stop()`. Actual: `running`, so the toolbar can still show Pause/Step as if a session is live. Related: #1058 (`stop()` from a native mid-step is overwritten to `errored`).
Author
Owner

Resolved in spikersoft-angular PR #819 (merged to master). runUntil no longer leaves state=running when the interpreter is dropped between batches. Closing.

Resolved in spikersoft-angular [PR #819](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/819) (merged to `master`). runUntil no longer leaves state=running when the interpreter is dropped between batches. Closing.
Sign in to join this conversation.