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

ETag system for protection of changes in concurrent editing scenarios #420

Open
christianlupus opened this issue Dec 2, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@christianlupus
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently, if the app is opened in multiple devices/browsers, all have their local storage. Changes can be made but are of course not propagated to other devices.
Changes made by device A can be overwritten by changes made on device B if B is saved after A was saved.

Describe the solution you'd like
There should be an ETag (a hash sum of the recipe's data) that is to be transmitted to the frontend and be returned 1:1 to the backend. If concurrent changes have happened the ETag on the server has changed so the new changes (made by B in the example above) will be rejected by the backend.

The exact structure of the error resolution needs to be defined.

Describe alternatives you've considered
Hard locking of recipes but this contradicts the REST principles.

@christianlupus christianlupus added the enhancement New feature or request label Dec 2, 2020
@seyfeb
Copy link
Collaborator

seyfeb commented Dec 2, 2020

The user updating the recipe on device B could be informed that changes have been done by someone else (different device, user, ...) and can decide to overwrite these changes anyway. Errors can be easily recovered once the versioning system (#364, #340) was implemented.

The ETag / hash could be the same used in the versioning system.

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

2 participants