compat: avoid buffer tails by re-encoding all messages