Skip to content

Prevent lost updates by using ETags for notes#692

Merged
korelstar merged 4 commits into
masterfrom
conflicts
Apr 19, 2021
Merged

Prevent lost updates by using ETags for notes#692
korelstar merged 4 commits into
masterfrom
conflicts

Conversation

@korelstar

@korelstar korelstar commented Mar 12, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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