-
Notifications
You must be signed in to change notification settings - Fork 1
Description
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
- Proposal: Sync in worker element-hq/hydrogen-web#1041 (upstream)
- Sync worker: kickoff element-hq/hydrogen-web#1056 (upstream)
- Sync worker kickoff hydrogen-web#11
- Communication between main thread and sync worker hydrogen-web#13
- Run sync in worker hydrogen-web#14
- Broadcast session and room changes from sync worker (no encryption yet) hydrogen-web#18
- Don't prevent concurrent session access when running sync in a worker hydrogen-web#19
- Allow multiple Chatrix blocks on the same page or on different browser tabs #214
- Release 0.8.0 #216
- Correctly remember last url when multiple blocks are on the same page #217
- Only complete SSO flow in one of the blocks/popup on the page