When moving files through Drag and Drop, if same directory name found, source files get dropped in an arbitrary location

When moving files through Drag and Drop, Obsidian quietly drop the source files in an arbitrary location when similar folder found in the destination losing the first directory. The usual folder moving behaviour (to add a 1, 2 etc to the source directory’s suffix if a duplicate directory found in the destination) is not working in this scenario.

Steps to reproduce

  1. Open the Sandbox Vault (Help > Open Sandbox Vault
  2. Delete all the existing folders (Right click on each folder > delete) to clear the vault so that it is distraction free for us to re-produce this issue.
  3. Create the file/folder structure and content as follows:
File Content
3.1. Proj 0.0/Dir1/SubDir/File1.md Dir1_File1
3.2. Proj 0.0/Dir1/SubDir/File2.md Dir1_File2
3.3. Proj 0.0/Dir2/SubDir/File1.md Dir2_File1

Here’s a script if you are Linux/Mac and would like to do this in one go.
As you can see just changing the dir1 and dir2 will help you generate as many test scenarios as you like for testing. You may notice the first and second directory naming doesn’t cause any issues.

# Test 1 - Successful
# dir1="Dir1/SubDir"
# dir2="Dir2/SubDir"

# Test 2 - Success
# dir1="Proj 00/Dir1/SubDir"
# dir2="Proj 00/Dir2/SubDir"

# Test 3 - Failed
dir1="Proj 0.0/Dir1/SubDir"
dir2="Proj 0.0/Dir2/SubDir"

mkdir -p "$dir1"; echo Dir1_File1 > "$dir1/File1.md"
mkdir -p "$dir1"; echo Dir1_File2 > "$dir1/File2.md"
mkdir -p "$dir2"; echo Dir2_File1 > "$dir2/File1.md"

Now your vault should look like this:

  1. Now drag the sub-directory SubDir folder from the directory Dir1 and drop into the directory Dir2 using your mouse or track-pad.

Did you follow the troubleshooting guide? [Y]

Expected result

Notice the directory SubDir that was already-existing was renamed to SubDir 1 without losing its destination.

Actual result

Arbirary folders were created (Note Proj 0) and moved files were placed there. Old sub-directory is now completely lost. File content found to be present. In a large vault this is going to now be a nightmare.


	Obsidian version: v1.5.12
	Installer version: v1.4.13
	Operating system: Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 23.5.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 0
	Plugins enabled: 0


Additional information

It is the dot (.) in the folder name that cause the issue. Workaround may be to replace that with an underscore (_) perhaps if that’s possible for the use of the vault. In my personal case, project ID is my prefix of the folder, and they have the dot thus maintaining the order. So, if this can be fixed, I’d be super grateful.

is this happening in v1.6?

I have Version 1.5.12 (Installer 1.4.13)

There seems no further updates from there-onwards:

Latest download still seem to point to the https://github.com/obsidianmd/obsidian-releases/releases/download/v1.5.12/Obsidian-1.5.12-universal.dmg

But I see where you’re coming from. The release notes say there is a 1.6.2 update! Obsidian 1.6.2 Desktop (Early access) - Obsidian

Update :bangbang:

Just noticed I can get v1.6.2 through the Catalyst program. Will try sometime and update soon as I can (Just need to take backups etc).

Thanks for looking into this.

Make backups of your vaults first (as mentioned in the link), but as you are a VIP you have access to the early access versions. The steps are in the link below. The version is currently 1.6.2.

I’ll test it again today.

1 Like

My apologies, I confused this with another bug that we recently fixed. This problem still happens, I reproduced it today.

Thank you.

1 Like

will be fixed obsidian version 1.7. No ETAs.

1 Like

@WhiteNoise thank you so much for getting this fixed; and your prompt reply and support. Much appreciated.

@ariehen my vaults are version tracked with Git. That’s how I noticed the issue.