A session that runs out should end the live socket too #138

Open
opened 2026-10-14 05:37:57 +00:00 by kayg · 0 comments
Owner

Found in the #107 sweep.

#107 made a revoked device stop at once: its live socket gets unauthorized and closes when account.installation-revoked names it, and the web app shows "This device was signed out. Sign in to keep going."

A session that simply runs out while a tab stays open is not covered: the websocket was authenticated once when it opened and keeps working (journal entries, room edits) until it drops for another reason. HTTP actions get 401 and now lead to the same sign-in screen, but a person who only types (rooms over the socket) never makes one.

Fix idea: the live socket knows its session's expiry (or rechecks the session every few minutes and on each room join) and ends with unauthorized the moment it's no longer valid. A test with a short session_ttl proves it.

Severity: broken / security-adjacent (small).

Found in the #107 sweep. #107 made a **revoked** device stop at once: its live socket gets `unauthorized` and closes when `account.installation-revoked` names it, and the web app shows "This device was signed out. Sign in to keep going." A session that simply **runs out** while a tab stays open is not covered: the websocket was authenticated once when it opened and keeps working (journal entries, room edits) until it drops for another reason. HTTP actions get 401 and now lead to the same sign-in screen, but a person who only types (rooms over the socket) never makes one. **Fix idea:** the live socket knows its session's expiry (or rechecks the session every few minutes and on each room join) and ends with `unauthorized` the moment it's no longer valid. A test with a short `session_ttl` proves it. Severity: broken / security-adjacent (small).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#138
No description provided.