Delete all my messages in this room (self-service redaction of your own events) #169

Closed
opened 2026-09-17 23:08:32 -04:00 by jared · 1 comment
Owner

Privacy: leave a room cleanly by redacting everything you sent. Your own events need no power level, so this is purely self-service. Bulk redaction of other people's messages stays with Draupnir/the bot — not in scope.

Placement

Room Settings → the current user's own member panel: a tile "Your messages in this room" with a count and a Delete all… button. Not in the message menu, not in the room context menu.

Behaviour

  • Confirm dialog shows the count ("Redact 1,284 messages you sent in #general? This cannot be undone. Redactions are visible to others as 'message deleted'.") and requires typing the room name for > 50 messages.
  • Count/collect via /messages pagination with a sender filter (server-side filter senders: [me]), including media (the mxc content is not purged by a redaction — say so in the dialog; server-side media retention is the admin's job).
  • Runs as a background job with a progress toast (sticky, cancellable): sequential redactEvent, honours 429 with backoff, resumable after reload (persist the cursor locally), skips already-redacted events.
  • Encrypted rooms: same — redactions apply to the encrypted events; the job must not need to decrypt anything.
  • Threads/reactions/edits by you are included; state events (name changes, membership) are not.
  • Optional final step: Leave room checkbox in the confirm.
Privacy: leave a room cleanly by redacting everything *you* sent. Your own events need no power level, so this is purely self-service. Bulk redaction of *other* people's messages stays with Draupnir/the bot — not in scope. ### Placement Room Settings → the current user's own member panel: a tile **"Your messages in this room"** with a count and a *Delete all…* button. Not in the message menu, not in the room context menu. ### Behaviour - Confirm dialog shows the count ("Redact 1,284 messages you sent in #general? This cannot be undone. Redactions are visible to others as 'message deleted'.") and requires typing the room name for > 50 messages. - Count/collect via `/messages` pagination with a sender filter (server-side filter `senders: [me]`), including media (the `mxc` content is *not* purged by a redaction — say so in the dialog; server-side media retention is the admin's job). - Runs as a background job with a progress toast (sticky, cancellable): sequential `redactEvent`, honours 429 with backoff, resumable after reload (persist the cursor locally), skips already-redacted events. - Encrypted rooms: same — redactions apply to the encrypted events; the job must not need to decrypt anything. - Threads/reactions/edits by you are included; state events (name changes, membership) are not. - Optional final step: *Leave room* checkbox in the confirm.
jared added this to the Features 2026-Q4 milestone 2026-09-17 23:08:32 -04:00
jared added the enhancementpriority: lowsecurityarea: messaging labels 2026-09-17 23:08:32 -04:00
jared self-assigned this 2026-09-17 23:08:32 -04:00
Author
Owner

Done in edb46247 — Room Settings → General → Privacy → "Your messages in this room" (kept on the settings page rather than the member panel so it's one click from where people already look for room-level actions; happy to move it).

  • Delete all… opens a confirm that first counts your events with a server-side sender-filtered /messages walk (live "N so far"), then asks to confirm with the number; above 50 you type the room name; Leave the room afterwards checkbox; the text says redactions show as "message deleted" and that uploaded files stay on the server until an admin purges them.
  • The job runs outside React (closing settings is fine): sequential redactEvent, 429 back-off from Retry-After, 404/already-redacted skipped, progress on the tile ("Deleting… 17 / 40") with Cancel; pending ids persisted per room so a reload shows Resume / Discard; toast on completion. State events are never touched; reactions, edits and thread replies you sent are included; encrypted rooms work the same (nothing is decrypted). Own events need no power level.
  • Unit tests: candidate filtering, the server filter, pagination, 429/404 handling, cancel.
  • Verified headless: 62 of bob's events (60 messages + a reaction + a thread reply) redacted in ~34 s while alice's 10 stayed intact; cancel at 17/40 → reload → Resume → "Deleted 40 messages."
    dialog

Not done: a sticky toast with live progress — the toast queue can't update a toast in place, so progress lives on the settings tile instead and the toast fires once at the end.

Done in `edb46247` — Room Settings → General → **Privacy → "Your messages in this room"** (kept on the settings page rather than the member panel so it's one click from where people already look for room-level actions; happy to move it). - **Delete all…** opens a confirm that first *counts* your events with a server-side sender-filtered `/messages` walk (live "N so far"), then asks to confirm with the number; above 50 you type the room name; **Leave the room afterwards** checkbox; the text says redactions show as "message deleted" and that uploaded files stay on the server until an admin purges them. - The job runs outside React (closing settings is fine): sequential `redactEvent`, 429 back-off from `Retry-After`, 404/already-redacted skipped, progress on the tile ("Deleting… 17 / 40") with **Cancel**; pending ids persisted per room so a reload shows **Resume / Discard**; toast on completion. State events are never touched; reactions, edits and thread replies you sent are included; encrypted rooms work the same (nothing is decrypted). Own events need no power level. - Unit tests: candidate filtering, the server filter, pagination, 429/404 handling, cancel. - Verified headless: 62 of bob's events (60 messages + a reaction + a thread reply) redacted in ~34 s while alice's 10 stayed intact; cancel at 17/40 → reload → Resume → "Deleted 40 messages." ![dialog](https://code.lotusguild.org/attachments/4e454c32-183d-4f8b-a01d-0bec8eb4cdfb) Not done: a sticky *toast* with live progress — the toast queue can't update a toast in place, so progress lives on the settings tile instead and the toast fires once at the end.
jared closed this issue 2026-09-19 14:36:29 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#169