Duplicate Delivery Idempotency
Deliver the same signed event twice and observe whether the second is suppressed, because idempotency is the defence that remains when a signature is valid but the event is not new
Use when: the receiver processes events that carry an identifier and the deduplication behaviour has not been observed
Avoid when: the handler demonstrably deduplicates on a signed identifier and a test confirms the second delivery is suppressed
Procedure
- Confirm from the boundary that sending a duplicate delivery of your own synthetic event is permitted.
- Send a correctly signed synthetic event once and record the response and the processing outcome.
- Send the identical event again, twice, at the agreed rate, capturing status, body and timing each time.
- Check whether the deduplication key comes from the signed body or from an unsigned header or timestamp.
- Determine how long the deduplication store retains identifiers, since a short window equals no protection later.
- Record the three deliveries with their outcomes and the deduplication key and window you identified.
Signals
- A second identical delivery is processed exactly like the first
- The deduplication key is an unsigned header rather than a field inside the signature
- The deduplication window is shorter than the sender's own retry schedule
- Duplicates are only logged while side effects run again
Patterns
1. Delivery triple
1st: 200 processed
element: 200 processed <- no suppression
element: 200 processed
2. Key question
what identifies a duplicate? record source (signed body, unsigned header, request id) and window length in seconds
3. Window compare
dedup window vs sender retry schedule: a window shorter than the retry schedule cannot suppress a retry
Pitfalls
- Testing duplicates on an endpoint where the boundary forbids replay
- Concluding deduplication exists because the second request returned a different status without checking the side effect
- Ignoring that a timestamp-keyed dedup window resets whenever the timestamp differs
Done when
- Three deliveries of one event each have a recorded status and processing outcome
- The deduplication key, its source and its window are identified