Vinzent03 / obsidian-advanced-uri

Advanced modes for Obsidian URI
MIT License
765 stars 44 forks source link

[Bug] Append doesn't always append #160

Open MrSamoDude opened 9 months ago

MrSamoDude commented 9 months ago

The append feature doesn't aways work, this occurs on both the iPhone and Mac versions of Obsidian. If I've recently opened Obsidian and the destination note, the append feature appears to work successfully. If I've not already got Obsidian open or recently visited the destination note, the append feature will successfully open Obsidian and open the respective note, but doesn't always append the required text to the end of the note. It feels like there's some kinds of timeout kicking in before the append function can complete or it's trying to append before the note has fully opened. If I launch the same URI a 2nd time the data is successfully appended.

I'm calling the URI from Apple Shortcuts. An example of the URI I'm using: obsidian://advanced-uri?vault=vault_name&filepath=Bookmarks/site_name.md&data=data&mode=append

The destination note is currently over 100 lines long if that has any impact.

Obsidian v1.5.8 Advanced URI v1.40.0 Sonoma 14.3.1 or iOS v17.3.1

Thanks

tch123 commented 8 months ago

mode=prepend has the same problem obsidian://advanced-uri?vault=vault_name&daily=true&data=1111&mode=prepend

Obsidian v1.5.8 Advanced URI v1.40.0 Windows 10 Android 13

bcohen44 commented 7 months ago

I am noticing that append from iOS shortcuts never works, or stopped working at some point

Vinzent03 commented 7 months ago

I could reproduce the prepend issue with an empty file, which is now fixed in the new version. But other than everything worked fine on linux, android and iOS. @bcohen44 please share the not working uri.

bcohen44 commented 7 months ago

obsidian://advanced-uri?vault=Brian_Obsidian_Vault&daily=true&data=foo%20bar&mode=append When I send this on Chrome on Windows, it works fine.
on iOS, I get a "File already exists"error

Liquidmantis commented 7 months ago

In my case, the lost append when the note doesn't exist, the issue stems from race conditions created by other extensions. The primary culprit for me is Templater. Disabling its file create hook, where it will apply the template on note create, appears to have fixed my uninitialized note append for me, albeit in limited testing.