You are here

sync conflicts -- both files are changed

4 posts / 0 new
Last post
johnviku
Offline
Last seen: 12 years 2 months ago
Joined: 2012-04-12 11:52
sync conflicts -- both files are changed

i am familiar with a problem with syncing that i encountered in syncing i have had to do myself in the past.

Sorry if the answer to this question is already somewhere, but i couldnt find it. I searched for "sync conflict" and "both changed"

Let me give you two related scenarios.

1. file.txt is synced. on local c: disk and a shared backup drive. I and another person are on two different computers. I am editing my local copy, and he is editing the copy on the shared drive. What happens.

2. file.txt is synced on my local c: drive and a shared backup drive. The local c drive is on a laptop. I edit file.txt while i am away with my laptop and the shared backup drive is not accessible.

2.a. what happens when i get back?

2.b. while i am away, another person edits the copy on the shared backup drive. what happens when i get back?

Thanks!

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 10 years 10 months ago
Developer
Joined: 2005-12-10 15:22
Sorry

for taking so long to reply, I am in the middle of a set of exams at the moment which are severely limiting the time I can spend programming.

In answer to your questions I really depends on exactly which mode you use, assuming you mean differential then it will take the most recently edited version, Toucan simply doesn't have any sort of merging capability.

johnviku
Offline
Last seen: 12 years 2 months ago
Joined: 2012-04-12 11:52
re: both files changed

yes i think i mean differential version.

So, clearly, this appears to be a hole in the methodology, because in both cases edits will be lost. This case is not an obvious one, but many people will encounter it eventually while using Toucan ( or any file sync program ). It's not something ordinary users who are inexperienced with this space will think of ahead of time, so they might not check how the program handles the situation. Then they will find out later that their edits have been lost.

To detect this situation you can't simply compare dates of the 2 files. You need to remember the dates you sync'd last time in some database somewhere. I realize that's extra complexity. Then you need to detect that both changed. The easiest thing to do in this case is to alert the user as to the conflict, or record the conflict in a log file and keep both versions of the file, perhaps with one renamed as file.txt.toucan_preventing_lost_edits or something appropriate.

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 10 years 10 months ago
Developer
Joined: 2005-12-10 15:22
I

definitely agree that it is a problem! The tricky bit is storing everything in a database in a way that makes sense as you move Toucan between computers, it is certainly something I am thinking about for future version though. Probably initially there will be a confirmation dialog of some sort when you have a file in both the source and destination with different modified timestamps.

Log in or register to post comments