Editor: Add a toggle to disable automatic merging of changes (non-obsidian sync)

Is there any way to alter this behavior so Obsidian does not auto-merge them? I want to disable this (IMO) dangerous behavior.

image

edit: I found this in the 0.11.6 release notes, so that seems to be when it started:

When a change is made to a note on disk, but you also have changes in Obsidian that hasn’t been auto-saved (within 2 seconds), the two versions will now be merged automatically.

35 Likes

@WhiteNoise now that I know there is no way to disable this currently, can you please move this to Feature Requests?

1 Like

Perhaps a setting similar to the following would be best.

Merge Changes:

  • Automatically
  • User Confirmation Required (Perhaps with the ability to review changes before confirming.)
  • Never
4 Likes

I’m convinced this is being caused (or at least exacerbated) by Apple’s “magical” iCloud file abstraction / obfuscation or whatever you want to call it.

I think what’s happening is that file writes into the iCloud Drive location ~/Library/Mobile Documents/com~apple~CloudDocs/ are being intercepted by the OS, and managed/queued somehow before being committed milliseconds later. Obsidian is mis-interpreting this as a separate file change and thus data is getting duplicated.

We can’t do anything about Apple/iCloud so the only way forward I can see to mitigate this is (as @varian93 suggests) making it an option to either:

  • ignore these automatic merges
  • prompt the user before merging them

I just spent the last 3 hours trying to repro this by toggling on/off various plugins, quitting and launching Obsidian etc. I just can’t reproduce it reliably. It happens! I am not crazy. Again I am convinced it’s some wierdness with the filesystem / iCloud.

I am now again fearful of losing information that I’m putting into Obsidian. I have backups but it’s not enough, even losing 1-2 hours of work/research is really not nice.

@Licat I really hope you can make the automerge a toggle so we can work around whatever is doing this. :pray:

1 Like

I’ve been having this same thing occur. The pop-up happens so fast that I would often miss what it said. I kept noticing not all of what I’ve written would stay there (or it will have parts of what I’ve written duplicated). It would just disappear. Today was the first day that I noticed what it actually stated.

I will say that I’m working from a Windows laptop and I’m using sync. I’m not using any sort of other storage option like Dropbox/Google or such. If anyone needs further information about my settings, or computer information please let me know.

I also have the following plugins active: Calendar, Journey, Note Refractor, and Periodic Notes. Day Planner is on my system, but not turned on currently.

1 Like

I’ve also had the same thing happen to me. I also have Day Planner enabled.

This is killing me too – I don’t think I can use Obsidian in its current state anymore which is an issue since it has years of my knowledge-base and notes in it. My vault lives on a Box drive and recently auto-save has been creating sync conflicts resulting in duplicated files on my Box drive. To make matters worse, Obsidian is auto merging in outdated edits effectively wiping out data silently.

Does anyone know how to “downgrade” Obsidian to an earlier release? I’m curious if that would work since this behavior I’m observing is new.

1 Like

I am keeping my .md fiIes in my cloud storage (Box), I think that started to happen to me after the last update of Obsidian. I always get many copies of my workfile and delete the previous versions but this is highly tiring especially when you work with many files. Like each change in a file duplicates it. They need to find an urgent solution for it.

1 Like

This started happening to me recently. Glad to know it’s not unique to me. But still annoying. It’s forcing me to be a touch typist! Also glad to know it’s not just iCloud sync that’s causing this. So, come on, Obsidian, fix this!

1 Like

I just lost (fortunately only) one line of text due to a merge. It was a work task, so rather important. Only noticed it by chance, as I didn’t see any merger warning.

This is what happened:

  • Systems: MacOS and iOS, both latest versions of Obsidian and OS instaed

  • Sync: Obsidian Sync

  • Was working in a note on Mac. Then opened the file in Obsidian iOS and added some text.

  • When I opened the note in Obsidian Mac, it [edit: the line of text] was gone.

  • I don’t know if Obsidian on iOS wasn’t able to download the latest version from server before I started editing the note, or if I closed Obsidian on iOS too quickly before it could upload the change

Sync log showed the merger of the file, but it wasn’t merged, my line of text was simply deleted.
Not knowing if some of my text might get deleted behind the scenes without me being notified of it causes me some trust issues.
Some kind of sync conflict warning as proposed by @luckman212 in @EleanorKonik’s feature request would be really helpful :+1:

1 Like

I’m also getting this, and it’s the one really big problem I have with Obsidian. I hope it’s the top priority for the team – I can’t imagine anything more important that your customers losing their data, as we are.

