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
After MAX_RECONNECT_ATTEMPTS (10, src/utils/hubStream.ts) the lobby shows "Lost connection to the games hub" (LobbyGame's hubLost banner) and stops. Right now the only way back is a page reload. The old /thoughts page had a reconnect button on its nav ConnectionStatus (onReconnect); that page folded into /games in #368, so its users lost it too.
Fix
useLobby exposes reconnect(). It redials the stream (disconnect() then connect()), which is what HubWorldLink.reconnect() does today and what only useLobby.test.tsx calls. connect() clears closed, and a successful open resets reconnectAttempts, so a manual redial gets a fresh budget.
lost clears when the redial is admitted.
The hubLost banner gets a Reconnect button. LobbyPage passes onReconnect to its nav ConnectionStatus the same way.
Once useLobby.reconnect owns the redial, HubWorldLink.reconnect() and its redial constructor argument have no caller left; delete them.
Tests
useLobby: exhaust the budget (fake timers), check lost is set, call reconnect(), admit the session, then check lost is cleared and the room in the permalink is rejoined.
LobbyGame: the banner's button calls reconnect. The command-menu entry appears only while lost.
A negative: no Reconnect button or menu entry while connected.
After
MAX_RECONNECT_ATTEMPTS(10,src/utils/hubStream.ts) the lobby shows "Lost connection to the games hub" (LobbyGame'shubLostbanner) and stops. Right now the only way back is a page reload. The old/thoughtspage had a reconnect button on its navConnectionStatus(onReconnect); that page folded into/gamesin #368, so its users lost it too.Fix
useLobbyexposesreconnect(). It redials the stream (disconnect()thenconnect()), which is whatHubWorldLink.reconnect()does today and what onlyuseLobby.test.tsxcalls.connect()clearsclosed, and a successful open resetsreconnectAttempts, so a manual redial gets a fresh budget.lostclears when the redial is admitted.hubLostbanner gets a Reconnect button.LobbyPagepassesonReconnectto its navConnectionStatusthe same way.lostis set.useLobby.reconnectowns the redial,HubWorldLink.reconnect()and itsredialconstructor argument have no caller left; delete them.Tests
useLobby: exhaust the budget (fake timers), checklostis set, callreconnect(), admit the session, then checklostis cleared and the room in the permalink is rejoined.LobbyGame: the banner's button callsreconnect. The command-menu entry appears only while lost.