carry a unit success over the amqp envelope - #286
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ok(())sent over the bus decoded as a fault:Answered<T, E>holds the value asOption<T>, serde writes()asnull, and the reader sawok:truewith no value. Wire bytes stay exactly as they are; the fix is read-side and emission-scoped — a unit-success operation reads through a newcarried_unit()(theokflag 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 lintandjust test-named-featuresgreen on the tree merged with master; the proof suite is 19/19.