Tags in front matter doesn't update metadata cache

Steps to reproduce

  1. Create a plugin with this code:
    plugin.registerEvent(
        plugin.app.metadataCache.on("changed", (path, data, cache) => {
            console.log("changed");
        }),
    );
  1. Add #test to the body of a note. The metadata is updated.
  2. Add test to the tags in the front matter. The metadata is not updated.

Expected result

The metadata cache is updated with the tags in the front matter.

Actual result

The metadata is not updated with the tags in the front matter.

Environment

SYSTEM INFO:
Obsidian version: v1.4.12
Installer version: v1.4.11
Operating system: #1-NixOS SMP PREEMPT_DYNAMIC Wed Sep 6 20:22:26 UTC 2023 6.5.2

I’m not able to reproduce the issue. I see the event fired and the console.log appears. How are you adding a tag to the frontmatter? In source mode or in live preview?

Sorry, this was due to a discrepancy in the API. Tags in the body are stored in .tags (prefixed with a #), tags in frontmatter are stored i frontmatter.tags (without a #). My bad.

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