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

Use Web Locks API for ingestion #291

Open
sgwilym opened this issue Dec 14, 2022 · 0 comments
Open

Use Web Locks API for ingestion #291

sgwilym opened this issue Dec 14, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@sgwilym
Copy link
Contributor

sgwilym commented Dec 14, 2022

What's the problem you want solved?

If a replica for a single replica is opened from many processes (e.g. many tabs acting on the same IndexedDB), there's nothing to stop them from attempting concurrent ingestions to the replica. This could lead to invalid or conflicting data on the replica.

There is a local lock on the ingestion process, but this only works within the same process.

Is there a solution you'd like to recommend?

Use the Web Locks API to create locks shared between processes. This API is already supported in all browsers, Deno support isn't far off.

This is pretty critical for the Earthstar Desktop project.

@sgwilym sgwilym added the enhancement New feature or request label Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant