In the editor, click 3-dot thing and copy Obsidian URL
Store it somewhere else and forget about it
Move the file around in the vault
Link is now broken
Expected result
Copy Obsidian URL returns a deep link to the object.
When the request comes in:
If the file is there, awesome.
- that’s the one to return.
If the file can not be found, remove the path, see if there is exactly one match
that’s the one to return
If neither method works, show an error and send the user to the search box.
Copying the link with Copy Obsidian URL should return the link without a directory if it is unique. (the least specific link possible). That’ll make the link much more stable.
Actual result
Obsidian always returns a very specific link with a directory. That makes the links brittle.
Let’s say we do what you want. One day I create a link to file in dir1. Another day I create a file with the same name in the root. The URI link I created a few days back now points to another file. Do you think this is appropriate? I can see another bug report coming.
I can’t reproduce this. The URL generated by the three dot menu is in the format obsidian://open?vault=<my-vault>&file=<my-file>. That link works regardless of the folder my-file is in. Renaming a file or moving it outside the vault is the only thing that would break it.
Edit: Something missing from the steps to reproduce this is that the file in question should be inside a folder, in which case the second part of the url returns my-folder/my-file. For now a work around is to remove the folder from the URL. I’ll update the title of the feature request.
This is the reason/motivation for using UID-only based filenames.
They enable to rename note titles and move files without breaking the links in form obsidian://vault/<vaultname>/<noteUID>, including links stored externally.
Opening such link does not require searching/indexing content of all files in the vault, just the filenames.
We can change title by any application easily because links do not have to be updated/renamed.
Versioning/backup systems need to create/store new version only for renamed file, not for all files that link to it.
Better support for separation between filename and title is requested in:
Existing support for aliases helps with usability of knowledge base based on files with UID-only filenames.
UIDs are available to anyone if you want to use Zettelkasten file names.
A file-UID that is separate from the file name would have to be maintained somewhere and would surely cause user lockin - which is exactly what Obsidian is avoiding so awesomely.
It would be possible to add a switch that warns the user or complains about duplicate file names even though they live in different directories. I’d like that, but it seems odd. It would make each file name a unique ID though, but it’s really a strange paradigm.
Can we revive this and look for a way to implement it?
The way I’m thinking of, is that each file/note as an ID that is internal and not user changeable.
And the url will be using the ID instead of file name.