Skip to content

No existing server implementations follow the spec for GET /_matrix/client/v3/rooms/{roomId}/members query parameters #2308

@dasha-uwu

Description

@dasha-uwu

Link to problem area:
https://spec.matrix.org/v1.17/client-server-api/#get_matrixclientv3roomsroomidmembers

Issue
Server behavior when both membership and not_membership are present is currently specced as:

When specified alongside not_membership, the two parameters create an ‘or’ condition: either the membership is the same as membership or is not the same as not_membership.

No existing server implementations do this - Synapse, Dendrite and Conduwuits read this with an 'and' in place of 'or'.

For example if membership=join and not_membership=join is specified, all implementations return nothing, while if the code was following what the spec says it should return all member events ( x == join OR x != join is always true ).

Support for membership and not_membership parameters across implementations:

All three are broken in the same way, if both filters are present the results of comparisons are combined with an 'and' instead of an 'or'. Conduit ignores the membership and not_membership query parameters.

Neither Complement nor Sytest has tests with both membership and not_membership set. Complement has a test for the two parameters individually, but not combined.

The parameters were introduced in MSC1227, which doesn't specify the behavior when both are present:

We extend the /members API to let the user query which members are present in a given room (for populating MemberList), filtered based on membership state and as of a given sync token.

The parameters were added to the spec in matrix-org/matrix-spec-proposals#2035, which post-dates the Synapse implementation. It looks like this was done incorrectly.

Expected behaviour

The spec should be changed to match all current implementations.

Current:

membership:
When specified alongside not_membership, the two parameters create an ‘or’ condition: either the membership is the same as membership or is not the same as not_membership.

Proposed:

membership:
When specified alongside not_membership, the two parameters create an ‘and’ condition: the membership is the same as membership and is not the same as not_membership.

Metadata

Metadata

Assignees

No one assigned

    Labels

    spec-bugSomething which is in the spec, but is wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions