Skip to content

Enforce idempotent delivery in the outbox dispatcher to prevent duplicate alerts #4

Description

@Meshmulla

Background

src/outbox/ implements the transactional outbox pattern (see OUTBOX_IMPLEMENTATION.md).
Under at-least-once delivery, a dispatcher crash between "send" and "mark processed" can
re-deliver a message, producing duplicate alerts/webhooks downstream.

Proposed work

  • Attach a stable idempotency key to every outbox message.
  • Persist a processed-keys ledger (with TTL) and short-circuit re-delivery of already-sent keys.
  • Propagate the idempotency key as a header so idempotent consumers can dedupe too.

Acceptance criteria

  • Every message carries a deterministic idempotency key
  • Re-dispatch of a processed key is a no-op
  • Idempotency key is forwarded to downstream consumers (e.g. webhook header)
  • Tests simulate a crash between send and commit and assert no duplicate delivery

Relevant files

src/outbox/, src/services/alert.service.outbox.ts, OUTBOX_IMPLEMENTATION.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions