Skip to main content

Module operation_id

Module operation_id 

Source
Expand description

Client-supplied operation-id resolution.

The CLI accepts --op-id <UUID> (or HEDDLE_OPERATION_ID) on every state-changing verb. When set, the verb passes it through to the gRPC layer; the dedup store returns the original outcome on replay. When unset, the call executes without dedup.

Verbs that have been routed through with_idempotency in the grpc_local_impl services already honour the field. Verbs that still bypass the gRPC layer (most existing core verbs) ignore it today; wiring lands incrementally as those verbs migrate.

Functions§

clear_persisted_op_id
Drop the persisted op-id for verb. Called after a successful response — releases the slot so the next run gets a fresh id rather than replaying.
resolve_operation_id
Canonical helper used by every state-changing dispatch arm in main.rs. Validates the --op-id format eagerly so a malformed value fails before the verb starts work.
resolve_or_persist_for_verb
Resolve the op-id for a verb that opts into ^C → re-run persistence. Order:
wire
Same as resolve_operation_id but returns the wire-string form expected by gRPC requests. "" means “no idempotency for this call”.