Sync does not handle Case Differences in Path/Filename (Rename deleting files during sync)

We strongly recommend you to search the forum with possible keywords before submitting a new bug report. Please also try your repro steps with third-party plugins and custom CSS disabled and see if it’s still reproducible. If it’s an issue with third-party plugins or themes, try contacting the author for help. Once you’ve done the above, delete this line.

Steps to reproduce

I’m not sure what the steps to reproduce are exactly, but it’s something along these lines:

  1. Install obsidian and connect to the same vault using sync on a couple of laptops and an iphone
  2. Insert a large directory of files - call it “Notes”
  3. Add some files to that directory
  4. Rename the directory to “notes”
  5. Add some files to the “notes” directory

Expected result

Obisidian continues to show all the files created in “Notes” or “notes” under the “notes” directory.

Actual result

Obsidian sync renamed “Notes” back to “notes” and many of the files I had created in “notes” were deleted. I have my obsidian directory under source control on one of my computers, otherwise I might not have noticed as the files disappeared after the rename.
There are also some directories that Obisidian repeatedly deletes even though I keep adding them back. I’m trying to do a bulk restore now, but there’s a huge list of files - some legitimately deleted due to the rename and some illegitimately deleted, so I’m having to sift through them all. Also, the steps to repro above are mostly conjecture. I don’t think that’s exactly what happened, especially since even after Obsidian sync reversed the “Notes” → “notes” rename, it continues to delete some of the files in the “Notes” directory seemingly at random.

Environment

  • Operating system: macOS monterey 12.4 and 12.6
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.0.3
    Installer version: v0.15.9
    Operating system: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 21.5.0
    Login status: logged in
    Catalyst license: none
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 3
    Plugins enabled: 3
    1: Tasks v1.16.0
    2: Toggl Track v0.9.0
    3: Obsidian42 - Text Transporter v1.0.3

RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

SYSTEM INFO:
Obsidian version: v1.0.3
Installer version: v1.0.0
Operating system: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 21.6.0
Login status: logged in
Catalyst license: none
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 5
Plugins enabled: 5
1: Tasks v1.16.0
2: Toggl Track v0.9.0
3: Jira Issue v1.31.0
4: Obsidian42 - Text Transporter v1.0.3
5: Obsidian Graphviz v1.0.4
RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

Sync activity log: Obsidian sync activity log · GitHub

I actually was working on a file - in the middle of typing - and sync deleted the file while I was working on it.

1 Like

I have some more info here. After doing a bulk restore on one of my computers - restoring a bunch of files into the “Notes” directory - I opened up Obsidian on my other computer. Once it had re-synced those files that I restored show up on my other computer in a “reference” directory. I moved all the files from my “reference” directory into the “Notes” directory a week or two ago and deleted the “reference” directory…

I just cannot trust that Obsidian Sync is going to do the right thing… It has repeatedly deleted my data. I think I’ll have to rely on git to sync between my two computers (so turn it off entirely on one of my computers) and then just use Sync to sync things to my phone and hope that I don’t have the same problems with my phone…

1 Like

You know, I discovered this bug a week ago while reproeing something else.

The thing is that sync doesn’t have a “rename concept”. Rename means delete, and download new files somewhere else.

An issue arises with Case Insensitive but Case Aware file systems.
(“Notes” and “notes” are the same folder, on mac and windows)

1 Like

There’s nothing here

Please attach the sync logs of both devices. I wanna make sure I understand what happens in your case.

It happened to me too, lately.

My ‘OG 2)’ file was renamed to ‘Og 2)’ on my iPad. No probs in Obsidian from what I’ve seen but when you go to GitHub Desktop, it doesn’t even let you pull your changes until you manually delete ‘OG 2)’ (as the earlier version in your PC folder is still named like that). Then it will pull down the changes (along with the renamed ‘Og 2)’ file) okay.

Yes, it’s the same in Git, the files are not renamed (as people think) but deleted and a new file with the given name is created.

Generally, any renames are touchy-touchy. Or at least this is what I am trying to remind myself of.

It’s not the same issue, let’s not mix things.

Steps to reproduce

