← Graph

How should POST retries handle changed source-of-truth state?

question 2 connections

Audience question: when a POST depends on some entity that may have been updated between the initial attempt and the retry, should the retry send the new parameters, or stick with the original payload? Answer: apply optimistic locking — attach version 0 to the initial create; on retry the receiver compares the current version and either acknowledges (the first attempt created it) or rejects with a conflict. The sender can then decide whether to discard or continue its workflow (possibly firing side effects/events it still owes) without crashing.

answer_summary
Apply optimistic locking with a version parameter; receiver compares the incoming version and accepts, rejects, or reports 'already created', letting the sender decide how to continue its workflow.
question How should POST retries handle changed source-of-truth state?
about
Answer applies optimistic locking (version 0) to POST retries.
question How should POST retries handle changed source-of-truth state?
asked_at
First audience question in the Q&A.

Provenance