Martchus / syncthingtray

Tray application and Dolphin/Plasma integration for Syncthing
https://martchus.github.io/syncthingtray/
Other
1.54k stars 43 forks source link

How does syncthingtray detect conflicts? How should conflicts be resolved? #201

Closed murazi closed 10 months ago

murazi commented 10 months ago

Is your feature request specific to a certain platform/environment? Please specify. Windows 10

Is your feature request related to a problem? Please describe. For some conflicting files, I found that syncthingtray never synchronized, so it reminded me of the conflict resolution of SyncTrayzor that I used before. Although it required manual operation, it was able to solve my conflict problem.

Martchus commented 10 months ago

How does syncthingtray detect conflicts?

It does not detect conflicts at all because it is just a frontend and platform integration. The backend (Syncthing itself) deals with your files and that includes handling conflicts.

How should conflicts be resolved?

Checkout the documentation of Syncthing itself. I personally usually just rename the conflict file back or remove it depending on what version I want to keep. Sometimes it is also required to do more sophisticated resolving where tools like diff can help.

Note that there's issue #140 about integrating conflict handling on frontend-level but I personally believe this should be done by the backend and Syncthing's official GUI. So if you're missing any features I suggest you file an issue or create a PR directly on https://github.com/syncthing/syncthing. This way all users of Syncthing could benefit from this feature, the frontend wouldn't weirdly do things that belong to the backend and it would also work when connecting to a remote instance of Syncthing (e.g. running on some server)¹.

For some conflicting files, I found that syncthingtray never synchronized, so it reminded me of the conflict resolution of SyncTrayzor that I used before. Although it required manual operation, it was able to solve my conflict problem.

Note that Syncthing Tray is just a frontend. The whole synchronization and creation of conflict files is done by the backend.


The only thing I would implement on Syncthing Tray level is a notification about conflicts - but only if there's a nice API provided by the backend that can be used (to avoid putting too much logic in the frontend where it doesn't belong and would likely also be inefficient). I guess that might already be the case, I need to follow-up on https://github.com/Martchus/syncthingtray/issues/140#issuecomment-1464964378 and handle it within this existing ticket.


If that answers all your question I think this ticket can be closed.


¹ Considering that conflict files are actually synced between devices (last paragraph of linked documentation section) resolving the conflict locally on one device will of course also affect remove devices. This wouldn't help though if a conflict occurs on your server which you're using Syncthing Tray with in a folder that is not also shared with your local Syncthing device.

murazi commented 10 months ago

Unfortunately, I don’t understand the mechanism of syncthing very well. Thank you very much for your detailed answer, because currently file synchronization is ignored when there is a conflict. The syncthing tray is an ideal client regardless of conflicts. I look forward to this. Things will have better solutions in the future, thank you for your creative work~