libQuotient icon indicating copy to clipboard operation
libQuotient copied to clipboard

Connection::userId() is empty before authentication

Open KitsuneRal opened this issue 1 year ago • 0 comments

Describe the bug Version 0.8 decouples Connection from AccountRegistry, with clients having to add Connection objects to their registry instance instead. However, before successful authentication Connection::userId() returns an empty value.

To Reproduce

  1. Call AccountRegistry::add() on several (two are enough) Connection objects one after another before any of them is authenticated (Connection::assumeIdentity() counts as authentication too).
  2. Observe that only the first Connection object gets added, with a warning on subsequent object(s) in the logs: "Attempt to add another connection for the same user id; skipping".

Expected behavior Some (stable) MXID-based identification for Connection should work from the very beginning of Connection existence, so that one could add them to AccountRegistry right away. Ideally, MXID should not even change during Connection lifecycle but that's a separate story, effectively the same as #439.

Is it environment-specific?

  • libQuotient 0.8 beta

KitsuneRal avatar Jun 08 '23 09:06 KitsuneRal