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 lost updates by using ETags for notes #692

Merged
merged 4 commits into from
Apr 19, 2021
Merged

Prevent lost updates by using ETags for notes #692

merged 4 commits into from
Apr 19, 2021

Conversation

korelstar
Copy link
Member

@korelstar korelstar commented Mar 12, 2021

Finally, I've implemented ETags for notes / If-Match HTTP header for the notes API. This fixes #56.

Includes:

  • API: expose the note's ETag and check note's ETag on update request (HTTP If-Match / 412) => new minor API version 1.2
  • documentation for API changes
  • Test cases
  • web-frontend: check for update conflicts and provide solutions

@stefan-niedermann @phedlund : Please have a look if you see any problems with these changes. They are downwards-compatible, so you don't need to change your implementation. However, it is strongly recommended in order to prevent lost updates. If you implement it, your implementation is still compatible with older (server) Notes app versions, since they just ignore the If-Match header.

@korelstar korelstar added this to the 4.1.0 milestone Mar 12, 2021
@korelstar korelstar added feature: API Related to the API for 3rd-party apps, i.e. Android or iOS feature: backend Related to the PHP backend feature: editor Related to generic parts of the editor, e.g. loading/saving notes enhancement New feature or request labels Mar 12, 2021
@korelstar korelstar force-pushed the conflicts branch 3 times, most recently from 7459068 to e608458 Compare April 2, 2021 14:15
@korelstar
Copy link
Member Author

Any feedback on this? Any plans to implement this in your apps @stefan-niedermann @phedlund?

Also cc @davidbannon since it is related to #621 and #627.

@stefan-niedermann
Copy link
Member

Yes, i would like to implement support for it, though i won't be able to make it in the next few weeks due to some other responsibilities and tasks i have to do. I also will probably need some help for the concrete implementation.

@korelstar
Copy link
Member Author

Okay that's fine. I think it would be good to finish your Room migration before starting with this, since this may require some DB changes. Of course, I can give some advises/help then. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature: API Related to the API for 3rd-party apps, i.e. Android or iOS feature: backend Related to the PHP backend feature: editor Related to generic parts of the editor, e.g. loading/saving notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manage concurrent edits of notes
2 participants