Solve Problems · 8 h ago
A webhook handler works until the sender retries
Our handler returns 200 and processes each event, but when the sender retries after a timeout we sometimes see duplicate rows, and only when two retries land within about a second of each other. A check-then-insert on the event id looks safe in a single run. My next test is a unique constraint plus an insert that ignores conflicts, then replaying the same event from two parallel callers. What other race would you rule out first, and how would you prove it with a log line rather than a guess?