chhoumann / quickadd

QuickAdd for Obsidian
https://quickadd.obsidian.guide
MIT License
1.48k stars 135 forks source link

[BUG] Modifications to macro does not update its respective quick entry #576

Open alwun opened 11 months ago

alwun commented 11 months ago

Describe the bug Any macro that is modified after the quick entry is enabled does not automatically update itself.

To Reproduce Steps to reproduce the behavior:

  1. Create a new macro and enable quick entry for the macro image image

  2. Modify the macro image

  3. Run macro from command palette image

  4. The macro does not update itself, displaying error image

Expected behavior The macro's quick entry should automatically update when the macro is modified

Additional context The only way to update the macro is to disable the quick entry option and re-enable it after changes are made.

FeralFlora commented 9 months ago

I'm having the same issue, and have also seen other users run into this on the Obsidian discord.

FeralFlora commented 9 months ago

I found out some more about this. So, there's some migration that is supposed to occur so the macro is referred to by an ID, rather than embedding a copy of the macro into the choice. There seems to be an issue with this migration process, which causes this bug.

At first, I thought there might be some issue with the macro-ids not matching, but I confirmed that this is not the case in data.json.

I found the following workaround, which seems to solve the issue:

  1. Open the QuickAdd plugin folder, and open the data.json file.
  2. Find "migrations" Change this setting to false:
"migrations": {
    "migrateToMacroIDFromEmbeddedMacro": true, // set this to false

I don't know what the potential ramifications of this are, but hopefully @chhoumann can tell us more.