Information estates
Retrying an import should preserve the business operation
A timed-out request may already have changed the register. Define operation identity, atomic local effects and external delivery recovery so retries have an explainable business outcome.

An import request reaches the server, creates the records and loses its response on the way back. The browser reports a timeout. The person running the import clicks again because the application has given them no way to know whether the first attempt succeeded.
I've cleaned up after an import that ran twice because someone clicked again after a timeout. Deleting the duplicates was easy; proving which set was the real one wasn't.
The second request is predictable. A dependable import design should say what it means. Does it repeat the same business operation, submit a new version or deliberately create another set of records? Those choices need different identities and different outcomes.
My earlier piece on preserving import evidence separates original material from interpretation. This one looks at the boundary between an attempted request and a recorded business effect, using a service-request register as the example.
Identify the operation being repeated
A file digest identifies a byte sequence. It doesn't, by itself, identify every business operation somebody may legitimately perform with that file. The same workbook might be reviewed, imported into a test space and later submitted to an authorised production workflow.
Define an operation identifier within the relevant customer and workflow scope. Record what the operation intends to do, who requested it and which source version it uses. Keep a deliberate new submission distinct from a retry of an existing submission.
In the register example, the browser submission could create an import operation before processing begins. Later retries refer to that operation instead of inventing a new identity each time a network call fails. The server remains responsible for establishing whether the caller may act on it.
Treat this as an application contract, not a special property of an HTTP header. The HTTP semantics specification defines idempotency in terms of the intended effect on the server of multiple identical requests. POST isn't idempotent under that definition, and RFC 9110 says a client shouldn't automatically retry a non-idempotent request unless it has some means to know the request semantics are actually idempotent, or that the original request was never applied. The operation identifier is that means, and the application has to define it.
The IETF's Idempotency-Key header field would standardise how a client sends such a key, but at the time of writing it's still an Internet-Draft (revision 08, October 2026), not an RFC, and it leaves key uniqueness and expiry policy for each resource to define and publish.
Bind the identifier to its meaning
An identifier becomes unsafe when the application accepts it for unrelated payloads. If the same operation key arrives with different source material or a materially different instruction, make the conflict explicit. The Idempotency-Key draft suggests a 422 response when a key is reused with a different payload.
Record the inputs that define the operation. A source identifier, source digest, target context and rule version may be relevant. The exact combination is a domain decision; document it and test it with synthetic examples.
Scope lookup and uniqueness to the intended boundary. A request from one customer must not discover another customer's operation because it happens to guess an identifier. Apply authorisation before returning the stored result or reporting detailed information about a conflict.
Define how long the operation record remains useful. A short retry window and a long-running reconciliation process may need different retention. Decide what happens when a client presents an expired identifier, so the application doesn't quietly treat it as permission to perform the action again.
Make the local database decision atomic
A check that an operation 'does not exist yet', whether in the browser or in a server-side query, isn't enough protection against concurrent submissions. Two requests can both reach that conclusion before either creates its result.
Use the database's constraints and transaction behaviour to enforce the chosen contract. PostgreSQL's constraint documentation describes uniqueness, and its transaction introduction explains grouping statements into an atomic transaction.
For a bounded operation whose effects live in one database, design the business changes and the operation's completion status to commit in the same transaction. A uniqueness conflict should lead to a defined path for inspecting the existing operation, not a generic success badge that hides an unknown result. In PostgreSQL, INSERT ... ON CONFLICT lets the second insert take a defined alternative action instead of raising a unique violation error.
Work out what a concurrent retry sees while the first attempt is still processing. It may receive an operation status and a route for checking progress (the Idempotency-Key draft suggests a 409 response here). In PostgreSQL, a second insert of the same key waits until the first transaction commits or rolls back, so if the operation record is only inserted inside the long-running import transaction, the retry blocks instead of seeing a status. The useful response is specific about the state; it doesn't pretend that every request has independently completed the work.
Give external effects their own recovery path
Sending an email, writing to another service and committing a local transaction are separate events. A transaction in the application database can't make an unrelated remote system participate automatically.
Record the external work that remains to be done and the evidence of its delivery. Writing that work to an outbox table in the same transaction as the business change is the transactional outbox pattern; a separate worker then delivers it and records the result. If the remote endpoint offers an idempotency mechanism, understand its scope, retention and conflict behaviour before relying on it. Reusing a local operation identifier doesn't establish the remote service's semantics.
Plan for the awkward interval in which the remote action succeeds but the local delivery acknowledgement is lost. A worker that retries in that case delivers at least once, so the recovery design needs a way to reconcile the outcome or make the retry safe for the receiver. A queue badge alone doesn't explain which business effect has occurred.
In the register example, creating imported requests and notifying their owners should have separately observable outcomes. A notification retry shouldn't create a second set of imported requests, and a successful database import shouldn't hide a notification failure either.
Test interruptions, concurrency and deliberate resubmission
Build a small synthetic fixture set and state the expected business result independently of the implementation. Repeat a completed submission, send two copies concurrently and interrupt the response after the local work has committed.
| Exercise | Expected application behaviour |
|---|---|
| Same operation and same inputs | Return or follow the existing operation |
| Same operation and different inputs | Explain the conflict without repeating the effect |
| Two concurrent attempts | Preserve the chosen uniqueness and transaction contract |
| Deliberately new submission | Create a distinct authorised operation |
Include access tests and retention boundaries. An operation that has already completed still needs an authorisation check when its result is retrieved. An expired key needs a deliberate outcome, not an accidental second import.
The acceptance question isn't whether the button disables quickly enough. It's whether a repeated request preserves the intended business effect and leaves an explanation when the outcome is uncertain. Once that explanation survives timeouts, concurrency and external delivery failures, the interface can give people a useful next action instead of asking them to guess whether to click again.

