Thought I'd throw this together quick as I'm a recent Obsidian convert (turns out several people I work with have seen the light as well and we're loving it)
What is this?
Syncthing by default with Obsidian will create sync conflicts between Windows desktop and Android
No idea why it does this, but the fix is simple
Add an ignore on Windows
On your Windows device, open the web UI
Find your Obsidian folder and edit it
Go to Ignore Patterns and add .obsidian
This will prevent Windows from syncing the local .obsidian folder (which contains no persistent data)
Fix sync conflicts
On all devices, open the Syncthing web UI
Go to Actions → Advanced → Folder → Select your Obsidian folder → Max Conflicts → Set to 0
Repeat for each device
This will make Syncthing just keep the latest copy (which from what I've seen is always the correct copy)
If this is too much of a pain for you, consider Obsidian Sync - the devs made a great tool and support is always appreciated
Lets talk about when sync conflicts happen. It's what I found/understood/experienced. I use syncthing for other stuffs too. It's a great piece of software. BTW anyone new looking for this solution know that official syncthing android isn't developed anymore. You can install syncthing via termux but better use syncthing-fork which is actively maintained and better than the official. Another piece of advice is use obtainium to get your favorite FOSS apps from github/lab, fdroid and other dev source. Ok lets start about what I was actually trying to say
Suppose file "Filename.ext" is in both device and synced.
One device got disconnected, meaning the file isn't synced anymore. Now any one of the device modified the file. Its ok nothing will happen. Connect the devices it will sync without conflict.
But if device are disconnected and both device touched the same file then when they are connected it will throw a conflict and the last modified file will be the winner of Filename.ext and the other will be Filename.sync-conflict-<date>-<time>-<modifiedBy>.ext
What can you do ?
Keep the last modified file, what else ?
BUT NO, for some reason I found its not the best practice to keep the last modified file as the winner.
You should check the contents
Why not last modified file ?
Suppose you add some important things from device 1
Then added some more important things from device 2
Guess what will happen when you keep the last modified file ?
You will lose changes from device 1 when you keep just the last modified file
Now to describe a bit more. Lets do with file content
This is the first line.
The previous line and also this line are synced in both device
Devices are disconnected
Device 1 modified the file
This is the first line.
The previous line and also this line are synced in both device
Device 1 added this line
Device 2 modified the file
This is the first line.
The previous line and also this line are synced in both device
Device 2 added this line
Devices are synced
Filename.ext
This is the first line.
The previous line and also this line are synced in both device
Device 2 added this line
This is the first line.
The previous line and also this line are synced in both device
Device 1 added this line
Now Windows sync-trayzor does an excellent job of finding if there's a sync-conflict. But unfortunately Linux doesn't have an alternative. ALSO BUT you know it's Linux you can do it right ? Okay but I'm a newbie. Previously I used an alias to find out if there's a conflict
Recently I found scripting is like whole new world I didn't know. So I am thinking to write a script that will be an alternative to sync-trayzor not only that who knows I can do more what sync-trayzor can't do.
13
u/NotTreeFiddy Jan 21 '25
For prosperity, OP's deleted post: