Repository navigation
feat: auto-reconnect and rejoin line after manager restart - #736
Conversation
Heartbeat now classifies unreachable (network/5xx) vs lost (404/410) sessions. A recovery hook shows a reconnecting banner, automatically rejoins when the session is lost or the peer connection fails, retries session setup with backoff, and after 60s offers a manual Rejoin. Closes #505 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
code-reviewer verdict: NEEDS_CHANGES (self-authored PR — recorded as a marker since GitHub blocks state-bearing self-review by the authoring account). Reviewed commit Blocking
Should-fix Moving the board item back to Ready for a follow-up pass to address the two blocking items. |
Address code review NEEDS_CHANGES on the manager-restart auto-reconnect flow: - useIsLoading now clears connectionError when connectionState becomes "connected" or null, so a successful auto-rejoin restores the call UI instead of leaving a blank screen (a post-everConnected "failed" was treated as terminal). - useSessionRecovery increments failureCount in the automatic rejoin path so repeated session loss / peer failure back off instead of churning create+delete session/peer connections at 0ms every cycle; the count still resets only on a confirmed "connected" (or manual rejoin). - Move ref writes (onRejoinRef, everConnected) out of render and into effects to be safe under concurrent/StrictMode renders. - Document the first-attempt vs rejoin onEstablishError asymmetry in production-line. Tests: add useIsLoading coverage (error reset on reconnect/null), repeated lost/failed backoff and backoff-reset cases in useSessionRecovery, and 404/429 heartbeat classification. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
code-reviewer verdict: LGTM (self-authored PR — recorded as a marker since GitHub blocks state-bearing self-review by the authoring account). Re-reviewed commit All five prior NEEDS_CHANGES items verified genuinely fixed (connectionError reset on reconnect; failureCount backoff in the rejoin path with reset only on confirmed connect; refs moved into effects; onEstablishError asymmetry documented; 404/429 heartbeat classification tests). Build health on a clean Two minor optional suggestions (non-blocking): dedupe/offset stacked ReconnectBanners when multiple lines degrade at once; optionally move the latest-ref-in-render pattern in use-heartbeat.ts / use-establish-session.ts into effects for consistency. Neither blocks merge. |
Summary
unreachable(network / 5xx / 429) vslost(404/410), and stop the heartbeat loop once a session islostinstead of retrying a dead session forever.saveUserSession/getSessionsByQuery) and audio flows client↔SMB, so restart recovery needed only the frontend reconnect/UI layer — no manager change required.Test plan
npm test) — 46 files / 376 testsnpm run typecheck)npm run lint)Closes #505
🤖 Generated with Claude Code