matrix-org / matrix-org/matrix-spec

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

Open
#1,171 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

improvement
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the Matrix room-invite specification and its existing error-code conventions, focusing on how an invite for an already-present user is currently described. Check whether the proposed distinction needs protocol-wide agreement. Done means the specification clearly defines the applicable error response so clients can distinguish this membership conflict from other failures.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.