Skip to content

carry a unit success over the amqp envelope - #286

Merged
eburgos merged 1 commit into
masterfrom
unit-success-over-amqp
Sep 6, 2026
Merged

carry a unit success over the amqp envelope#286
eburgos merged 1 commit into
masterfrom
unit-success-over-amqp

Conversation

@eburgos

@eburgos eburgos commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Ok(()) sent over the bus decoded as a fault: Answered<T, E> holds the value as Option<T>, serde writes () as null, and the reader saw ok:true with no value. Wire bytes stay exactly as they are; the fix is read-side and emission-scoped — a unit-success operation reads through a new carried_unit() (the ok flag alone), everything else keeps demanding a carried value, pinned by a stub-transport test that writes the impossible shape directly. Readers emit conditionally so neither is ever dead in a consumer.

The proof harness test that documented the defect flips into the round-trip assertion (the_amqp_loop_round_trips_the_no_payload_operation_s_unit_success).

Gate: just lint and just test-named-features green on the tree merged with master; the proof suite is 19/19.

A unit success could not cross the bus: the envelope holds its value
as an option, serde writes the unit as null, and the reader saw an
absent value and answered a fault where Ok(()) was sent. The wire
bytes were already right, so the fix is in the reading alone - an
operation whose declared success is the unit type now reads the ok
flag through carried_unit(), never touching the value, while every
other success type keeps demanding a carried value (pinned by a
stubbed-wire test). The reader emission is conditional, so a service
declaring no unit reply publishes no unit reader and the reverse.

The proof test that documented the wrong behavior flips into the
assertion of the round trip and is renamed to say so.
@eburgos
eburgos merged commit 8ac0cda into master Sep 6, 2026
@eburgos
eburgos deleted the unit-success-over-amqp branch September 6, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant