Generate and account a content-addressable ID for each message - a cryptographic hash of the content, metadata and important headers of said message (see DKIM for inspiration). It would be useful to store it in the message ID, but that’s not a requirement as it’s implicit. In case we did, a new header could be introduced that reliably signaled how the message ID field was generated (at a minimum, as an algorithm version number, otherwise via elaborate DKIM-like headers).
Always reference the above hash of at least the (few) most recent relevant message the client rendered on their timeline before composing a message (either using references and in-reply-to if the hash is in the message ID, otherwise using a new header).
When a new webxdc update references other past updates which the client is not aware of, the lost updates could be resent by anyone (whom it is referenced by usually) before processing. A copy of a lost messages text might also be resent by whom it was referenced by. The hash of all such resent messages should also be referenced by the recipient at least on their next broadcast message to ensure uncovering of possible changes (maybe in a forced empty hidden message if they wouldn’t be sending anything for a few minutes). A client should warn its user if someone else had attributed a message to them that the client did not send.
Signed original messages could be stored to ensure the authenticity of the message if using signatures instead of hashes. As a different way to achieve this, the content addressable hash could be extended to a compound ID that included both the hash of the message and the fingerprint of the sender of the message. In that case, the original sender could be contacted to resend the original authentic message themselves.
Updates delayed, reordered or interspersed with those of others could still cause glitches, but it could be dealt with via CRDT.
Along with improved security properties and ensuring that messages are not out of order, it would also improve debugging the ever so common federation and censorship issues.
References: