Skip to content

Fix room version comparisons

Olivia Lee requested to merge benjamin/fix-room-version-comparisons into main

Fixes a set of bugs introduced by 00b77144, where we replaced explicit RoomVersionId matches with version < V11 comparisons. The Ord impl on RoomVersionId does not work like that, and is in fact a lexicographic string comparison (source). The most visible effect of these bugs is that incoming redaction events would sometimes be ignored.

Instead of reverting to the explicit matches, which were quite verbose, I implemented a RoomVersion struct that has flags for each property that we care about. This is similar to the approach used by ruma and synapse.

Merge request reports