Function append_preserves_an_empty_payload
pub async fn append_preserves_an_empty_payload<F: Fixture>(
open: impl AsyncFn() -> F,
) -> RuleOutcomeExpand description
A zero-length payload round-trips as a zero-length payload.
VT-1. Event::data is a Bytes, never an Option<Bytes>, so “no
payload” is not a value the type can hold — and an adapter whose column is
nullable has to decide what an empty slice means on the way in. The
decision that is easy to write and wrong is (!data.is_empty()).then_some(data),
applied by one helper to both blob columns because metadata genuinely is
optional. Against a data BLOB NOT NULL column that is a constraint
violation on a perfectly legal event; against a nullable one it is silent
loss.
EmptyPayloadIsNullStore is the compiled version, and it is the only
one this rule can have. The rule reads twice — the payload is zero-length,
and the rest of the event is untouched — and no store can fail the second
half while passing the first: data is a Bytes, so “absent” is not a
value it can be conflated with the way MetadataConflatingStore conflates
the nullable column, and truncating a zero-length payload is a no-op.
Refusing is the whole observable defect. Those two assertions are here
because they say what the rule means, not because a registered store
fails them.