conflicted file - how to use it ?

Hallo,

I have being using syncthing for some short duration, but i have never know how to ultilize “filename.sync-conflict-20210507-080621-CEIVOCO.txt” the conflict file created by syncthing. The main thing is the data file that i have being sync by syncthing is so long , that i won’t know where is the conflict… I just let it take its course… Hence after sometime i realize, some missing data… I swear i have it in the data file, but now it is gone…

The question is, How you suppose to use the conflicted file, when i have got several thousand of lines in the file. Please share with me how you suppose to ultilize the conflicted file to know whether the current file has the most recent data that i want it to be or the conflict file is the one that contain most recent data ?
Are you suppose to use compare software to compare the differences ? I am at a lost here… i have 4 conflicted file, which i have no idea how to check with the current file.

Please help

Each Syncthing device has a unique ID. You can see it in Menü “Actions” - View ID

If Syncthing detects a problem it adds .sync-conflict-<DATE>-<TIME>-<ID> to the file name. This happens to prevent important data from being overwritten. <ID> in the file name is the first part of the device ID that was involved in the conflict.

You need to view the filename.txt on both devices to see what is different.

Sorry, i don’t get you. By saying :

You are implying that the conflicting data in between the 2 devices remain on the 2 devices… they don’t get sync… but i have being letting them generate conflict for some time already (because i don’t know how to use the data)

I was trying to use software to compare the 2 files to see where change… but didn’t manage to that, because the amount of data in it…

Is there a video showing how to deal with the conflicting situation on youtube or somewhere i can watch to understand how… ?

Thanks

OK, i have check my android phone that has id “CEIVOCO”… what does this mean then ? does it means this file below being overwritten (that’s why it is kept as this filename as backup) or what ?

filename.sync-conflict-20210507-080621-CEIVOCO.txt

After the generation of this conflict file, does it not mean both devices has a synced data already ? What i think is: If 2 files being noticed different and both were modified , it will keep the latest modified file in the both devices (synced), but kept the older modified file as a backup as a conflict file. Am i right about how this syncthing works ?

Example with 3 devices: A (ID: AAAAA), B (ID: BBBBB) and C (ID: CCCCC)
All devices share folder with file.txt in it.

Scenario: the file is changed on two devices at the same time and because Syncthing cannot solve this problem (= which is the correct data) it will create a file with sync-conflict-date-time in the filename. To inform you which device was the involved it will also add ID, e.g BBBBB.

Syncthing never overwrites anything unless it is certain that it has the correct data.

Vou can try Notepad++, it has a compare plugin but I don’t know if it works with large files. If you have Linux available, try the diff command

I still got uncertainty.

You said syncthing can’t resolve which is the correct data (maybe both were the correct data , just each has differet section of newly entered correct data). And because of that, you said syncthing will create a conflict file specifying date., time and device ID.

BUT it only specify 1 device id… i mean when a conflict happened, there is always 2 devices… howcome it specified only 1 device id ? should be 2 right ?

and What does that Device ID provided able to do any good ?

Also, where is the “newly added data” from device “a” and device “b” ? since there is only 1 generated file .

Then again the file that is now in device a and device b (after synced)… which is it originally belong to ?

There is a device B, but we don’t record that. Also, at the point the conflict is observed, the file might have propagated to multiple peers, at which point B becomes somewhat complicated, as it might not be B directly, it might be some other device that is just announcing B’s changes.

:dizzy_face: I still can’t get it. I only have 3 devices that synced with syncthing. I constantly believe i am loosing data… because i know i entered such data before, but after sometime i just can’t locate it anymore. I am using vim for data entering… It has got great search feature, still i can’t find the data i intended to look up. And i have 4 conflicted files of a same data file, which i don’t know how to use to locate the missing data…

Do you have any video explaining why and how to do when conflict happened ? so that do not lose any entered data ?

A conflict is just a copy of the file, as it was modified by some other device, I am not sure what you don’t understand.

This is pretty much the same as git conflicts in nature.

I see, it is just a copy of modified file.

However both devices has got a file (of the same name) on each, and each has a new portion of data entered that each opposite device does not have. So, the “copy of the file” when conflict is which file ? the file in device a or the file in device b ?

The copy/conflict will be the file with older modification timestamp, but even that is not always deterministic (what if the timestamps are identical etc), but I am not sure why you think it matters. You should avoid concurrent modifications/gaps in connectivity that lead to concurrent modifications.

The same timestamp might happened. or maybe. I often forgot to save in vim on laptop and edit in handphone vim or vice versa… hence problem occured. So you said the conflict file generated will always be the older modification timestamp ?! that means the newer one will in in sync on all devices… am i right ? I have 4 sync conflict file generated already. How should i go about checking which data missed out ? comparing the 1 conflict file with 2nd , then 2nd to 3rd and so forth. or compare the 1 conflict file with the file that all devices are currently syncthing… ?

I don’t know, its your files, you need to figure out what to check in them.

It’s not that syncthing has any intelligence into the files and whats changing in them, it just saw concurrent modifications a few times and created copies.

The copies have a timestamp attached to them when they happen, but its for you to decide what to compare with what.

For the record, I would suggest to try some graphical utilities to compare those files. All the differences will be marked nicely with different colours. I have personally used KDiff3 (cross-platform) and WinMerge (Windows-only). Both are free and open source, and also offer merging capabilities in case you need them (although I personally use them only for comparing differences).

Thank you. I will try Kdiff3 since i m on arch.

I have this fear that it is hard to use the software to compare, because i am constantly add info into the file (not append) but anyway of the file, which means the existing data will get pushed down and down… Does Kdiff3 recogninze the data (between the 2 files) that just being pushed down lower as same data ? or will kdiff3 think this is another “difference” between the 2 conflicted files ?

If the same chunk of data being pushed to lower line number is consider modified data, than that will be not much help…

It should recognise such data as moved, but you really need to test it yourself to be sure, as everything will be dependent on how the file is structured.

1 Like

Andrew, this is, in my opinion, the most important piece of advice in the entire thread. Good luck!

Yes, i tried to avoid it… But sometime it just happened… forgot to quit on one device and it synced… … when it sees network.