React with C++: Building the Quip Mac and Windows Apps
medium.comAs users are editing a doc, do you send diffs? What diff algorithm do you use? What's your logic like for merging changes and handling conflicts?
Our documents are broken into lots of smaller components we call sections. So, in a billeted lost, each list item is its own section.
Sections have a GUID and can be modified without touching any of the other parts of the document. This is useful in that it minimizes most common merge conflicts - they only happen of people edit the same sentence or spreadsheet cell while offline, but simultaneous edits of the same doc generally don't result in the need for any merge algorithm.
For offline edits of the same section, we use a fairly standard three way merge algorithm. Then, we show the edits we chose in the left hand side of the doc with the conversation along with a "Revert" button so you (the end user) can revert if our algorithm was wrong.
Already using Quip for Mac, loving it. Great job.