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

MatrixClient stores HS when logging in / registering, but not when creating with token

Open
#38 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Client layer
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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.