Hello,
I am using Obsidian and Obsidian Sync since December. I have successfully migrated all my notes from Notion. After a while, I noticed that a few of my notes are empty (the files have 0 bytes in size). Firstly, I thought that I made some mistake or that it is an issue with some community plugin, but then I realized that is not the case.
I cannot fully reproduce the issue, but it is still occasionally happening, and I was able to track it down a bit.
It is happening every time I move or rename dozens of individual notes or just rename a folder with dozens of notes. The desktop app works fine, but the mobile app will happily overwrite some of the notes by uploading the same file with 0 bytes in size instead of downloading the file from the Obsidian Sync server.
Steps to reproduce
I am 100% sure that if I rename my “notes” folder with ~500 notes to “notes2” in my Obsidian desktop app and then open the Obsidian app on my Android phone, a few of the notes (~5) will be empty.
Expected result
Obsidian sync will properly sync my notes across multiple devices.
Actual result
Obsidian sync in mobile app randomly upload the same note with 0 bytes in size instead of downloading the note from Obsidian sync server.
Environment
Obsidian desktop app: v1.7.7 on my Arch Linux
Obsidian mobile app: v1.7.7 on my Android 13, Samsung S20+
The same happened on my Samsung Tab S7 without any community plugins.
Additional information
Please see the screenshot – the “upload complete” files are causing the issue. I did not make any changes on my mobile device, and the Obsidian app was closed (and killed). It should download the changed/moved notes instead of uploading empty files back.
Now, I am running find . -type f -empty
every day in my Obsidian folder to see if there are any empty notes to prevent losing data.
I don’t think obsidian overwrites your notes with empty version.
What is more likely to have happened is that you moved a directory, which means multiple files are deleted and recreated somewhere else. Between the deletion and recreation, you clicked on a link and that action created an empty note with that title.
“Moved a directory, which means multiple files are deleted and recreated somewhere else.”
– That is correct.
“Between the deletion and recreation, you clicked on a link …”
– That is not true.
Let me rephrase it again:
- I moved a directory in Obsidian Desktop and waited for sync to catch up → no issues here.
- I opened the Obsidian mobile app and just swiped to pop up the sync log → waited for ~2 minutes as a lot of files had been downloaded again, and in the end, a few of them were overwritten by uploading the same file name in the same directory (the new one) but with 0 bytes in size. These files had never been opened in my Obsidian mobile app before.
What is your suggestion for providing you with more information?
I experience what is likely the same bug. If I create multiple files on desktop, then open my Android app, it downloads all files and then re-uploads one or more of them as empty.
I have not tried to reproduce by renaming an existing folder with many notes, but everything else @fialakarel describes fits exactly what I see.
In case it helps, I have Templater installed and set up to apply a template for all new notes. The “empty” files that are re-uploaded are in fact not empty, but have this template applied (even when this template was not originally present in the desktop file). So it seems that Templater thinks these (empty) files are newly created in the mobile app, and applies the template before Obsidian syncs them.
I can also note that I have experienced this bug for a long time.
Such “hidden” data loss is fairly critical, so I hope this can be prioritized.
Actually, this (at least for my case) may be a Templater bug. Having Templater enabled on Android seems to be a prerequisite for this bug happening. It happens regardless of Templater’s “Enable folder templates” setting - that only controls what the “empty” file will contain: If disabled, it’s truly empty. If enabled, it contains the relevant template.
yes, I forget to ask the OP about plugins. This may be an issue with templater modifying the notes as they are created.