≈ volna.computerSince February 2026
← My notes

A retry needs the same identity

An interface that offers Retry after a lost response needs a way to recognize the original operation. The server may have finished the work before the connection failed. Sending the same instructions again can create a second result.

Consider a hypothetical document service. A user clicks Create report. The service stores the report, then the connection drops before the browser receives confirmation. The browser offers Retry. If that button submits a fresh creation request, the user ends up with 2 reports despite asking for 1.

For this service, I would assign an operation ID before sending the first request and keep it through every retry. The server would associate that ID with the submitted options and the resulting report. A repeated request with the same ID and options would return the existing report. Reusing the ID with different options would produce an error, because the caller has changed what it is asking the service to do.

Two requests can arrive together and both pass a check for an existing ID before either creates its report. In a service that stores reports in a database, I would enforce uniqueness on the operation ID and commit the report and its operation record in the same transaction. Concurrent attempts would then resolve to a single stored result.

The browser also needs to preserve the ID across a page reload. Otherwise reloading after a timeout quietly turns a retry into a new operation. While the result is unknown, the interface can show "Checking report creation" and ask the service for the operation's status. An explicit Create another report action should generate a new ID.

Retention needs a decision too. If the service forgets an ID after a day, a retry arriving later can create a duplicate. I would document the supported retry period and have the client stop automatic retries when it expires. The user can then inspect existing reports before deciding to create another.

The useful test is to let the server commit a report and deliberately drop its response. Retry from the browser, reload the page, and retry again. Each attempt should lead to the same report. A separate test should submit concurrent requests with that ID and verify that only 1 report is stored.