Obsidian Sync incorrectly duplicates sections of files

Yeah, the lack of communication from the app makes the problem a lot worse. There is a feature request for that: Obsidian Sync: Add a notification warning when Sync Merge with conflicts happens.

This seems to be at least sometimes true for me too. Obsidian Sync incorrectly duplicates sections of files - #73 by CawlinTeffid

2 Likes

5 posts were merged into an existing topic: Obsidian Sync: Conflict File generated but user has not independently modified on multiple devices

I’ve been facing this for well over twelve months. Before I found this thread, I had attributed them to a possible race condition with however the tasks plugin does its indexing, since I’ve only ever caught the issue when it screwed up my tasks.

For me, it typically injects a duplicate section of text that spans 1-2 lines within that same line. It looks very much like a git-diff gone wrong. If you imagine a diff of two lines with the highlight of the characters that are actually different between the two lines: it would inject the ā€œoldā€ line content (sometimes the whole line, but sometimes just part of it) from the point where the line started to be different, but it would usually still keep the new content. They’re definitely not edits I made, because they corrupt the task information.

There were no notifications of merge conflicts: like others in this thread, it seems that the sync process has treated a stale version of a file as if it was an update. But it seems to only happen on devices that open Obsidian less frequently.

I use Obsidian on my windows laptop (always open, the laptop sometimes sleeps) and my iPad (it has obsidian open 90% of the time, and I always make sure it has synced before I switch). If I stick to just those two where I use them both every day, I’ve had no issue. But if I open the vault from my iPhone or iPad mini, I get the corrupted lines, even though those devices have never modified those files.

I always made sure Obsidian has fully synced before I switch or close the app, that didn’t help. It did help if I remembered to open Obsidian every day on every single device. TBH I found I forgot too often so about twelve months ago I just stopped opening it on the iPhone or mini.

Possibly related: I have learned to wait for obsidian to sync after I create a file, particularly if it uses a template (eg a daily note). If I start typing in the file before sync has finished, Obsidian will add a duplicate of the entire original file (minus frontmatter, usually) at the bottom of the file.

Perhaps something is awry with the logic Sync uses to determine if a difference in file content is a legitimate update. It seems to be generating false positives.

3 Likes

Just chiming in to emphasize this, because I haven’t seen it acknowledged (I also reported it months or years ago!) As a rule, I DO NOT TOUCH any file from my phone except my one ā€œPhone notesā€ file, specifically because I’m now terrified of data loss. And yet all of these sync problems — I see it a few times a month — are attributed to a sync from my iPhone.

I just learned about the conflict file setting and turned that on, so hopefully that will easy my mind a bit.

1 Like

I’m furious right now. Sync just corrupted eight of my notes, including deleting a MASSIVE section of a note that I’ve been working on for the last week. I cannot believe the inaction of the devs on this. This is data loss, data corruption, a failure of the most basic thing I expect of this app, which is to STORE MY DATA. I’ve lost all trust in sync, and this has gone a long way to lose my trust in the app as a whole. I work in software, and, at least in my company, data integrity is an absolute top priority. If someone reported something like this, it would be all hands on deck to make it right for the paying customers.

I have the ā€œCreate conflict fileā€ setting on, but that didn’t help. There were no conflict files.

I spent my last 20 minutes scanning through the sync log and reverting all the files the most recent sync corrupted. God only knows how many more there are that I don’t know about…there is only so much I can investigate by hand. I’m at a lost. I love Obsidian, it’s integral to my daily work, but that just means that when it fails it’s a HUGE problem for me.

Now what? I’m definitely deleting obsidian on my iPhone, since that seems to be the source of the offending changes. Cancelling sync, because I can’t risk this continuing to happen. And then I hope Obsidian goes back to something I can depend on, just with degraded usefulness since I can only use one PC.

To anyone who, after enabling the new ā€œcreate conflict fileā€ option, experiences conflict files being created even when no editing has been done on multiple devices, please go here and provide the requested info.

@SMikula I am sorry to hear about your problems. I do think your have a different issue that the other people, because you are note even generating conflict files. I understand that you blame sync, but sometimes the problem is elsewhere, like in a plugin or in Obsidian itself that performs the deletion and then Sync propagates that action. So kindly open a separate bug report for you problem.