Skip to content

Webhooks: add retry and dead-letter fixture #75

Closed

Description

@sridharkalaibala

Parent issue: #34

Goal

Prove webhook/connector delivery retries are at-least-once, bounded, and visible when permanently failing.

Suggested files to inspect

Acceptance criteria

Validation

  • Run the focused retry/dead-letter tests.
  • Run git diff --check.

Out of scope

  • Building the UI for delivery logs.
  • Calling real external endpoints.

Activity

  1. added
    enhancement
    help wanted
    area: integrations
    needs evidence
    size: medium
    area: app platform
    community edition
    on Sep 1, 2026
  2. flowpatch-reliability commented on Sep 3, 2026

    @flowpatch-reliability
    Contributor

    The acceptance criteria are a good fit for the outbox contract in api/src/sync/outbox.js: it explicitly distinguishes state rows (dedupe by {collection, documentId}) from sale events (never dedupe). A few failure-path details would make the fixture especially valuable:

    • Test the crash window after the remote request succeeds but before resolve() deletes the marker. The next drain must repeat safely, so the connector needs a stable event/idempotency key (not a fresh request ID) and the receiver must tolerate the duplicate.
    • Have the drain claim rows atomically (lease/lockedUntil or an equivalent compare-and-set) before sending. Otherwise two workers/tills can deliver the same event concurrently. Expired leases should become eligible again after a process kill.
    • Assert retry classification explicitly: timeout/connection reset/5xx and 429 retry with bounded exponential backoff (honouring Retry-After when sane); 4xx other than 408/429 goes straight to dead-letter. Cap attempts and persist lastErrorCode, nextAttemptAt, and deadLetteredAt rather than relying only on logs.
    • For state rows, verify a later enqueue updates the pending marker without resetting createdAt; for event rows, verify three sales produce three independently resolvable records. Also assert payloads/errors are redacted and that an outbox failure never changes the sale response, as promised by this module.

    A deterministic fake receiver that records idempotency keys and can fail on Nth call should cover all of this without real endpoints.

  3. flowpatch-reliability commented on Sep 3, 2026

    @flowpatch-reliability
    Contributor

    The acceptance criteria are a good fit for the outbox contract in api/src/sync/outbox.js: it explicitly distinguishes state rows (dedupe by {collection, documentId}) from sale events (never dedupe). A few failure-path details would make the fixture especially valuable:

    • Test the crash window after the remote request succeeds but before resolve() deletes the marker. The next drain must repeat safely, so the connector needs a stable event/idempotency key (not a fresh request ID) and the receiver must tolerate the duplicate.
    • Have the drain claim rows atomically (lease/lockedUntil or an equivalent compare-and-set) before sending. Otherwise two workers/tills can deliver the same event concurrently. Expired leases should become eligible again after a process kill.
    • Assert retry classification explicitly: timeout/connection reset/5xx and 429 retry with bounded exponential backoff (honouring Retry-After when sane); 4xx other than 408/429 goes straight to dead-letter. Cap attempts and persist lastErrorCode, nextAttemptAt, and deadLetteredAt rather than relying only on logs.
    • For state rows, verify a later enqueue updates the pending marker without resetting createdAt; for event rows, verify three sales produce three independently resolvable records. Also assert payloads/errors are redacted and that an outbox failure never changes the sale response, as promised by this module.

    A deterministic fake receiver that records idempotency keys and can fail on Nth call should cover all of this without real endpoints.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: app platformarea: integrationscommunity editionenhancementhelp wantedneeds evidencesize: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions