matrix-org / matrix-org/matrix-python-sdk

Room aliases list doesn't take into account multiple m.room.aliases states

Open
#106 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Client layer good first issue
Dominant language
Python
Stars
266
Forks
118
PR merge metrics
No merged PRs in 30d

Description

The [Room.update_aliases](https://github.com/matrix-org/matrix-python-sdk/blob/master/matrix_client/room.py#L416) method does not take into account that there can be multiple `m.room.aliases` states. Because room aliases from separate HSes are in separate `m.room.aliases` states (with the HS name as the state key), this means the `update_aliases` function will actually set the aliases list to only contain the aliases from one HS, disregarding the others.

Example (the code should list all aliases for Matrix HQ):
```
>>> client.rooms['!cURbafjkfsMDVwdRDQ:matrix.org'].update_aliases()
True
>>> client.rooms['!cURbafjkfsMDVwdRDQ:matrix.org'].aliases
['#matrix:utzutzutz.net']
```

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

Start in matrix_client/room.py at Room.update_aliases, then reproduce the example for the Matrix HQ room. Check how each m.room.aliases state is handled and verify that the resulting aliases list includes aliases from every homeserver state, not just one.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.