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

Prevent concurrent session access in browsers/scenarios where no service worker is available #188

Open
bwindels opened this issue Nov 6, 2020 · 2 comments
Labels
feature New feature or request

Comments

@bwindels
Copy link
Contributor

bwindels commented Nov 6, 2020

(At least) on IE11 or local development, we don't have a service worker. Currently, we route the request to close the session id we are about to open in other tabs through it, so this doesn't work without a service worker.

We should provide a fallback, as concurrent access will likely corrupt your database:

  • use a broadcastchannel if available (we can't always use this in favor of a service worker as safari does not support broadcast channels)
  • poll a sessionstorage key as last resort (at 10Hz or something?), there is also a storage event but unclear how well that is supported in IE11.

we should not expose the serviceworkerhandler to the storage factory, but rather an abstraction that can fit the above fallbacks as well.

@bwindels bwindels added the feature New feature or request label Nov 6, 2020
@bwindels
Copy link
Contributor Author

bwindels commented Nov 6, 2020

Perhaps once this is done, we could consider finishing and merging bwindels/outbound-megolm-session-in-memory

@bwindels
Copy link
Contributor Author

bwindels commented Nov 6, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant