Skip to content

feat: retry engine with exponential back-off for failed deliveries #5

@cokehill

Description

@cokehill

Summary

Failed deliveries must be automatically retried with exponential back-off so transient
outages (receiver down, SMTP blip) do not cause permanent notification loss.

Acceptance criteria

  • Max retries configurable via WEBHOOK_MAX_RETRIES (default 5)
  • Base delay configurable via WEBHOOK_RETRY_BASE_MS (default 1000ms)
  • Delay formula: BASE * 2^(attempt - 1) ms
  • After max retries, delivery status set to failed in DB
  • POST /api/deliveries/:id/retry resets attempts = 0 and status = pending
  • Unit test: assert 3 failures → 3 delays with correct multipliers
  • Unit test: assert 5 failures → status = failed

Notes

Back-off runs inside DeliveryService.dispatch() — no separate cron job needed for v0.1.

Metadata

Metadata

Assignees

Labels

DeliveryNotification delivery channelsReliabilityRetry, resilience, error handlingenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions