Hacker News new | ask | show | jobs
by theptip 34 days ago
Yes, and if you are building a payment API you need to be robust to client bugs.
2 comments

Rejecting the conflicting request is being robust to improperly reused idempotency keys. There's no other reasonable answer.
The client is part of a distributed transaction. It can't be oblivious to this. Clear semantics and accurate adherence to them is the only answer that doesn't make the overall system unsound. Client bugs are expected and so the simplest semantics that ensure data integrity and accurate responses are the best way to help them identify and fix their bugs.