czottmann / obsidian-actions-uri

A plugin for Obsidian (https://obsidian.md) that adds additional `x-callback-url` endpoints to the app for common actions — it's a clean, super-charged addition to Obsidian URI.
https://zottmann.dev/obsidian-actions-uri/
MIT License
138 stars 6 forks source link

[ZCO-144] When `/daily-note/create` and `/daily-note/search-and-replace` are run in short succession, the latter sometimes doesn't see the content of the created note #61

Closed czottmann closed 1 year ago

czottmann commented 1 year ago

When I create a new note and then try to replace text in that note, I need to add a short pause between those calls. Since the note in question is being initially auto-filled by Templater (i.e. I only create an empty note, then Templater takes over) I suspect a race condition: the second call (appending) is handled before Templater is done.


Confirmed. It's a race condition. Adding a check for Templater and conditionally waiting 0.5s after creation seems to do the trick!

ZCO-144

czottmann commented 1 year ago

Added in v1.1.0.