Skip to content

Specific errcode for when a user invited to a room is already present in the room  #1171

@Half-Shot

Description

@Half-Shot

Trying to invite a user into a room in which they are already present will give you a pretty generic M_FORBIDDEN. While this is perfectly valid, it does mean applications do not have a spec complaint way to treat this case differently to other errors. The only way to distinguish a failure due to membership conflict and a failure due to other reasons is by checking the error body for a "is already in the room" (in the case of Synapse).

I'd argue that there should be a specific error code for when a membership change was not possible, so applications (such as bridges) trying to ensure membership in a room can short circuit if the error returned tells them that the user is already joined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementAn idea/future MSC for the spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions