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
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

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.