Cache file format causes conflicts with cloud syncing services

Steps to reproduce

  1. Sync a vault over iCloud of OneDrive
  2. Open the vault using Obsidian on two computers connected to the syncing service
  3. Make an edit on each computer that can change the cache file (e.g. add a note, update links, etc)

Expected result

No observable effect. The .obsidian directory only contains Obsidian-created files.

Actual result

The next time the cloud service syncs, notice that there will be a duplicate version of the cache file in ./.obsidian/cache (OneDrive will display a warning on a Windows computer that the “file cannot be merged”).

Environment

  • Operating system: Windows, macOS
  • Obsidian version: 0.6.4
  • Using custom CSS: No

To fix this, Obsidian could provide the cache file in a text merge-friendly format (e.g. include line breaks) and clean up unexpected files in the .obisidian folder.

2 Likes

I’ve run into this too, I like to have my text editor open on multiple computers at once so this is a deal breaker for me :frowning: I hope to see some traction on this soon.

AS long as you don’t edit the same file at the same time, it should be ok.
there can be conflicted copies of .obsidian/cache but that should not create problems.

It’s not an issue of having .obsidian/cache merge friendly or not.

Perhaps a solution could be Obsidian cleaning up files it doesn’t expect in ./.obsidian? Alternately it could add line breaks so that sync services don’t just give up when the files conflict (and Obsidian could simply recreate the file if there was a botched merge).

I find myself editing the same file on multiple computers relatively often and each copy of the cache file is around half a megabyte. If I touch the daily note a couple times a day on each computer I can add a megabyte or two each day (although, I’ll admit this isn’t a terribly fast rate of growth).

The cache file location should be configurable.

That way the cache can be stored in a path that is not synced, eg ~/.local/share/obsidian/some-hash-cache.json on Linux.

7 Likes

This is also bothering me a bit. In my case, I’m using Dropbox. +1 theduke’s suggestion! That would be great.

1 Like

I have started using ‘Autosync’ on Android to synchronise my notes to my phone, it has an option to ignore hidden folders so I don’t get the conflict anymore. Since everything in the .obsidian folder isn’t relevant on my phone this works well so far.

we moved the cache out of the vault in 0.8.8