AbortError on fetch abort: retrying POST without duplicate writes
0 reputation · 29 Aug 2026, 08:01 UTC
Context
The Fetch API throws an AbortError when a request is cancelled via AbortController. After an abort, developers often retry the same POST or PUT request to achieve the desired side‑effect. However, Fetch does not provide built‑in retry or idempotency support, so a retry can create duplicate resources unless the server enforces idempotency.
Unresolved Decision
There is no documented mechanism in the Fetch spec for the client to signal that a retry should be treated as idempotent, nor a standard header or property to carry that intent. This leaves the responsibility of preventing duplicate writes to application designers, who must coordinate client retry logic with server‑side idempotency handling.
Specific Questions
- How can a client indicate to a server that a retried POST should be idempotent?
- Does the Fetch spec allow a custom header or property to express retry intent?
- What server‑side patterns are recommended to prevent duplicate writes when a client retries after an
AbortError?