Skip to content

Alerting: real webhook and Slack digest delivery with honest sent/failed status #11

Description

@rupertgermann

Parent

#6

What to build

Digest deliveries for webhook and Slack destinations currently get recorded with status "sent" without any HTTP request leaving the server. Make delivery real: during a due-digest run, webhook destinations receive the digest as a JSON POST to the configured URL; Slack destinations receive a Slack-compatible message payload posted to the incoming-webhook URL. Outbound calls use the established AbortController timeout pattern. Delivery status becomes honest: sent, failed (persisting the failure reason), or preview. A failed delivery leaves the digest due so the next run retries it. Destination URLs must be HTTPS — non-HTTPS destinations are rejected at preference save and skipped defensively at delivery time. Email destinations remain record-only. An in-app notification is still recorded for every digest run regardless of channel.

Acceptance criteria

  • A due digest with a webhook destination results in exactly one JSON POST to that URL containing the digest headline, summary, and items
  • A due digest with a Slack destination posts a Slack-compatible payload (message text renders the digest) to the incoming-webhook URL
  • A 2xx response marks the delivery sent; a non-2xx response or network error/timeout marks it failed with the reason persisted on the delivery record
  • A failed delivery is retried on the next run; a sent delivery is not re-sent
  • Non-HTTPS destination URLs are rejected when saving the notification preference
  • Preview runs make no outbound HTTP calls
  • In-app delivery records continue to be written for every run
  • TDD: behavior covered at the notifications-store function seam with globalThis.fetch swapped and a temporary database via DATABASE_FILE; npm test green

Blocked by

None - can start immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentTriaged and ready for an AFK agent to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions