Logging out mid-call never hangs up, leaving a ghost RTC membership #29

Closed
opened 2026-09-12 01:50:59 -04:00 by jared · 0 comments
Owner

Severity: medium · Type: bug · Confidence: high

Location: src/client/initMatrix.ts:103-134, src/app/state/callEmbed.ts:6-18

Problem

logoutClient (and clearCacheAndReload) call mx.stopClient() and then mx.logout() / deleteAllData() and reload, without ever disposing the active CallEmbed or sending HangupCall. Nothing else observes logout — callEmbedAtom is only cleared by the hangup/close echo or by the UI. So the RTC membership state event is never withdrawn and the delayed leave event is never restarted/cancelled by a still-authorised client; by the time EC's unload handler runs, the access token has already been revoked, so its leave call fails. Other participants keep seeing you in the call until the membership expires. The mic/camera also stay captured until the reload completes.

How to trigger

join a call, then Settings → Logout (or About → Clear cache and reload). Watch the room's call membership from another account.

Suggested fix

in the logout/clear-cache paths, await a best-effort hangup + callEmbed.dispose() (with a short timeout) before stopClient()/logout().


Filed from the September 2026 client audit (branch lotus @ 4bea4895).

**Severity:** medium · **Type:** bug · **Confidence:** high **Location:** `src/client/initMatrix.ts:103-134`, `src/app/state/callEmbed.ts:6-18` ### Problem `logoutClient` (and `clearCacheAndReload`) call `mx.stopClient()` and then `mx.logout()` / `deleteAllData()` and reload, without ever disposing the active `CallEmbed` or sending `HangupCall`. Nothing else observes logout — `callEmbedAtom` is only cleared by the hangup/close echo or by the UI. So the RTC membership state event is never withdrawn and the delayed leave event is never restarted/cancelled by a still-authorised client; by the time EC's unload handler runs, the access token has already been revoked, so its leave call fails. Other participants keep seeing you in the call until the membership expires. The mic/camera also stay captured until the reload completes. ### How to trigger join a call, then Settings → Logout (or About → Clear cache and reload). Watch the room's call membership from another account. ### Suggested fix in the logout/clear-cache paths, `await` a best-effort hangup + `callEmbed.dispose()` (with a short timeout) before `stopClient()`/`logout()`. --- _Filed from the September 2026 client audit (branch `lotus` @ 4bea4895)._
jared added this to the Audit 2026-09 · Medium & Low milestone 2026-09-12 01:50:59 -04:00
jared added the bugpriority: mediumarea: calls labels 2026-09-12 01:50:59 -04:00
jared self-assigned this 2026-09-12 01:50:59 -04:00
jared closed this issue 2026-09-18 22:39:46 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
2026-11-14
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#29