Retry, timeout, offline, and API error states in one rule
Use one rule for a network timeout, an offline state, and an API error on the public site and in the signed-in app. A transient failure retries with a short backoff. A client error, a sign-in failure, and a role limit do not retry. Entered text, filters, and drafts are kept, and no queued action is sent without a person choosing it again.
How entry points handle failure today in this pack
Read this table before changing a timeout or a retry. Each row states the surface as found, not a new limit.
| Surface | Timeout as found | Retry as found | User-visible state as found |
|---|---|---|---|
| Public health checker in health-readiness-checks | 5000 milliseconds per check, with an abort signal | One attempt only. The page states to repeat the check before acting | Path, status code, elapsed time, verdict, and checked time in UTC. The response body and headers are not shown. The button is not disabled while a check runs |
| Live check tool in set-retention-and-access | 5000 milliseconds per attempt | Up to 3 attempts. Network failure, timeout, or 5xx retries after 600 milliseconds, then 1800 milliseconds. Other statuses do not retry | Attempt 1 of 3, then retrying in about 1 second or about 2 seconds. Only ok, status, service, and checked_at are read, and every other field is ignored and not shown |
| Saved progress in role-first-run | No request timeout stated on that page | Outbox retries after 400, 1200, 3000, and 7000 milliseconds, then manual Retry saving | Saving could not finish, checks stay on the page, and the queue on the device is stated |
| Source review request | No request timeout stated on that page. The submit lock unlocks after 30000 milliseconds if no confirmation is shown | One retry with the same entries. A second submit is blocked while sending | Sending, draft restored on this device, and thank you after confirmation. The draft is cleared after a successful send |
| Partial answer recovery | Streaming stops on timeout or stop. No automatic retry is stated | Resume continues from the next part. Regenerate replaces the draft and makes no second saved record | Timed out, stopped before the check finished, or complete. The unavailable wording is shown on timeout, and the draft is labelled as draft, not as a checked answer |
| Sign-in, session, and workspace recovery spec | No background timeout retry stated | Manual Try again only, with the same request. The button is disabled while a retry is in progress, and no automatic retry loop runs in the background | 401 asks for sign-in again and never auto-sends a queued action. 403 names the role that can do the step and shows no Try again button. 5xx, timeout, and offline state whether the save was confirmed or not saved yet, with a correlation ID when the server supplied one |
The gap is that one health call can run once on one public page and up to three times on another public page, with different status wording, different backoff, and no shared offline state. This page closes that gap for health and live checks. Other endpoints keep the timeout already stated for them and adopt only the attempt, backoff, status, and no-loss pattern below where the pack already states that pattern.
Unified rule to ship
Apply this rule in order. The first category that fits decides the route, and no later step runs for that failure.
Step 1: Check offline before the first attempt
If the device reports offline, run no attempt. State offline, state that entered text, selected assistant, filters, and drafts are kept, and offer Run check again when the device is online. An online event updates that state. It does not run a check and it does not send a queued action.
Step 2: Run a safe check with a 5000 millisecond timeout and up to 3 attempts
For health and live checks, use a 5000 millisecond timeout per attempt, credentials omitted, and cache no-store, as the two public checkers already state. Retry only a network failure, a timeout, or status 500 to 599. Wait a jittered exponential backoff of about 600 milliseconds after attempt 1 and about 1800 milliseconds after attempt 2, honouring a Retry-After header on a 5xx response up to 10 seconds, and log each failed attempt. Do not retry status 400 to 499, including 401, 403, 404, and 405. Mutations reuse one idempotency key across retries of the same logical request; this GET check sends no idempotency key.
Step 3: Keep controls and status honest while an attempt runs
Disable the run control while attempts run. State attempt 1 of 3, then retrying in about 1 second or about 2 seconds before the next attempt. Keep focus visible, announce each change once in a status region, and return focus to the run control when the run ends if that control had focus at the start.
Step 4: State the final failure in the words for its category
Offline states offline and no check was run. Timeout and network failure state did not complete and state the attempts used. Status 503 states answered but not confirmed as live. Status 404 or 405 states not configured on this origin and stops at attempt 1. Status 401 states sign-in is required and offers sign-in, with no auto-send after sign-in. Status 403 names the role that can do the step and shows no retry button unless a role change is confirmed. Validation and other 4xx states did not complete, state the status code, and offer correction or a manual retry with the same entries.
Step 5: Lose nothing on a retry
Keep typed text, the selected assistant, collection, filters, and any draft in the same college workspace until the person clears them or a save is confirmed. Reuse the same request, the same payload, and the same request identifier on a retry. A retry makes no second saved item, no second record, and no second send. A save that did not confirm states not saved yet.
Step 6: Show only the fields the surface is allowed to show
A public live check reads only ok, status, service, and checked_at, with a top-level field taking precedence over a nested data field. It never shows version, uptime, dependency status, host, address, configuration, secret, or error text. A correlation ID is shown only when the server supplied one and is labelled as supplied. When the server supplied none, a client reference is labelled as a client reference. A server ID is never invented.
Try the unified checker on this page
Example only for simulation. Real mode runs GET /api/health with no sign-in, no cookies, and no cache, once per button choice, with the unified rule above. Simulation runs the same attempt, backoff, status, and final-state logic against a local transport and returns at once, so it does not wait 5000 milliseconds per attempt. Nothing entered here is sent to a server except the real live check call, and nothing is saved.
Simulation uses the same 3 attempts, the same stop rules, and the same final wording. It does not prove the live service is live.
Offline.
No check was run. Reconnect, then choose Run check again. Entered text and filters on this page are kept.
The unified check has not run yet on this page.
The real check reads only ok, status, service, and checked_at. It never calls a readiness endpoint and never shows version, uptime, dependency status, address, configuration, secret, or error detail.
Checks before you rely on a failure state
Run each check on a phone and on a desktop with keyboard and screen reader before you publish a form, a checker, or a save path.
- Simulate a timeout and a network failure and confirm attempts 1, 2, and 3, the backoff wording, and a final did not complete state with the attempts used
- Simulate status 503 and status 404 and confirm 503 retries to attempt 3 while 404 stops at attempt 1 with not configured on this origin
- Simulate offline and confirm no attempt runs, the offline state is shown, and reconnecting updates the state without running a check or sending a queued action
- Run the real check and confirm the run control is disabled while attempts run, focus returns to it at the end, and only ok, status, service, and checked_at are read
- Fail a save and confirm entered text stays on the page, a retry reuses the same entries, and no second saved item is created
- Confirm a 401 offers sign-in again with no auto-send after sign-in, and a 403 names the role that can do the step and shows no retry button while the role is unchanged
- Confirm each failed attempt is logged in the console with attempt, status or error, and delay, that the displayed wait matches the actual wait, and that entered text and selections are kept after a failure
Follow Health, liveness, and readiness checks for the public check, Sign-in, session, and workspace recovery for 401, 403, and workspace load failure, Partial answer recovery for timeout and stop, and Set retention and access for the live check tool this rule unifies with.
Next guide
Keep drafts and entered text when a check times out or stops.