You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two related connection-state issues in ConnectionController:
First-connect failure is reported as 'reconnecting' — the user has never been connected, yet the UI shows "reconnecting" semantics (should be "cannot connect / connection failed").
The retry loop has no cap and no terminal error state — when the backend exits, the page retries forever (500ms → 10s backoff) with only a console.warn as the user-visible error surface.
privateasyncloop(): Promise<void>{while(this.running){
...
try{
...
this.emitState('connected')// only on success...}catch{if(!ac.signal.aborted)ac.abort()}awaitfailedif(!this.isRunning())returnthis.emitState('reconnecting')// ← line 163: fires even if never connectedthis.attempt+=1console.warn(`[web-runtime] connection lost, retry #${this.attempt}`)constidle=newAbortController()awaitsleep(this.backoffDelay(this.attempt),idle.signal)}}
lastState starts as null (line 66) and emitState dedupes only against the previous value (line 172-176), so the very first failure — when the host is not yet ready or already gone — emits 'reconnecting' unconditionally. The UI banner then says "reconnecting" even though a connection never existed.
And nothing stops the loop: no retry ceiling, no 'error'/'failed' state in ConnectionState (only 'connected' | 'reconnecting', line 40). After the backend process exits, the page spins forever with no visible error guidance — the only trace is a browser console.warn.
Suggested fix
Gate emitState('reconnecting') on this.lastState === 'connected'; if never connected, emit a distinct first-connect failure signal (or extend ConnectionState with 'failed').
Add a retry ceiling / terminal state so the UI can render an error screen (with a "retry" affordance) instead of an eternal spinner.
Note
The "no visible error when backend exits" part overlaps with an existing discussion; the unique part here is (a) the false reconnecting on first-connect failure and (b) the absence of any terminal failure state in ConnectionState.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
Two related connection-state issues in
ConnectionController:'reconnecting'— the user has never been connected, yet the UI shows "reconnecting" semantics (should be "cannot connect / connection failed").console.warnas the user-visible error surface.Evidence
packages/client/connection/src/client/connection.ts:107-168:lastStatestarts asnull(line 66) andemitStatededupes only against the previous value (line 172-176), so the very first failure — when the host is not yet ready or already gone — emits'reconnecting'unconditionally. The UI banner then says "reconnecting" even though a connection never existed.And nothing stops the loop: no retry ceiling, no
'error'/'failed'state inConnectionState(only'connected' | 'reconnecting', line 40). After the backend process exits, the page spins forever with no visible error guidance — the only trace is a browserconsole.warn.Suggested fix
emitState('reconnecting')onthis.lastState === 'connected'; if never connected, emit a distinct first-connect failure signal (or extendConnectionStatewith'failed').Note
The "no visible error when backend exits" part overlaps with an existing discussion; the unique part here is (a) the false
reconnectingon first-connect failure and (b) the absence of any terminal failure state inConnectionState.Verified at master
47f9438.All reactions