2.0 Conflict Changes

With the release of 2.0 it has introduced a slight problem with how we have used Syncthing for our application.

The application scans a folder for files ending with the extension .cfg and detects new cfg files in a folder that are generated and automatically processes them.

***From the 2.0 release notes.

“The handling of conflict resolution involving deleted files has changed. A delete can now be the winning outcome of conflict resolution, resulting in the deleted file being moved to a conflict copy.”

With the new conflict resolution method when a file is deleted (and deletion should be the correct condition for our situation) the conflict resolution now is to create a renamed file with the same .cfg extension.

This is causing the application to automatically read and process this new cfg file, however it should of been deleted.

Is there any possible way to either change the default extension of deleted conflicted files, or change it back to the previous way it was handled.

Thanks

I don’t think there’s a way in Syncthing 2.x to do what you’re asking for. Would setting folder.maxConflicts to zero solve this problem for your use case ( Syncthing Configuration — Syncthing v2.0.0 documentation ) ?

Thanks Chaos, thank is probably the best way to handle it at this time. and it did seem to work.

1 Like

Not sure if it is applicable here but what if you check if the filename contains

sync-conflict

which is typically added to conflicting files. You could filter them out while allowing conflicts in general if needed?

Hi Sektor2sync,

Thanks for the suggestion, I did try and filter out with exclusions for filenames, but that specific option did not seem to work. I guess it would be because the file is being created by Syncthing on a Deletion Conflict.

There is also a chance I did it incorrectly, but I could not get the filter to work.

If the application does not allow to filter filenames for a pattern then the following may work without modifying the syncthing configuration / conflict behavior:

  • Pause the folder in question via syncthing API before your app wants to process files

  • Execute this on the cfg folder to remove the unwanted files before processing them:

find /path_to_cfg_folder -type f -name ‘*sync-conflict*’ -delete

  • Do your app run / process the remaining files

  • Unpause the folder via syncthing API to allow new data to come in

Hope this helps

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.