Cause: The message implementation can hold two views of message content: the raw bytes or a decode object form. These operate independently, i.e. changes to the raw bytes do not alter the object content.
Consequence: When a message is automatically decoded into object form on receipt, then updated by setting the raw bytes in order to resend, the resent message used the original object content rather than the bytes.
Fix: On setting the raw bytes, any previously held object content view is reset (i.e. invalidated). (Additionally, a setting was added to allow the automatic decoding of messages into object form to be disabled by environment variable or config file).
Result: The message content reflects the applications actions.