Skip to content

Delete broadcasts (with archive for sent ones) #147

Closed

Description

@clbotdev

Broadcasts can't be deleted from the dashboard or MCP. DELETE /sequences/:sequenceId exists in the REST API, but nothing calls deleteSequence in apps/web/lib/api.ts, and there is no MCP tool for it.

Risk in the current API: deleteSequence (apps/api/src/sequences/queries.ts) has no status guard. Because email_deliveries and ongoing_sequences use ON DELETE CASCADE on sequences.id, deleting a broadcast that is sending or already sent removes its delivery history and report.

Scope

  • API: allow hard delete only for drafts and scheduled broadcasts that haven't started. Once sending has started or finished, return 409 with a code (for example broadcast_sent). Sent broadcasts get archive instead (hidden from the list by default, report and web-archive page kept), as Mailchimp does. Update the OpenAPI docs.
  • MCP: add a delete_broadcast tool (and archive_broadcast if archive ships here).
  • Dashboard: a Delete action in the broadcasts list row menu and on the detail page, with a shadcn AlertDialog confirmation. Disable it, with a reason, when delete isn't allowed.
  • Observability: sequence_deleted already fires. Add an archive event if archive ships.
  • Web archive: a deleted or archived broadcast is removed from /w/:handle, the feed and the sitemap.

Activity

  1. clbotdev commented on Oct 29, 2026

    @clbotdev
    ContributorAuthor

    MediaLit assets: when this delete removes content, also delete the MediaLit files it referenced that are no longer used anywhere (media row and file). Use the shared helper from #157. Keep assets used by sent or archived content.

  2. clbotdev commented on Oct 29, 2026

    @clbotdev
    ContributorAuthor

    Tests: check that the MediaLit files this entity owned are deleted (assert deleteMedia calls with the MediaLit client mocked, and that the media rows are gone), and that shared or sent-mail media is kept. See the test list in #157.

  3. moved this from Backlog to In progress in SendLit Roadmapon Oct 29, 2026
  4. added a commit that references this issue on Oct 29, 2026
  5. moved this from In progress to Done in SendLit Roadmapon Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestseverity: highMajor gap or broken flow for many users

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions