unsigned.redacted_because
field is required but optional
#1630
Labels
A-Client-Server
Issues affecting the CS API
clarification
An area where the expected behaviour is understood, but the spec could do with being more explicit
Link to problem area: https://spec.matrix.org/latest/client-server-api/#redactions
(emph mine). In reality, this field is how clients like Rust SDK detect if an event is redacted or not. This detection then changes how the event is deserialised, to make previously required fields optional. It's a super sane and reasonable approach to take. However, this field is optional. When the sliding sync proxy implemented redactions, it did not set this field, causing breakages on Element X, due to ruma (the underlying rust library) failing to deserialise the redacted form of the event.
There's a few options here, going from most lax to most strict:
unsigned.redacted_because
is always set for redacted events.I think the extremes are bad. Less validation on clients is terrible and increases the scope for data errors. Enforcing that the field is always set is potentially impossible to do in the following case:
m.room.name
withcontent.name
set.content: {}
.unsigned.redacted_because
A) being set and B) truthful (which it may not be!).I suspect the 2nd option is the only possible option here: "say what ruma does isn't advised, but not wrong, and make it optimistically do that." as it isn't possible for servers to always detect redactions, so they can neither guarantee
unsigned.redacted_because
is set nor any other key to signal redactedness.Either way, the spec should go into more detail about this in the redactions section of the CSAPI.
The text was updated successfully, but these errors were encountered: