getmatterapp / obsidian-matter

The Matter Obsidian plugin
GNU General Public License v3.0
122 stars 11 forks source link

Note titles appended with "-2" #31

Closed jx3v closed 1 year ago

jx3v commented 2 years ago

I'm trying to understand why my notes from Matter are being sync'd with a "-2" added to the end of the note title (filename). In some cases its two dashes ("--2").

I've tried deleting all my sync'd notes from Matter and re-sync'ing them thinking this has to do with duplicates, but they consistently get re-sync'd/re-added to Obsidian with the same names.

hunterclarke commented 2 years ago

Hi @midnightmercenary, this is a problem that should be fixed in version 1.1.3 (released today) for all new notes. In short, if you run Obsidian sync and Matter, the sync processes can conflict with another, leading to the system thinking there are duplicates when there aren't.

Unfortunately, the way the Matter plugin tracks the files makes it impossible to rename/delete the -2 versions of the files without uninstalling/reinstalling the plugin and re-syncing all of the data.

Regarding --2: we replace characters that are invalid on filesystems with a -.

Let me know if you have any follow-up questions.

philoserf commented 2 years ago

I was able to clear them by removing the -2.md file from the plugin's data.json file.

hunterclarke commented 2 years ago

^ that is an alternative if you're willing to open the data.json file stored within .obsidian/plugins/obsidian-matter

hunterclarke commented 2 years ago

Thanks @philoserf!

jx3v commented 2 years ago

Thanks @hunterclarke, I was ok with deleting my sync'd notes and proceeded with your suggestion of re-installing the plugin which solved the issue!

Would I be able to remove the invalid characters altogether instead of replacing them with another character? "Am I a threat to democracy?" Simple becomes "Am I a threat to democracy" instead of "Am I a threat to democracy-"

thorms11 commented 2 years ago

I am still getting the "[filename]-" issue. is there a way to fix this without deleting the file from matters end?

hunterclarke commented 2 years ago

@thorms11 "[filename]-" isn't really a bug. We replace characters in the article title that aren't valid in Obsidian with "-". That being said, as @midnightmercenary pointed out above, it might be worth exploring alternatives to that. We could just strip the invalid characters altogether.

The cases where it works nicely (like when replacing ":") might not be worth the cases where it doesn't look great.

thorms11 commented 2 years ago

Sorry if I wasn't clear. There are no invalid characters. I am seeing a dupe file of my highlights ending with -. When that duped file is created all new highlights go to it, rather than the original. if I delete the file with the - it regenerates when matter syncs.

hunterclarke commented 1 year ago

@thorms11 what you're describing is referred to above:

Unfortunately, the way the Matter plugin tracks the files makes it impossible to rename/delete the -2 versions of the files without uninstalling/reinstalling the plugin and re-syncing all of the data.

or

... an alternative if you're willing to open the data.json file stored within .obsidian/plugins/obsidian-matter

The root issue is resolve, but unfortunately there's cleanup that the plugin can't handle without some additional changes in your vault.