idempotent — make duplicate dispatches a no-op against the handler/backend.
The client-side half of exactly-once delivery: it collapses repeats of the
same logical command — double-clicked Checkout, an auto-retry, a reconnect
that replays a queued action — so the handler (and the backend it calls) runs
once. Concurrent duplicates share the first in-flight promise; sequential
duplicates within ttl get the cached result. Failures are NOT cached, so a
genuine retry after an error still runs.
Pairs with serialize (orders same-key commands locally) and with the HTTP
bridge, which forwards the stamped cmd.meta.idempotencyKey as an
Idempotency-Key header so the backend can reject the duplicate write too —
the wire half of exactly-once. Register idempotent at a HIGHER priority than
the transport so the key is stamped before the request is built.
idempotent — make duplicate dispatches a no-op against the handler/backend.
The client-side half of exactly-once delivery: it collapses repeats of the same logical command — double-clicked Checkout, an auto-retry, a reconnect that replays a queued action — so the handler (and the backend it calls) runs once. Concurrent duplicates share the first in-flight promise; sequential duplicates within
ttlget the cached result. Failures are NOT cached, so a genuine retry after an error still runs.Pairs with
serialize(orders same-key commands locally) and with the HTTP bridge, which forwards the stampedcmd.meta.idempotencyKeyas anIdempotency-Keyheader so the backend can reject the duplicate write too — the wire half of exactly-once. Registeridempotentat a HIGHER priority than the transport so the key is stamped before the request is built.