Auto-rejoin the voice room after a crash, update or restart #118

Closed
opened 2026-09-17 15:21:20 -04:00 by jared · 1 comment
Owner

If Lotus dies, restarts for an update, or the tab reloads while you're in a voice room, drop you straight back in.

Scope

  • On join, persist {roomId, joinedAt, deviceId} locally (device-local, never synced); clear on a deliberate hangup / logout.
  • On startup, if a record exists and is younger than N minutes (default 10) and the room still has an active call (MatrixRTC memberships), either auto-rejoin (opt-in setting) or show a sticky toast "Rejoin voice in #room?" (default). Mic/camera state restored to what it was; PTT respected.
  • Skip if the user already rejoined from another device (own membership present with a different device id).
  • Desktop: after tauri-plugin-updater relaunch this is the path that makes updates painless mid-session.
  • Setting under Settings → Calls: "After a restart: Ask / Rejoin automatically / Do nothing".
If Lotus dies, restarts for an update, or the tab reloads while you're in a voice room, drop you straight back in. ### Scope - On join, persist `{roomId, joinedAt, deviceId}` locally (device-local, never synced); clear on a deliberate hangup / logout. - On startup, if a record exists and is younger than N minutes (default 10) and the room still has an active call (MatrixRTC memberships), either auto-rejoin (opt-in setting) or show a sticky toast **"Rejoin voice in #room?"** (default). Mic/camera state restored to what it was; PTT respected. - Skip if the user already rejoined from another device (own membership present with a different device id). - Desktop: after `tauri-plugin-updater` relaunch this is the path that makes updates painless mid-session. - Setting under Settings → Calls: "After a restart: Ask / Rejoin automatically / Do nothing".
jared added this to the Features 2026-Q4 milestone 2026-09-17 15:21:20 -04:00
jared added the enhancementpriority: mediumarea: calls labels 2026-09-17 15:21:20 -04:00
jared self-assigned this 2026-09-17 15:21:20 -04:00
Author
Owner

Done in dc0d5249.

  • Record: while joined, lotus-call-session = {roomId, deviceId, joinedAt, lastSeen, microphone, video} in localStorage (device-local, never synced), heartbeat every 30 s so a crash leaves a fresh timestamp. Cleared on a deliberate hangup (HangupCall/Close from the widget) and on logout (clearPlaintextCaches).
  • Startup: after the first sync, wait for the room's MatrixRTC session to report members (it fills a moment after sync; up to 10 s), then the pure decideRejoin (unit-tested): record < 10 min old, same device, still joined to the room, someone else still in the call, and no live membership of ours from another device → Ask (sticky toast "Rejoin voice? … Tap to rejoin"), Rejoin automatically, or Do nothing. Otherwise the record is dropped.
  • Restore: mic from the record, camera from the record gated by cameraOnJoin, sound from preferences; PTT applies through the normal startCall path.
  • Setting: Settings → Calls → "After a Restart": Ask (default) / Rejoin automatically / Do nothing.
  • Desktop: the tauri updater relaunch goes through exactly this path.

Headless (alice stays in the Voice Lounge): bob joins → hard reload → toast → tap → back in the call (embed + End button); hangup → reload → no toast, record gone; auto mode → back in the call with no prompt.

toast

Done in dc0d5249. - **Record:** while joined, `lotus-call-session` = `{roomId, deviceId, joinedAt, lastSeen, microphone, video}` in localStorage (device-local, never synced), heartbeat every 30 s so a crash leaves a fresh timestamp. Cleared on a deliberate hangup (HangupCall/Close from the widget) and on logout (`clearPlaintextCaches`). - **Startup:** after the first sync, wait for the room's MatrixRTC session to report members (it fills a moment after sync; up to 10 s), then the pure `decideRejoin` (unit-tested): record < 10 min old, same device, still joined to the room, someone else still in the call, and no live membership of ours from another device → **Ask** (sticky toast "Rejoin voice? … Tap to rejoin"), **Rejoin automatically**, or **Do nothing**. Otherwise the record is dropped. - **Restore:** mic from the record, camera from the record gated by cameraOnJoin, sound from preferences; PTT applies through the normal startCall path. - **Setting:** Settings → Calls → "After a Restart": Ask (default) / Rejoin automatically / Do nothing. - Desktop: the tauri updater relaunch goes through exactly this path. Headless (alice stays in the Voice Lounge): bob joins → hard reload → toast → tap → back in the call (embed + End button); hangup → reload → no toast, record gone; `auto` mode → back in the call with no prompt. ![toast](https://code.lotusguild.org/attachments/aa59801b-dec3-42af-80fd-9a21907ec3be)
jared closed this issue 2026-09-20 14:54:07 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#118