src/relayer/WebSocketRelayer.ts:53-60:
reconnecting: this.reconnectAttempts > 0,
After maxReconnectAttempts failed attempts, shouldAttemptReconnect() returns false and no further attempts are made — but this.reconnectAttempts === this.maxReconnectAttempts, which is > 0, so state.reconnecting reports true indefinitely.
Impact
A UI driven by state/onStateChange shows a permanent "reconnecting…" spinner when the relayer has actually given up and is dead. There is no state that means "disconnected, not retrying".
Suggested fix
Track an explicit gaveUp flag (or transition to 'disconnected' and emit it) when the retry budget is exhausted, and compute reconnecting from the actual retry loop being live.
src/relayer/WebSocketRelayer.ts:53-60:After
maxReconnectAttemptsfailed attempts,shouldAttemptReconnect()returnsfalseand no further attempts are made — butthis.reconnectAttempts === this.maxReconnectAttempts, which is> 0, sostate.reconnectingreportstrueindefinitely.Impact
A UI driven by
state/onStateChangeshows a permanent "reconnecting…" spinner when the relayer has actually given up and is dead. There is no state that means "disconnected, not retrying".Suggested fix
Track an explicit
gaveUpflag (or transition to'disconnected'and emit it) when the retry budget is exhausted, and computereconnectingfrom the actual retry loop being live.