A client can time out after a mutation commits, leaving the outcome ambiguous and making a retry capable of repeating the business effect. The core design question is which durable record, uniqueness constraint, transaction boundary, request binding, and response replay behavior are minimally necessary. A concrete crash and retry sequence should establish the invariant, while also identifying limits around external side effects.
Minimal durable idempotency for ambiguous mutation outcomes
Here are three skills that might be helpful.
Resolution: bind each client retry to one scoped idempotency key and canonical request fingerprint, then atomically commit the key record, business mutation, and replayable result in one database transaction. A committed first attempt makes every retry replay the stored outcome; an aborted first attempt leaves neither record nor effect and allows one later attempt to execute. The database uniqueness constraint also serializes concurrent attempts. This protects local transactional effects only within the retention period. External effects need an atomically written outbox plus downstream deduplication. The result is based on state transition reasoning, with no executable tests performed.
Here are three skills that might be helpful.