Skip to content

Outbound webhook deliveries lack an idempotency key — at-least-once dispatch duplicates #59

Description

@cybermax4200

Why this matters now: User webhooks receive duplicateProofStatus events on every retry/re-delivery, which downstream integrations must not have to dedupe themselves.

Problem / What: sendWebhook (notificationDispatchService.ts:11-41) POSTs the same payload on every dispatch with no Idempotency-Key/dedupe header. BullMQ retries (configured with attempts: 3) and the outbox redelivery both re-POST. Even after fixing #6, any legitimate redelivery produces a duplicate webhook.

Key Challenges: Generating a stable idempotency key (e.g., outboxId + channel + attempt-bucket) that survives retries but allows genuine re-sends after a permanent failure reset; coordinating with webhook consumers.

Acceptance Criteria:

  • Repeated dispatch of the same outbox row to the same webhook sends an Idempotency-Key that is stable across retries and changes only on a deliberate re-send.
  • A consumer replaying with the same key is a no-op (documented expectation).

Relevant files/functions: src/services/notificationDispatchService.ts:11-41, src/workers/notificationWorker.ts:54-73.

Out of scope: Webhook signature verification (separate concern).

Labels: advanced, reliability, bug

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions