|
|
|
|
|
by joshribakoff
1811 days ago
|
|
Many developers conflate idempotency and purity. It appears stripe is trying for purity, two requests always have the same response. This is likely misguided. Idempotency would be like the API failed to generate the success response, but the backend did issue the money movement. On subsequent retries what matters is that it doesn’t do a duplicate money movement. The client ought to get a request indicating the money was successfully moved (since it was), perhaps with the earlier timestamp as a way of indicating it was already moved. Or it ought to get a special response that indicates the client can stop retrying Sending the same error upon success sounds like the client has no way to know when to stop retrying. Sure it makes the API pure, but what problem does it even solve? |
|
Whether they're helpful in all server-side error situations I'm not sure.
1: https://stripe.com/docs/idempotency#sending-idempotency-keys
2: https://stripe.com/docs/error-handling#the-stripe-should-ret...