An order gets two confirmations, a subscription triggers two messages or a deployment starts twice. Before looking for a user clicking twice, inspect incoming events: a network delivery and a business operation are not the same thing.

Our recommendation is to design the receiver so that repetition does not repeat its effect. That does not mean discarding every request that looks similar. A duplicate, another legitimate action and recovery after a failure need different treatment.

Establish the provider's delivery contract

Delivery policies differ. Stripe documents duplicates and the lack of an ordering guarantee. By contrast, GitHub does not automatically redeliver failed deliveries: recovery needs an explicit process.

For each integration, record its available identifier, redelivery options and the event types you actually need. Do not assume an HTTP 200 proves that your entire business operation has completed. It primarily records a response from your receiving endpoint.

Separate authenticity from deduplication

A familiar identifier does not prove where a request came from. First validate its signature using the provider's procedure and the correct environment's secret. Stripe's signature troubleshooting guidance highlights the importance of preserving the original request body.

Only then look up the delivery in storage. For GitHub, a redelivery retains the original X-GitHub-Delivery identifier. Neither arrival time nor an email address is a universal replacement for a delivery identifier.

Our architectural advice is to scope the key by provider, environment, relevant account and identifier. Two shops or two environments should not accidentally share the same deduplication namespace.

Persist receipt rather than a single boolean

We recommend a durable inbox with explicit states such as pending, processing, completed and failed. Recording an event does not establish that its processing succeeded.

A database uniqueness constraint can stop concurrent inserts for the same key. An application-level existence check followed by an insert leaves a race between those operations.

Acknowledge receipt after durable recording and arrange for a worker to discover pending tasks. If you use a separate queue, design a reliable handoff, for example a transactional outbox. A crash between writing the database row and sending the queue message must not silently abandon the task.

The inbox itself also needs ownership: decide which worker can claim a task and how an interrupted claim becomes eligible for recovery. Otherwise, preventing duplicates can merely turn them into permanently stuck work.

Protect the final action as well

Consider this test: a worker performs the action, then crashes before marking the event completed. The same task returns after restart. Uniqueness at receipt does not necessarily protect that external effect.

For changes inside one database, our recommendation is to put the business update and processing status in one transaction where appropriate. For an external API, look for a documented idempotency key or a reconciliation mechanism. Otherwise, introduce an uncertain state and verify the outcome before trying again.

Test failures before chasing throughput

In a test environment, submit the same delivery twice, then submit two copies concurrently. Interrupt processing after receipt and after the final action. Check the actual business outcome, not just HTTP responses.

Add correlation identifiers and alerts for stuck tasks without routinely logging sensitive payloads. Finally, document who may replay an event and how they should verify its effect. These proposed tests do not promise exactly-once delivery: they make repeated delivery observable and its consequences manageable.

Cover visual: generated editorial illustration, not an official screenshot.