Scheduled messages are only tracked in one browser's localStorage: other devices can't see or cancel them, and after logout they still send with no way to stop them #322

Closed
opened 2026-10-05 17:36:52 -04:00 by jared · 0 comments
Owner

src/app/state/scheduledMessages.ts keeps the scheduled list in localStorage["cinny_scheduled_messages_v1"], with the comment "MSC4140 has no list endpoint, so we track them ourselves." MSC4140 does have one, and Synapse implements it: GET /_matrix/client/unstable/org.matrix.msc4140/delayed_events returns the user's pending delayed events (type, room, content, delay, running_since, delay_id).

Measured:

  • Second device: schedule "scheduled from device A" on one session of aud_main → that session shows "1 scheduled message". A second session of the same account opening the same room shows nothing. Meanwhile GET …/delayed_events with a third token of that user lists "this room: scheduled from device A".
  • Logout: a throwaway account schedules "embarrassing scheduled message" (due in 63 min) and then logs out (Settings → Logout). clearScheduledMessages() wipes the local copy (cinny_scheduled_messages_v1 = null), but the server still lists the message, due in 63 min. It will be posted, and no Lotus client, including that account logging back in, can see or cancel it.

Fix:

  • On start (and when the Schedule tray opens), load the tray from GET …/delayed_events, keeping type === 'm.room.message'. Scheduling is refused in encrypted rooms, so content is in the clear. Skip the call-membership delayed events (org.matrix.msc3401.call.member), which share the endpoint.
  • Keep localStorage only as a cache, or drop it, which also removes one plaintext store from the logout wipe.
  • On logout, offer "You have N scheduled messages: keep them or cancel them?", since they'd otherwise send unseen.

Found in the October 2026 client audit (Playwright against a local Synapse + LiveKit stack, plus code reading). Code refs are at cinny 30e2dbcd, cinny-desktop 8f67ec7, element-call 3b0050e8.

`src/app/state/scheduledMessages.ts` keeps the scheduled list in `localStorage["cinny_scheduled_messages_v1"]`, with the comment *"MSC4140 has no list endpoint, so we track them ourselves."* MSC4140 does have one, and Synapse implements it: `GET /_matrix/client/unstable/org.matrix.msc4140/delayed_events` returns the user's pending delayed events (type, room, content, `delay`, `running_since`, `delay_id`). **Measured:** - **Second device:** schedule "scheduled from device A" on one session of aud_main → that session shows **"1 scheduled message"**. A second session of the same account opening the same room shows **nothing**. Meanwhile `GET …/delayed_events` with a third token of that user lists `"this room: scheduled from device A"`. - **Logout:** a throwaway account schedules "embarrassing scheduled message" (due in 63 min) and then logs out (Settings → Logout). `clearScheduledMessages()` wipes the local copy (`cinny_scheduled_messages_v1` = null), but the server still lists the message, due in 63 min. It will be posted, and no Lotus client, including that account logging back in, can see or cancel it. **Fix:** - On start (and when the Schedule tray opens), load the tray from `GET …/delayed_events`, keeping `type === 'm.room.message'`. Scheduling is refused in encrypted rooms, so `content` is in the clear. Skip the call-membership delayed events (`org.matrix.msc3401.call.member`), which share the endpoint. - Keep localStorage only as a cache, or drop it, which also removes one plaintext store from the logout wipe. - On logout, offer "You have N scheduled messages: keep them or cancel them?", since they'd otherwise send unseen. --- _Found in the October 2026 client audit (Playwright against a local Synapse + LiveKit stack, plus code reading). Code refs are at cinny `30e2dbcd`, cinny-desktop `8f67ec7`, element-call `3b0050e8`._
jared added the bugpriority: mediumarea: messaging labels 2026-10-05 17:36:52 -04:00
jared closed this issue 2026-10-17 23:05:40 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#322