Commit graph

3 commits

Author SHA1 Message Date
Alexis Métaireau
9071d92986 chore: ensure merge + assigning ids are rejected
The current code already ensures that items
changed in the reference weren't also changed
in the latest changes, so we are covered.
2024-03-08 18:01:58 +01:00
Yohan Boniface
bc8084af97 fix: replace list.delete call by the proper remove method 2024-01-25 15:49:01 +01:00
Alexis Métaireau
f37ed700f6 [feat] add a simple conflict resolution mecanism.
The server tries to merge conflicting saves of
the same layer.

What it does:

- use the `If-Unmodified-Since` header to check
  if changes happened to the stored data ;
- Compare the incoming version with its reference version
  to get a diff.
- Reapply the diff on top of the latest version.
- If the merge is not possible, return a
  "422 Conflict" HTTP response.
- If the merge worked, return the merged document,
  to be updated by the client.
2023-11-29 13:04:24 +01:00