We are occasionally seeing the same event delivered twice, with the same event id. Our handler creates a record each time, so we end up with duplicates.
Beantwoordapiwebhooks
Webhook deliveries arriving twice
Ravi S.1389
1 reactie
Geaccepteerd antwoord
Tomas L.
Integrations
Duplicate delivery is expected, not a fault. Delivery is at-least-once: if a response is slow or a connection drops after we sent the request but before we read the reply, the event is retried even though you did receive it.
The event id is there precisely so you can make the handler idempotent — key on it, and ignore an id you have already processed.
Returning 200 quickly and doing the work afterwards also reduces how often it happens, since most duplicates are caused by a handler that took too long to answer.