Creating a note by specifying a link and clicking on it (e.g. [[obsidian/new folder/new note]] performs the expected behavior and appears to create both the new folder and the note within it. You can then add content to this note and the note will persist. However, when I then open obsidian on another device (which shares the vault via obsidian sync), the device invisibly deletes this note and the folder it resides in. This is mitigated by manually creating the folder first.

Expected result

It seems consistent with the overall UX that creating a new note in a new folder via the specification of a link and following the link should work. The note and folder should persist through syncing.
If this is not intended to work, it should not appear to work and then result in notes being deleted later…

Actual result

Notes and folders are deleted without warning to the user. When the user subsequently attempts to find the note either by following the link or by browsing, they are not present.
(content can, however, be recovered by using obsidian sync’s recovery feature.)

Environment

  • Operating system: Windows 10 and IOS.
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.1.9
    Installer version: v0.15.9
    Operating system: Windows 10 Pro 10.0.19044
    Login status: logged in
    Catalyst license: none
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: Things
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 7
    Plugins enabled: 6
    1: Calendar v1.5.10
    2: Citations v0.4.5
    3: Periodic Notes v0.0.17
    4: Dataview v0.5.55
    5: Tasks v1.24.0
    6: Omnisearch v1.11.1

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

Update: this seems more serious. It appears to happen regardless of whether the underlying folder is created manually before creating the notes…

Please attach the sync logs or screenshots of the sync logs of the devices involved where this happens.

Here is an example of this happening (including before note creation and after note deletion):

2023-02-06 16:00 - Fully synced
2023-02-06 16:04 - Uploading file Untitled 21.md
2023-02-06 16:04 - Upload complete Untitled 21.md
2023-02-06 16:04 - Fully synced
2023-02-06 16:04 - Deleting remote file Untitled 21.md
2023-02-06 16:04 - Uploading file test note persistence.md
2023-02-06 16:04 - Upload complete test note persistence.md
2023-02-06 16:04 - Fully synced
2023-02-06 16:04 - Uploading file test note persistence.md
2023-02-06 16:04 - Upload complete test note persistence.md
2023-02-06 16:04 - Fully synced
2023-02-06 16:04 - Uploading file test note persistence.md
2023-02-06 16:04 - Upload complete test note persistence.md
2023-02-06 16:04 - Fully synced
2023-02-06 16:05 - Uploading obsidian/test
2023-02-06 16:05 - Uploading Obsidian/test
2023-02-06 16:05 - Uploading file obsidian/test/testnote.md
2023-02-06 16:05 - Upload complete obsidian/test/testnote.md
2023-02-06 16:05 - Uploading file Obsidian/test/testnote.md
2023-02-06 16:05 - Upload complete Obsidian/test/testnote.md
2023-02-06 16:05 - Uploading file test note persistence.md
2023-02-06 16:05 - Upload complete test note persistence.md
2023-02-06 16:05 - Uploading file obsidian/test/testnote.md
2023-02-06 16:05 - Upload complete obsidian/test/testnote.md
2023-02-06 16:05 - Uploading file Obsidian/test/testnote.md
2023-02-06 16:05 - Upload complete Obsidian/test/testnote.md
2023-02-06 16:05 - Fully synced
2023-02-06 16:05 - Server pushed (folder) [iPhone] obsidian
2023-02-06 16:05 - Accepted obsidian
2023-02-06 16:05 - Deleting remote folder obsidian
2023-02-06 16:05 - Fully synced
2023-02-06 16:05 - Server pushed (deleted or renamed) [iPhone] obsidian/test/testnote.md
2023-02-06 16:05 - Deleting obsidian/test/testnote.md
2023-02-06 16:05 - Accepted obsidian/test/testnote.md
2023-02-06 16:05 - Server pushed (folder) (deleted or renamed) [iPhone] obsidian/test
2023-02-06 16:05 - Deleting obsidian/test
2023-02-06 16:05 - Deleting remote file Obsidian/test/testnote.md
2023-02-06 16:05 - Deleting remote folder Obsidian/test
2023-02-06 16:05 - Fully synced

As case-intensive but unaware filesystems are the norm for many users, can we come up with a solution for this? Notes being deleted without warning is a seriously bad behavior as it degrades trust in the system, especially since it is part of the paid sync feature. I really like sync, but this makes me rethink paying and instead consider switching to an alternative solution.

I don’t know much about your development practices here, but it seems like a first pass bandage would be to simply ask/notify when this happens?

It also seems relatively straightforward to repair by making some choices about desired behavior regarding case in folder names or a sync rename concept? Why is sync deleting the old version but not redownloading the new one?

IMHO, a sync rename concept might be worth implementing as it can save significantly on the extent of data transfer in cases of large directories or files and will make logs and related things much cleaner.

1 Like

Although I am no programmer, I think the filesystem issues don’t lie with Obsidian per se. As I mentioned further up, I run into similar problems with Git service as well. But because I have file versioning, I am comfortable deleting a file so I can pull from the remote the new file with changed case (Git doesn’t budge unless I delete the file).

Hi, I just wanted to add that this issue isn’t limited to filename upper/lower case differences. I was renaming folders by adding numbers to them (e.g., “projects” became “1_projects” and reorganizing them on a laptop. Hours later, I opened Obsidian on my phone and saw that files were being deleted as it synced. I went to my laptop and saw folders disappearing there as well.

In the end, the folders were completely mixed up – some folders had the new names, some had old names, and the file structure was wrong. Restoring the deleted files created many duplicates.

I’m not using any other syncing software on the vault folder. My laptop is running Windows 10 & my phone is Android.

This will be worked on desktop v1.3.1+ (and mobile v1.4.5+)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.