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

Have the same session open in multiple windows/tabs/iframes simultaneously #1045

Open
10 of 16 tasks
psrpinto opened this issue Mar 2, 2023 · 1 comment
Open
10 of 16 tasks

Comments

@psrpinto
Copy link
Contributor

psrpinto commented Mar 2, 2023

Is your feature request related to a problem? Please describe.
I would like to be able to have the same session open in multiple Hydrogen windows/tabs/iframes. Currently opening one tab with a session that is already open in another tab, results in the session being closed in the first tab. I would like for that not to happen, and to have Hydrogen fully functional with the same session in multiple simultaneous windows/tabs/iframes.

Describe the solution you'd like
I've written a proposal to address this issue in #1041. Please see proposal for details (in short, sync would run in a worker).

Describe alternatives you've considered
Please see #1041 for details on this.

PRs

TODO

  • Merge Proposal: Sync in worker #1041
  • Make sure build system can handle module workers
  • SyncProxy
    • Extract an ISync interface from Sync so there can be multiple implementations of Sync. This interface should define the public API of Sync.
    • Add a SyncProxy which implements ISync (its methods won't be implemented yet)
    • Create feature flag for same session in multiple tabs
    • When the feature flag is enabled, instantiate SyncProxy instead of Sync
    • Implement all methods of ISync in SyncProxy
  • Enable typescript checks on sync-worker.ts
  • Make it possible to set the name of the SharedWorker
  • Iterate on SyncWorker + SyncProxy
    • Implement Worker abstractions that would facilitate creating workers, communication between workers and main thread, etc.
    • ... WIP
  • ... WIP

Maybe later

  • Rename Olm worker from main.js to olm-worker.js. Since we'll now have more than one worker in the codebase, having the Olm worker named main.js would be confusing. So we'll have an olm-worker.js, a sync-worker.js, etc.
@psrpinto
Copy link
Contributor Author

psrpinto commented Mar 2, 2023

Related to #188

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

1 participant