Skip to content

fix: Update rest session manager when logging in#1569

Open
tpoliaw wants to merge 2 commits into
mainfrom
client-login
Open

fix: Update rest session manager when logging in#1569
tpoliaw wants to merge 2 commits into
mainfrom
client-login

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

If the user is not logged in when the client is created, the rest client
does not get a session manager. When the user calls login, a new session
manager is created to cache the new token but if the rest client is not
updated, any subsequent calls remain unauthenticated.

Setting the rest client's session manager to the new instance when a
login is successful means the tokens can be used without recreating the
client.

Now that the login method works as expected, the client created in the
just repl task can now automatically refresh its login if required.

If the user is not logged in when the client is created, the rest client
does not get a session manager. When the user calls login, a new session
manager is created to cache the new token but if the rest client is not
updated, any subsequent calls remain unauthenticated.

Setting the rest client's session manager to the new instance when a
login is successful means the tokens can be used without recreating the
client.

Now that the login method works as expected, the client created in the
`just repl` task can now automatically refresh its login if required.
Comment thread src/blueapi/client/client.py Fixed
@tpoliaw tpoliaw requested a review from a team as a code owner June 25, 2026 17:50
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.91%. Comparing base (8d585a9) to head (5b435bc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1569   +/-   ##
=======================================
  Coverage   95.91%   95.91%           
=======================================
  Files          44       44           
  Lines        3255     3256    +1     
=======================================
+ Hits         3122     3123    +1     
  Misses        133      133           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calling login on a BlueapiClient doesn't allow that client to be used

1 participant