VibeView.
A visual guide to safe API retriesEngineering explainer · VibeView 1.5.3

Retry the request.
Reuse the result.

The server may finish the work before the client times out. An idempotency key lets a retry find the original operation instead of starting a second one, within the API’s documented retry window.

The work finished. The response never arrived.

Same operation · Same parameters · Valid record

After a client timeout, retry with the same idempotency key and retrieve the original task result Time flows downward. The client submits an archive request with K-A. The server atomically claims the key, creates ARC-17, and saves the result. The first response is lost or delayed, so the client times out. The client retries with K-A and the same parameters; the valid record returns the original ARC-17 result without creating another task. This diagram assumes the server record and business commit stay consistent. Client Archive service One durable operation record TIME First request · K-APOST /archives · project=demo, format=zip One operation, one valid record Idempotency keyK-A Parametersdemo / zip ResultARC-17 · Complete Atomically claimExecute operationSave result Response lost or delayed Result unknown Commit the work and its record together.Recover consistently after a crash. Retry · Reuse K-A and the same parameters Match → Return original resultNo new task is created Return the saved ARC-17 result Response receivedStill the original task
Shown here: the operation succeeded, but the client received no response. A request can also time out before it arrives or while the server is still working.Scroll the diagram horizontally on narrow screens
The key distinction

A timeout means the result is unknown.
The work may already be done.

01 / Identify the operation

Give each operation a key. Keep it for retries.

Creating a task twice can produce two tasks. An idempotency key gives the server a way to recognize repeated attempts to perform the same operation.

Same operation · Retry

“What happened to my archive request?”

First · K-ARetry · K-A ARC-17Return the original result

Save K-A and the request parameters before sending the first request. When the result is unknown, reuse the original key and parameters; if the valid record is complete, return its result.

If the original operation is still in progress: wait, query, or retry with backoff as the API specifies; do not start a second operation.

A separate operation

“Create a second archive.”

Original · K-ANew operation · K-B ARC-17ARC-18

A new operation gets a new key K-B. Two intentional operations can have identical parameters; do not merge requests based only on matching parameters.

Do not change the key because of a timeout. A new key may create another task. A separate business uniqueness constraint would be a different layer of protection.

02 / How the server decides

Check the key, the parameters, and the record.

Authenticate the caller, check permissions, and validate the request before looking up the key in its defined scope. The key does not grant access. If the parameters differ from the stored request, reject the conflict.

What the server does next depends on the API contract
Record stateParametersServer behavior
No valid recordValid requestAtomically claim the key, then execute. Do not start work just because a lookup found nothing.
In progressMatchReport that work is in progress, or wait as the API specifies. Do not start it again.
CompleteMatchReturn the saved result or a stable reference.
Valid record existsDifferReject the conflict; do not overwrite, reuse a mismatched result, or execute a new operation.
Expired or deletedCannot confirmThe original guarantee no longer holds. Check business state, then follow the defined recovery path.
03 / Know the limits

The key is only part of the guarantee.

Safe retries depend on durable records, atomic operations, and a defined retention period. Sending a key is only the client’s part of the protocol.

I

Claim the key
atomically

Two requests can both observe “no record.” Use a unique constraint, transaction, or equivalent atomic claim to compete for the same valid key; an ordinary “check then write” is not enough to deduplicate.

II

Keep the work
and record in sync

Prevent the crash window where “the operation committed but the result record was not written.” Here, task creation and its completion record can share one transaction. Cross-system side effects need mechanisms such as downstream idempotency, transactional messaging, or reconciliation; a local transaction, lock, or cache does not automatically cover remote actions.

III

Respect the
retention window

Coordinate the retention period with the retry window. After a record expires, is lost, or is deleted, the same key may be treated as a new request. Query by a business identifier or use reconciliation and recovery; do not blindly retry or change keys, and do not promise permanent deduplication or unconditional exactly-once behavior across systems.

Put it into practice

One operation.
The same key for every retry.

The API contract must specify how failures, rollbacks, and retryable errors are recorded and when re-execution is allowed. Do not interpret every failure as “never executed.”

Backoff reduces request pressure, but backoff itself does not provide deduplication.

  1. Before sending the first request, save the key and parameters.
  2. On timeout, treat the result as “unknown.”
  3. Within the defined window, reuse the original key and parameters for the same operation; query or retry with backoff as specified.
  4. Use a new key only when intentionally starting a new operation.
  5. After the record expires, check what happened before attempting recovery.

About this example — The service, endpoint, parameters, keys, and task IDs are fictional. This example illustrates a retry mechanism; it does not describe a production incident.

From answer to visual guide — The original question and complete answer are in examples/reading-map.input.md; the visual body is examples/reading-map.fragment.html. The guide pairs the request sequence with a comparison of operations, the server’s decision rules, and the limits of the guarantee.

Build this example — Built with the VibeView 1.5.3 release scripts/compose.py; it embeds assets/design.css. The composer accepts HTML fragments and does not parse Markdown. Run this command from the repository root. Choose a new output filename; the composer will not overwrite an existing file.

python3 -B scripts/compose.py examples/reading-map.fragment.html preview.html --title 'Retry the request. Reuse the result.' --theme violet
Static HTML / No JavaScript / No external fonts or imagesBuilt with VibeView 1.5.3