matrix-org / matrix-org/patience

Hydrogen service worker confuses multiple client instances

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
21
Forks
3
PR merge metrics
No merged PRs in 30d

Description

The Hydrogen service worker causes general confusion when running multiple instances at the same time like Patience does, since all instances hear what the others are doing.

We'll need to do at least one of:

  • Isolate each client on its own domain (blocks direct window access)
  • Run a modified Hydrogen instance with service workers disabled
  • Craft some hack to make it seem like the browser doesn't support service workers

We are already attempting the hack approach:

https://github.com/matrix-org/patience/blob/a255dcea0adc4c98aab8948697efd43e40e13929/core/api/adapters/hydrogen.ts#L155-L170

...but it seems to only work in Firefox. Recent Chrome appears to run the frame's document before the hack has a chance to mess with things.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core/api/adapters/hydrogen.ts around lines 155-170 and reproduce multiple Hydrogen client instances in Chrome and Firefox. Determine which isolation approach reliably prevents instances from hearing one another, then verify that behavior across both browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.