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

SQLite store blocks login after logout #3270

Open
LunarTulip opened this issue Mar 22, 2024 · 3 comments
Open

SQLite store blocks login after logout #3270

LunarTulip opened this issue Mar 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@LunarTulip
Copy link

I just did a test in which I logged a client in with E2E encryption enabled and a SQLite store path set on the client-builder, then logged out, and then attempted to log back in.

On the second login, an error was thrown: Error: failed to read or write to the crypto store the account in the store doesn't match the account in the constructor: expected @test_account_username_redacted:matrix.org:HLLKIANREE, got @test_account_username_redacted:matrix.org:FNJIOAWFAW.

As far as I can tell, the underlying problem is that, while using a client's login-flow creates a crypto store for the session-being-logged-into, using Client::matrix_auth().logout() doesn't correspondingly delete that crypto store. Thus the store for the old session remains in place blocking the new session. (Deleting the old session's associated .sqlite3 files manually in my file system led to the subsquent next login attempt proceeding without issue.)

This seems like non-ideal behavior and I'd suggest, if not entirely having the logout method delete the SQLite store, then at least adding a settings-option to make it do so; because, as things stand, it makes for kind of an ugly workflow wherein one needs to go and manually delete the store, via std::fs or suchlike, after logging out, rather than having it auto-handled within the SDK as crypto-store-creation currently is.

@bnjbvr
Copy link
Member

bnjbvr commented Mar 22, 2024

Thanks for opening an issue! Sounds like a good idea to me 👍 Would you be interested in opening a PR?

@LunarTulip
Copy link
Author

At the moment I don't think I've got the slack to learn the SDK's internal codebase well enough to make a useful PR, unfortunately.

@bnjbvr
Copy link
Member

bnjbvr commented Mar 22, 2024

No worries, thanks for opening the issue.

@Hywan Hywan added the bug Something isn't working label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants