System design
Design for the second request
When a reply disappears, the caller and the service hold different evidence. A retry needs an explicit meaning.
The missing reply
A caller submits a change of delivery address. The service commits the write and loses the connection before returning its response. The caller sees a timeout. The service sees a completed operation. Either side can be behaving correctly.
Draw both histories on the same timeline. A timeout says that the caller lacks confirmation. It tells the caller little about whether a state change occurred. Repeating the request may also repeat side effects, such as sending a notification or appending an audit event.
Give intent an identity
Choose an operation identifier that represents one user intent. When a caller retries that intent it must reuse the identifier. A subsequent deliberate edit receives a new one, even if some fields are identical.
At the write boundary, coordinate the identifier and the result with the state change. Recording the identifier in a separate later step creates another interval in which a duplicate can slip through. Define how conflicting payloads using the same identifier are reported.
Define how long memory lasts
A deduplication record has a retention cost. Relate its lifetime to the longest supported retry interval and to delayed messages that can reappear. After that interval, define what evidence the caller should inspect before trying again.
Test the operation by interrupting it after the commit but before the reply. Submit the same identifier concurrently and then with a different payload. Examine the resulting record and all downstream effects. The point is a precise promise about the supported boundary, including what a human can do when the evidence is incomplete.