chatrix icon indicating copy to clipboard operation
chatrix copied to clipboard

Allow simulatenous usage of multiple blocks on the same page

Open akirk opened this issue 2 years ago • 4 comments

https://github.com/vector-im/hydrogen-web/issues/1045

This description has been added by @psrpinto for context:

At the moment, when there's multiple blocks on a page, opening a session on one of the blocks, closes it on all others. This is intended, since Hydrogen does not allow having the same session open in multiple instances of the client, which could cause data corruption.

I can see three ways to address this issue:

  1. Make hydrogen support having the same session open in multiple clients
  2. Assign a different device id to each block
  3. Assign a different session to each block

The ideal scenario would be 1. since both 2. and 3. will result in the user having to log-in in each block, which is not ideal. Alternatively we could explore ways to workaround this, by "cloning" the session, though my guess is this won't be easy to get right. So I think we should first rule out 1. before attempting 2. or 3.

Concerning 1., at this point it's not clear whether it would be possible to do this in hydrogen. We should check with hydrogen maintainers whether they have considered this possibility, or if they have plans to implement it in the future, and what it would take to achieve this, technically.

There are also implications in what concerns SSO, since when the user gets back to the page at the end of the SSO flow, only one of the blocks should perform SSO completion, with the other blocks probably having to "wait" until SSO completion is done and a session is created.

PRs

  • [x] https://github.com/vector-im/hydrogen-web/pull/1041 (upstream)
  • [x] https://github.com/vector-im/hydrogen-web/pull/1056 (upstream)
  • [x] https://github.com/Automattic/hydrogen-web/pull/11
  • [x] https://github.com/Automattic/hydrogen-web/pull/13
  • [x] https://github.com/Automattic/hydrogen-web/pull/14
  • [x] https://github.com/Automattic/hydrogen-web/pull/18
  • [x] https://github.com/Automattic/hydrogen-web/pull/19
  • [x] https://github.com/Automattic/chatrix/pull/214
  • [x] https://github.com/Automattic/chatrix/pull/216
  • [ ] https://github.com/Automattic/chatrix/pull/217
  • [ ] Only complete SSO flow in one of the blocks/popup on the page

akirk avatar Jan 18 '23 13:01 akirk