Hi, I’m using TiddlyWiki Classic, which is a file-based wiki that can be served by various servers and apps. Since I’m syncing it with ST, conflicts naturaly happen from time to time. I’d like the server I’m using with TW to detect such conflicts. What options do I have?
I’ve found the API which can be used for events polling (GET /rest/events — Syncthing documentation), but the response descriptioin doesn’t suggest that it’ll indicate if a change lead to a conflict. I can also see an endpoint to get folder errors (/rest/folder-errors-get.html), but the description doesn’t clarify if I can find conflicts this way, and what would be the check for an error to distinguish whether it is a conclict or another error (and if conflicts are considered as errors at all). Can anyone suggest where to look at to implement conflict detection (for a specific file)?
If you listen to file events, LocalIndexUpdated, you can see that it detects the conflict file after creating it – unless it’s ignored by ignore patterns. Otherwise no, there’s no specific event for conflicts.
It would be an idea to add a feature to notify when a conflict files created. I think it is very important. It is very easy to create a script to check for files with conflict name, but I would be much nicer if syncthing does it.
This is true. However, I think it could be reasonable to fire an event when we resolve a conflict. It could include a little bit more information than is possible to just glean from the resulting file name (e.g., more metadata about the two conflicting versions and which won and why).
That’s true. Of course Syncthing Tray is not necessarily running on the same host as Syncthing (like the official GUI) so if I’d ever come to implement a feature for detecting/resolving conflicts on GUI-wrapper-level I need to make its scope clear. Maybe it is also not the best to implement such a feature on GUI-wrapper level in general (as touching the filesystem is normally the concern of Syncthing itself).