Currently unexpected payloads sent by the broker will result in either a crash (precondition) or undefined behavior, because it is basically ignored.
All preconditions that can actually occur should rather cause an error and take the channel down cleanly (eg: a valid frame from the broker that is unexpected).
On the other hand, valid broker response frames that arrive without a matching requests are ignored - or worse, just forwarded up the chain to a mismatching request - only to be then converted to an error (outside of the channel handling pipeline).
Ideally, the channel pipeline understands these mismatches and also cleanly takes the channel down with an error.
Currently unexpected payloads sent by the broker will result in either a crash (precondition) or undefined behavior, because it is basically ignored.
All preconditions that can actually occur should rather cause an error and take the channel down cleanly (eg: a valid frame from the broker that is unexpected).
On the other hand, valid broker response frames that arrive without a matching requests are ignored - or worse, just forwarded up the chain to a mismatching request - only to be then converted to an error (outside of the channel handling pipeline).
Ideally, the channel pipeline understands these mismatches and also cleanly takes the channel down with an error.