Skip to content

feat: delete draft broadcasts, archive sent ones (#147) - #165

Merged
clbotdev merged 3 commits into
mainfrom
feat/147-broadcast-delete-archive
Oct 29, 2026
Merged

clbotdev merged 3 commits into
mainfrom
feat/147-broadcast-delete-archive

Conversation

@clbotdev

Copy link
Copy Markdown
Contributor

Closes #147. Part of #152.

What

  • API: draft and scheduled-not-yet-due broadcasts can be deleted (schedule rule cascades, unused images deleted per ADR 0006). Sending broadcasts → 409 sequence_active. Broadcasts that started sending (sent or paused mid-send) → 409 broadcast_sent; the delete statement re-checks so a broadcast locking concurrently is kept.
  • Archive: new nullable sequences.archived_at (migration 0028, additive, previous-release compatible). POST /sequences/:id/archive (sent only; 409 broadcast_not_sent / sequence_active), POST /sequences/:id/unarchive. GET /sequences hides archived unless archived=only|include. Report, deliveries and media kept. Archived paused-mid-send broadcasts can't resume until restored.
  • Web archive: archived broadcasts leave /w/:handle, issue page, feed and sitemap; unarchive restores. Per-recipient "view in browser" keeps working. ADR 0008.
  • MCP: delete_sequence (reused, consistent with Delete sequences #148) explains broadcast_sent; new archive_broadcast, unarchive_broadcast; list_sequences gets archived. 113 tools.
  • Dashboard: broadcasts list row menu (Archive / Unarchive / Delete, disabled with reason) + "All broadcasts / Archived" filter; detail page Archive/Unarchive/Delete (tooltip reason), archived banner; delete dialog generalized for broadcasts with "Archive instead".
  • Events: broadcast_archived, broadcast_unarchived (props already allowlisted).
  • Docs: broadcasts, web archive, errors, MCP.

Verification

  • lint, API 935/0 (--env-file=/dev/null), web 106/0, check:drift, test:conformance all pass.
  • Full browser e2e on an isolated stack (fresh DB, MediaLit stub, Mailpit): sent a broadcast with an uploaded image from the dashboard → both readers received it in Mailpit with the MediaLit image; list menu Delete disabled with reason, API 409 broadcast_sent; archived from the list menu → gone from list, shown under Archived, stats unchanged (sent 2), deliveries and media kept, no MediaLit delete, gone from /w/:handle, issue 404, feed and sitemap; unarchived from the detail page → back in list and on the web; deleted a draft (list) and a scheduled broadcast (detail page) → rows, rule and media gone, MediaLit DELETE observed for each; archiving a draft → 409 broadcast_not_sent. 40/40 checks passed; screenshots inspected.

…147)

Sent broadcasts answer 409 broadcast_sent and are archived instead
(sequences.archived_at): hidden from GET /sequences unless archived=only|include,
removed from the web archive, feed and sitemap, report and media kept.
Adds POST /sequences/:id/archive and /unarchive, MCP archive_broadcast and
unarchive_broadcast, and broadcast_archived/unarchived events.
@clbotdev
clbotdev merged commit 5f7af55 into main Oct 29, 2026
5 checks passed
@clbotdev
clbotdev deleted the feat/147-broadcast-delete-archive branch October 29, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete broadcasts (with archive for sent ones)

2 participants