DEV Community

allowfy
allowfy

Posted on Fully Autonomous

A repeated confirmation is not an exactly-once guarantee

Seeing the same successful response twice can be reassuring, but it is not the same as proving exactly-once execution. A terminal response may be idempotent at the API surface while the underlying system still needs separate evidence for durable writes, retries, and recovery.

What the documented QA run observed

In a documented QA run of our gateway, repeating a confirmation after the operation was terminal returned the same succeeded result and the same confirmed_at value. The result was marked test:true. An earlier 12-entry fixture export also showed one operation.confirmed event and one operation.succeeded event for that fixture.

Those observations support a precise statement: the tested terminal retry presented the same result, and the available earlier event fixture contained one recorded confirmation and one recorded success. They do not support a stronger claim that the system provides an exactly-once guarantee under every failure mode.

Idempotent response versus exactly-once work

A retry-safe endpoint can recognize an already-completed operation and return its stored terminal result instead of creating another visible transition. That is valuable. But exactly-once execution is a much broader systems property. A timeout can happen after a downstream write and before the caller receives a response. A process can restart between steps. A worker can receive the same message twice. A database commit and an external side effect can fail to become one atomic transaction.

RFC 9110’s discussion of idempotent methods is a useful boundary: idempotence helps a client safely repeat a request when it cannot tell whether the prior attempt succeeded, but it does not make every unsafe POST automatically retryable. An application still needs an operation identity, durable state, and a deliberate retry contract.

Practical design and test advice

Persist a stable operation key and bind it to the action, resource, approved revision, and relevant principal. On a repeat, return the stored result—or a clearly defined in-progress response—without inventing a new confirmation. Record terminal timestamps and event identities so operators can inspect whether one logical transition was recorded.

Then test beyond the happy terminal retry: retry after a client timeout, retry after a worker restart, duplicate delivery, and failure between internal persistence and an external side effect. Inspect durable state after each case. If the system cannot make the whole effect atomic, document the boundary and provide reconciliation or an explicit unknown-outcome path rather than calling the behavior exactly once.

A sanitized diagnostic sequence is enough for a manuscript: confirm → succeeded, confirmed_at=T; repeat confirm → same succeeded, confirmed_at=T; earlier fixture → one confirmed, one succeeded. It is not a substitute for a concurrency or crash test.

Limits of this observation

The recorded run did not test concurrency, process restart, worker duplication, timeout-after-write, or external side-effect failure. The 12-entry fixture was an earlier export, not a final ledger export. The sandbox used isolated mock commerce data, no real funds, and no real refunds or customer transactions. The result is evidence of terminal-repeat behavior in that fixture, not an exactly-once production claim.


Disclosure: This article is published by the Allowfy team. Generated using AI from recorded Allowfy QA observations and linked technical references; sandbox results, not a production implementation claim.

Top comments (0)