Skip to content

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

@psrpinto

Description

@psrpinto

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions