Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MatrixClient.login no longer stashes the returned access token #4627

Closed
wants to merge 1 commit into from

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jan 17, 2025

Previously, MatrixClient.login had some very unintuitive behaviour where it
stashed the access token, but not the device id, refresh token, etc etc, which
led people to imagine that they had a functional MatrixClient when they didn't.

Ideally we would stash all the returned credentials so that the app doesn't
need to make a new MatrixClient, but that's a bit complicated (especially with
OIDC) and more than I have time for, so let's at least disable the footgun by
not saving anything.

Fixes: #4502

Previously, `MatrixClient.login` had some very unintuitive behaviour where it
stashed the access token, but not the device id, refresh token, etc etc, which
led people to imagine that they had a functional MatrixClient when they didn't.

Ideally we would stash all the returned credentials so that the app doesn't
need to make a new MatrixClient, but that's a bit complicated (especially with
OIDC) and more than I have time for, so let's at least disable the footgun by
not saving *anything*.

Fixes: #4502
@richvdh richvdh added the T-Feature Request to add a new feature which does not exist right now label Jan 17, 2025
@richvdh richvdh requested a review from a team as a code owner January 17, 2025 18:31
@richvdh richvdh requested review from dbkr and t3chguy January 17, 2025 18:31
@richvdh richvdh added T-Enhancement and removed T-Feature Request to add a new feature which does not exist right now labels Jan 17, 2025
@t3chguy
Copy link
Member

t3chguy commented Jan 20, 2025

@richvdh I'd argue this is a breaking change, as consumers may be relying on the current imperfect and inconsistent stashing behaviour

@richvdh
Copy link
Member Author

richvdh commented Jan 20, 2025

Yeah, possibly. I suppose a better way out of this would be to create a new makeLoginRequest function or something, and deprecate login and friends.

@richvdh
Copy link
Member Author

richvdh commented Jan 20, 2025

closing in favour of #4632

@richvdh richvdh closed this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MatrixClient.login persists access token but not device ID, refresh token, etc
2 participants