How are conflicts handled (or not)?
I'm looking into using this project for keeping track of changes to a data structure stored centrally on a server in a database table. Only one version of this data structure will exist at any time, but all diffs leading up to the current one will be stored in a side table (used to reverting changes and revision logs). Clients may load the data structure at any time and modify it. When they save, their client will do a diff against the data structure they loaded and send the diffs back. In the meantime another client may have done something similar, so the current data structure on the server may have changed. This means the diffs may not be relevant (e.g. a diff may modify a row in an array which no longer exist).
Which leads to the question, how is this currently handled in this library?
Yes, this is a big topic, and I know how git works. I'm not asking what the best strategy should be, just how this library handles it when/if it occurs. Any other suggestions are welcome as well.
this is a big pending item, I would like to have configurable strategies, but at the moment when a conflict is found the resolution is last-wins unless it's not easy to solve automatically (eg. the branch doesn't exist anymore) and an error is thrown
this is a related ticket: https://github.com/benjamine/jsondiffpatch/issues/39 where a discussion happened about combining 2 deltas, that would be a solution to this problem. (nothing was done though unfortunately)
Thanks, this is very useful information.