Skip to content

Inconsistent behavior with membership events in state for left rooms #5071

@gingershaped

Description

@gingershaped

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions