harika icon indicating copy to clipboard operation
harika copied to clipboard

Merging of conflicting edits after going online

Open dumblob opened this issue 3 years ago • 2 comments

Hi, this looks like something I am looking for for over 4 years now! A wiki-like offline-first mobile-first notes & pics & anything_visual taking app.

I wonder how you solve merge conflicts in case two devices (e.g. smartphones) went offline having both the very same revision of the DB data. Then on both devices you will make mutually incompatible - i.e. conflicting - edits (both independently changing the revision of the DB) and then both devices will turn online again (in arbitrary sequence).

Feel free to elaborate. Thanks!

dumblob avatar Jun 14 '22 12:06 dumblob

Hi!

Actually I am going to freeze my project for the better time 😓 I don't have enough time/money to keep working on it, and I got a job at Remnote.

I will be working on just random bag fixes, but no new features/improvements.

As for the merge conflict resolving — last write wins. But at also merge nodes for the same parent. Like:

Client 1:

- A
  - B
  - C
  - new: F

Client 2:

- A
  - B
  - C
  - new: D

After resolve they will be merged to:

- A
  - B
  - C
  - D
  - F

The worse case — if A was deleted on client 1, on client 2 it will be deleted too even if you are some new children. To avoid such case I was planning to add time travel, so you can travel to any state of the block note at a time.

quolpr avatar Jun 14 '22 13:06 quolpr

To avoid such case I was planning to add time travel, so you can travel to any state of the block note at a time.

Yep, if combined with an alert that there were conflicting writes, it should be enough for the beginning :wink:.

Feel free to close this issue as I myself do not plan to implement this support (also due to lack of time :cry:) or leave it open for potentially intersted devs.

dumblob avatar Jun 14 '22 19:06 dumblob