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

The server versions cache is unaware of the homeserver URL #3791

Closed
pixlwave opened this issue Aug 1, 2024 · 1 comment
Closed

The server versions cache is unaware of the homeserver URL #3791

pixlwave opened this issue Aug 1, 2024 · 1 comment

Comments

@pixlwave
Copy link
Member

pixlwave commented Aug 1, 2024

Steps to reproduce:

  • Build a Client with serverNameOrHomeserverUrl("matrix.org") but don’t log in/use the client.
  • Build a Client with serverNameOrHomeserverUrl("element.io") using the same sessionPath (as you didn’t use the previous client) and log in.
  • The client will use the server versions from matrix.org whilst talking to element.io (i.e. it attempts to use the authenticated media APIs)
@bnjbvr
Copy link
Member

bnjbvr commented Aug 12, 2024

using the same sessionPath (as you didn’t use the previous client)

This is super dangerous, reusing the same path means reusing the same data from all the state store. The assumption was that one new client = one new store = one empty directory for the session. In general, it's your responsibility as an embedder to ensure that the directory is empty before creating the client: here, it's the server versions that's affected, but technically every cached value could tried to be reused by the next client, and things could go wrong in multiple ways that are even more confusing.

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

No branches or pull requests

2 participants