estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
1.86k stars 70 forks source link

Issue: Metadata is overwritten with metadata from the other file when switching tabs #734

Closed mayumih387 closed 6 months ago

mayumih387 commented 6 months ago

First of all, I appreciate this great plugin and always keep it updated!

Describe the bug

Metadata on .md files flashes and sometimes overwrites other files' metadata. Also, even if no change is made, the file is treated as "edited/unsaved" (unsaved circle added to the tab) when you switch the tabs.

To Reproduce

Steps to reproduce the behavior:

  1. Use v9.5.7529693 or later
  2. Open several files
  3. Swich the tabs
  4. You can see 1) the metadata flashes, 2) the file status becomes "editted/unsaved", and 3) suddenly metadata is overwritten as other files metadata

Expected behavior

Screenshots

Case: A

Screencast from 2024-01-17 16-18-16.webm

I just switch the tabs on this movie. (0:19) We can see that the metadata has been may suddenly inserted into frontmatter.json.

Case: B

It can happen with other .md files, too.

Screencast from 2024-01-17 16-45-26.webm

(0:07~) Metadata title is overwritten. ("My Second Post" becomes "New Beginnings" which is the title of the other markdown file)

We can also see that the metadata flashes every time I switch tabs.

Desktop environment

Additional context

It doesn't happen with v9.5.7529693.

It seems that some changes between v9.5.7529693 and v9.5.7530510 may affect this.

Here is the test repository if frontmatter.json is needed.


Thanks for your support!

estruyf commented 6 months ago

Thanks, @mayumih387. I have already discovered this issue. This is due to a change coming from #730. Working on a fix.

estruyf commented 6 months ago

Fix is being released.

mayumih387 commented 6 months ago

Thank you!