Skip to content

Add retry logic with exponential backoff to webhookDeliveryQueue #708

Description

@Kingsman-99

Description

src/lib/webhookDeliveryQueue.ts delivers webhook events to configured endpoints but makes no retry attempt when a delivery fails. A single network hiccup permanently drops the event, causing silent data loss for webhook consumers.

Acceptance Criteria

  • Failed deliveries are retried up to 3 times with exponential backoff (1s, 2s, 4s delays)
  • After 3 failed attempts the event is moved to a dead-letter list accessible via a getFailedDeliveries(): WebhookEvent[] export
  • Successful delivery on any retry clears the event from the retry queue
  • Unit tests: first attempt succeeds (no retry), second attempt succeeds (one retry), all 3 retries fail (event in dead-letter list)
  • Existing tests continue to pass

Context

  • Target file: src/lib/webhookDeliveryQueue.ts
  • Use setTimeout-based delays; no new dependencies

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions