Please remove deleted bookmarks from bookmarks.json

When deleting bookmarks they are not removed from the bookmarks.json file. This problem has always been there even sith starred.json notes.

Use case or problem

I am writing an extension for vscode that reads this file to create a picklist of all the bookmarked files. It would increase the efficiency for the extension if I did not have to verify every files existence before adding it to the quickpick. This will also over time have the potential to create a huge bookmarks.json file.

Proposed solution

This ones easy enough, just remove its entry in bookmarks.json when the file is deleted.

Current workaround (optional)

Currently I have to verify every files existence before adding it to my quickpick list. This has the potential to really slow down my extension, especially if there are 1000’s of non-existing entries.

How does Obsidian know not to add an entry to the bookmarks tab? I assume it verifies the files existence before adding it to the bookmarks tab. It is at this point where Obsidian should remove it.

So, here is the problem, we don’t know if a file has been deleted, or if it’s just not existing on the current device.
If a user configured their sync tool on one of their devices to sync only selected folders, then they would lose any bookmarks that point to the non-synced files, all the time.

1 Like

That makes total sense and I had not considered that. Will just have to stick to my workaround then.

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