Sometimes duplication of content from Obsidian Sync

This is a new post of something already reported because it contained reports of different issues.

Steps to reproduce

Note: the links go to discord and are only accessible for mods

These aren’t really steps to reproduce because it happens randomly.

I wrote Licat here how it happened. I included sync logs from both the phone and computer and how the note looked before and after the duplication happened. I don’t include them here because they are somewhat private.

My phone pushed a file I didn’t even have open today on the phone, my phone’s screen was off and Obsidian not open. And my phone was fully synced before I turned on my desktop before.
So my phone apparently uploaded an earlier version while Obsidian wasn’t running while I was editing the note in question on desktop.

Interestingly, it didn’t merge it but prepended an earlier version.
A version I never had on my phone because I had just created that note on desktop.

Ok, this is very interesting now. I had disabled all the battery saving features for Obsidian mobile on Android. The app was in the background (so it wasn’t completely closed) and when I just opened it it didn’t need to reload but was still on my daily note.
So Obsidian sync was running in the background on my phone. I think the last time I had obsi mobile in the foreground was at 10:11, that’s when the latest push from it was.
Therefore it received all the updates from desktop (see the mobile log) and erroneously merged the files, then pushed that version to desktop.

I only had Obsidian Sync running at that time, no other back-up or sync services.

This was Licat’s reply for my sync log.

What has happened according to Licat:

the file was downloaded, accepted, but then the next server push it was determined to be in conflict, which it normally shouldn’t if it was just downloaded

This is not a problem with daily notes (the automatic creation), but could also happen in them because they are normal notes.

Expected result

It doesn’t duplicate and merge notes which are created on one device, pushed, downloaded on another device (which doesn’t have that note open) and it does not push that older version from the phone (because the desktop version is edited at that time) back to the desktop, but only pushes to the phone.

Actual result

Sometimes, there is a duplication of content, shortly after the created file has been pushed on desktop and downloaded on the phone, which is then uploaded from the phone (although the version on desktop is newer because it is edited at that time) and then merged on the desktop.

Environment

  • Operating system: Manjaro Linux
  • Obsidian version: At the time it happened it could have been either 0.12.10 or the next mod version
  • Obsidian mobile version: 1.0.4

Additional information

My computer was connected via Ethernet, my phone via Wi-Fi and was about 1m away from the router. I’m wondering whether this could have something to do with latency/slightly different time on devices.

4 Likes

This is happening to me, and I can reproduce it 100% of the time.

I have sync turned on and I use Templater, with a default tempalate set.

  1. In file 1, I create a [[New Page 2]] link to a non-existing page.
  2. I cmd+click the [[New Page 2]] and a new page is created with the default template.
  3. If I do not edit the new “New Page 2” page, and wait until I get the green tick indicating sync is finished, nothing happens. But if I modify the page before the green tick is displayed, the original version of the page (just the page template) is added to the end of the file.

Here’s the sync log

I thought this might be a Templater issue, but it also happens at the file level.

When creating a new file, if I rename it before they sync is complete, a new file is created in the same directory called “Untitled”, and the new renamed file remains unchanged.

Screen Shot 2021-09-06 at 6.35.37 pm

Edit: This is using Obsidian on Mac OS

2 Likes

I am not as familiar with logs and such things but I have experienced similar behavior. I have had files that were present on my mobile device but not edited prepend or append to files that were edited on my desktop. This isn’t usually an issue because I only use Obsidian on my iPad one day of the week and use it on my Mac all of the other days. I would be happy to upload or research other considerations if you let me know what would be helpful. I just know this is an issue for me as well.

A post was split to a new topic: Duplication of notes with obsidian sync after moving notes

I also have a similar problem. My vault is synced between my Mac, iPhone, iPad and Linux laptop, all with Obsidian Sync active.

I start writing in a note on one machine while I had not touched the other ones for hours or days and in the middle of my writing the sync starts to insert/overwwrite/merge what I am writing a bit randomly with older version of the same note.

For me it makes Obsidian unusable because I can’t trust that what I am writing is not going to messed up in a few seconds… :frowning:

Does that happen with only Obsidian Sync activated or is there iCloud or something else in the mix?

Only Obsidian Sync, no iCloud.
Could it be the side effect of some community plugin ? Day Planner maybe ?

Since I disabled Daily Planner, I don’t have any sync problem anymore… Maybe that was the issue…

I’m not using Daily Planner but did have it installed. I whacked it but didn’t change anything for me. If I rename a folder on one workstation instead of renaming it on the sync store it deletes everything and then re-uploads it :man_facepalming:t2:

But it also occasionally replicates things from machines that were not online when I made a change. It screws up my links between documents and notes too because there are multiple copies of things and it’s driving me insane. I think I should stick to Resilio or Dropbox or something with a more mature sync component? This is the sort of thing that happens when people reinvent the wheel, sometimes they’re triangles.

Would it be possible to display an error message when this happens? Seems like Obsidian would know when it’s just saving both full versions in one file, so displaying an error at that time would be helpful. It’s very nerve-wracking to stumble on a bunch of files much later on with duplicated content. It’s impossible to determine which version is correct. I ended up just randomly choosing the second version, hoping that meant it was later. I had about three dozen files conflicted at once, so I’m pretty sure I lost some data.

Hello,

Unfortunately I just got the same issue: duplicate of note in different files ( older version reappearing in the file they were in the past) and duplicate note in the same note (older version reappearing above the new one )
I’m only using obsidian sync, I’m on windows 10 pro, got a chromebook and an android phone.

I just bought the yearly sync plan after a break of 2 weeks. I had the monthly plan and no issue at all before that.

A post was split to a new topic: iCloud duplicates