The merge is really unreliable – it may merge perfectly or it may wipe overwrite with an old version. I’ve also had “modified externally” messages pop up, where a file is overwritten by an old version, for no apparent reason.

I’m using Obsidian Sync between Android and two Windows devices (and I don’t have any other kind of sync on my vault).

I don’t mind doing a manual diff check (preferably with an in-app tool). Just don’t throw away my work without telling me!

1 Like

+1 for this problem!

Text keeps disappearing from my notes as I type them due to this automatic merging of changes! It’s horrible!

The problem started with the latest version of Obsidian. Previously everything was working fine.

I’m also using iCloud to store and sync my vault between my Windows machines and my iPad. When this error happens iCloud bugs out and I cannot start up Obsidian anymore. Also I notice a bunch of copies of my notes (indicated by numbers like Note; Note(1); Note(2)) in my iCloud drive. This prevents Obsidian from starting up again because indexing never finishes.

I have to manually delete copies of those files and then Obsidian stars up again.

Devs, please look into this!

Both posts (March, November) fingering the latest version. I don’t think it can be the same latest version.
The sync providers mentioned are iCloud, Box and Sync.

Some of the problems may be purely down to the sync service. If it reverts the underlying file, what would you suggest Obsidian do? Overwrite when it finally saves, or save current version as copy2? This is the case whether autosave is functioning or not, since turning autosave off simply defers the issue to the save at the end.

afaics, Obsidian’s only options are merge, overwrite, lose the edit or create a second copy.

Personally, I want Obsidian watching and updating the file because I might well edit a file it has open in another program. All the programs I use work this way. And I see no evidence that autosave is producing widespread problems - there would be far more problems reported if that were so.

I disagree with this. An editor should never yank the words you’re typing right out from under you. If you feel that is the best option, fine—all I am asking for is a toggle to control the behavior. If 98% of people prefer to just accept whatever the merge algorithm thinks is best and never be bothered, that’s fine. But for the other 2% (which could be thousands of users) what’s the harm in allowing them to get a prompt:

The file has been changed externally.
What would you like to do?

[ ] Keep Obsidianʼs Version
[x] Merge Changes
[ ] Keep External Version
[ ] Keep Both (copy)

OK, how many problems would you like to see before you “see evidence” ? This thread alone has 600+ views, and 8 other users commenting that they’re having the same problem. Anyone in software/QA knows that only ~1% of users bother to report bugs. I ran a quick search and easily came up with 5 more threads in addition to this one… not enough??

No. Most of the threads are about sync problems, and many do have issues with their sync services.
Autosave is different.

I guess it’s worth noting that I dislike the opinionated merge behavior of Sync (in all of its various permutations) so much that it’s the primary reason I don’t use Sync, to the point where I literally won’t buy an iPad even though people rave about it so much, because I couldn’t use Obsidian on it, because of how strongly I prefer Dropbox’s conflict resolution behavior of “making a new file.”

I don’t talk about it much because I told Licat that way back during the early part of mobile beta and I assume he has his reasons (I know a lot of people prefer this method!), but I just want to note that @luckman212 is not alone in finding this frustrating.

3 Likes

afaics from the reports, Dropbox just works better with Obsidian than iCloud and Box (which has more issues reported than I would have expected).

One of the problems with the number of threads on sync problems is a lack of clarity about exactly what the problem is and where it arises.
There are race conditions, idiosyncratic and unpredictable sync services, save and autosave. Potential of conflicts, vaults not opening and files disappearing. I’ve seen complaints about file duplication, file loss, data deletion (as above) and data duplication. I suspect that no algorithm change will cope satisfactorily with a sync service that simply doesn’t play nicely with Obsidian vaults.
I never have a problem with toggles, though I can see why Licat might have. Here, I can see the one mentioned above, but also a toggle about autosave on/off/frequency (I make the assumption that the file changes described above are caused at autosave - presumably Obsidian isn’t watching the file more closely?).

1 Like

Thank you for your reply. I’m not passing blame on anyone, I was just frustrated last night.

Anyway, I think you might be right. This might be my error since I left Obsidian open on two different PCs. That might’ve caused errors, or it could be down to iCloud’s bad conflict resolution.

I’ve switched over to Google Drive for now, and will see how it behaves in the future. Sometimes I do forget to close programs on one of my PCs and I generally don’t shut down but rather put them on sleep. Seems like one of them woke up and caused conflicts for me…

I don’t know it was your error, what you did was normal, and ought not to have caused problems. But I tuen my computers off far more often now than I used to; easier than having to deal with things.

With Google Drive I’d caution against allowing streaming, since that seems to be a source of sync errors with Obsidian.