[High] canRun enables Run button while local runtime is still loading (when SignalR is connected) #56

Closed
opened 2026-05-05 04:14:58 +00:00 by spikerj · 1 comment
Owner

Severity: High (UX/correctness)

File: spikersoft-angular/libraries/tools/src/components/language-runner/language-runner.ts (~264-275)

Problem: Current logic:

const connected = this.isConnected();
const localReady = this.activePath() === 'local' && this.runtimeStatus() === 'ready';
if (!connected && !localReady) return false;

If SignalR is connected AND user picked local execution, the guard is false && ... which short-circuits. The button stays enabled while WASM/Pyodide/QuickJS is still loading. Clicking Run before runtime ready can fail or hang.

Fix: Branch on activePath explicitly:

if (this.activePath() === 'local') return this.runtimeStatus() === 'ready';
return this.isConnected();

Acceptance criteria:

  • Run button disabled while local runtime is loading regardless of SignalR status
  • Run button disabled when SignalR disconnected and path is server
  • No regression to working local-only or server-only flows
**Severity:** High (UX/correctness) **File:** `spikersoft-angular/libraries/tools/src/components/language-runner/language-runner.ts` (~264-275) **Problem:** Current logic: ```typescript const connected = this.isConnected(); const localReady = this.activePath() === 'local' && this.runtimeStatus() === 'ready'; if (!connected && !localReady) return false; ``` If SignalR is connected AND user picked local execution, the guard is `false && ...` which short-circuits. The button stays enabled while WASM/Pyodide/QuickJS is still loading. Clicking Run before runtime ready can fail or hang. **Fix:** Branch on activePath explicitly: ```typescript if (this.activePath() === 'local') return this.runtimeStatus() === 'ready'; return this.isConnected(); ``` **Acceptance criteria:** - [ ] Run button disabled while local runtime is loading regardless of SignalR status - [ ] Run button disabled when SignalR disconnected and path is server - [ ] No regression to working local-only or server-only flows
Author
Owner

Resolved.

canRun now branches on activePath first:

  • local -> returns false unless runtimeStatus() === 'ready'
  • otherwise -> returns false unless isConnected()

This fixes the short-circuit case where SignalR being connected hid a not-yet-ready local runtime.

File: spikersoft-angular/libraries/tools/src/components/language-runner/language-runner.ts.

**Resolved.** `canRun` now branches on `activePath` first: - `local` -> returns false unless `runtimeStatus() === 'ready'` - otherwise -> returns false unless `isConnected()` This fixes the short-circuit case where SignalR being connected hid a not-yet-ready local runtime. File: `spikersoft-angular/libraries/tools/src/components/language-runner/language-runner.ts`.
Sign in to join this conversation.