matrix-org / matrix-org/matrix-python-sdk
MatrixClient stores HS when logging in / registering, but not when creating with token
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 266
- Forks
- 118
- PR merge metrics
- No merged PRs in 30d
Description
When a client instance logs in / registers, the response contains, among other things, a home_server field. Currently, this information is stored as a .hs member of the instance. However, if the MatrixClient is created with an exiting token, no such registration/login takes plave, hence no response is received, and the instance doesn't set this member -- which means that code can't rely on its being there.
At the moment, this information isn't used anywhere in the code, so probably the best thing to do is to just remove it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the MatrixClient class and its login, registration, and token-based initialization paths. Search for the .hs member and confirm whether it is unused before removing the inconsistent storage; run the existing test suite to verify client creation and authentication behavior remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100