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

Trouble with multiple tabs #9

Open
cinnamon-bun opened this issue Oct 14, 2020 · 0 comments
Open

Trouble with multiple tabs #9

cinnamon-bun opened this issue Oct 14, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@cinnamon-bun
Copy link
Member

cinnamon-bun commented Oct 14, 2020

When Foyer is open in two tabs at the same time, both are writing to LocalStorage but neither is reading from it. This causes Problems.

We only load from LocalStorage to memory at startup and from that point we only write from memory to LocalStorage. Instead we need to keep LocalStorage and memory in sync with each other bidirectionally. It's like LocalStorage is a mini pub.

Luckily Earthstar data is easy to sync like this, but we may need to store each document as a separate LocalStorage item. However we also have some metadata that will be trickier to sync (list of workspaces and pub configuration).

Notes:

Temporary workarounds:

  • use a regular tab and a Private Browsing tab
  • use two different browsers
  • detect when running in a second tab and warn that changes are not permanent? Only sync to pubs but don't save to LocalStorage?
@cinnamon-bun cinnamon-bun added the bug Something isn't working label Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant