Engineering Analysis · Global
A browser timeout does not tell you whether the write landed
Rehearse a lost response after a successful write so retries cannot duplicate customer actions.
By Launchr Space ·
Five seconds after clicking Save, a portal customer sees a time-out and clicks Save again. The first request might have failed before reaching the application, or the server might already have written the update. The browser cannot distinguish these possibilities from the timeout alone. That difference matters when a request creates a shipment, enqueues a job or does anything a second click shouldn't repeat.
The platform gives you a way to set an explicit deadline: AbortSignal.timeout() supplies a signal with a TimeoutError reason when its deadline is reached. The platform documentation also explains that the timer measures active time, which can pause while a document is suspended. Treat it as a UI deadline rather than a way to prove what happened to the operation on the server.
Make the retry safe
Give submissions that must occur only once a stable operation identifier, carried through a retry of the same logical action. The backend needs to enforce the identifier as part of recording the write. That way, two requests arriving together cannot both see an empty result and act. Capturing the identifier only in an application log won't enforce anything. If the server cannot safely determine the current state, make the page say that rather than reporting a definite failure or unconditional success.
Run a staging test
For a staging rehearsal, inject a delay between the write and the response. Let the browser deadline pass, verify that a retry checks the same operation, and confirm that the downstream effect happens once. Then run it again with the server rejecting the first submission before the write. In that case, the user should be able to correct the problem and submit normally. The two exercises should produce different server receipts, even if the first screen the customer sees is similar.
Decide how long the server retains the identifier and what happens when its lifetime expires. Scope it to the caller and operation so two customers cannot collide. A duplicate with different input should be treated as a conflict, not silently executed or returned as the old result.