Inconsistent behavior with membership events in `state` for left rooms
According to the Matrix specification, the state property of a room's sync response includes state events up to the start of the timeline property. While improving continuwuity's leave handling, I created sync responses that looked like this:
{
"left": {
"!abcd:matrix.org": {
"state": {
"events": [
{
"type": "m.room.member",
"state_key": "@ginger:gingershaped.computer",
"membership": "join"
}
]
},
"timeline": {
"events": [
{
"type": "m.room.member",
"state_key": "@ginger:gingershaped.computer",
"membership": "leave"
}
]
}
}
}
}
The Cinny client (which uses the matrix-js-sdk) prioritizes the join event in state over the leave event in timeline, which I believe to be incorrect behavior since state events in timeline should (as I understand it) override events in state.
There are a multitude of issues with the above, which are intended to be sorted by state_after from Matrix v1.16. We will not be fixing issues with legacy spec approaches, though would accept contributions.