chatrix
chatrix copied to clipboard
Allow simulatenous usage of multiple blocks on the same page
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:
- Make hydrogen support having the same session open in multiple clients
- Assign a different device id to each block
- 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