mdelobelle / metadatamenu

For data management enthusiasts : type and manage the metadata of your notes.
https://mdelobelle.github.io/metadatamenu
MIT License
520 stars 27 forks source link

BUG: The data of `fields` in my Fileclass (in yaml) will be cleared #597

Closed YIRU69 closed 7 months ago

YIRU69 commented 7 months ago

This has happened many times Whenever the version is updated (not sure if this is the trigger condition), the data of fields in my Fileclass (in yaml) will be cleared. I want to know why and if this can be avoided?

Since it happened once, I had to reset it, and then I started making backups. But this problem may occur every time there is an update.

Just mentioning, it may be caused by synchronization, not sure of the exact reason, haven't done detailed testing, but this has indeed happened many times.

Hope the author pays more attention!

mdelobelle commented 7 months ago

Hi! Another user has mentionned fields being empty. Your feedback can point me in the right direction.

Does this happen if you disable/enable the plugin (with the same version of the plugin)? (don't forget to backup your fileclasses before testing) or when you relaunch Obsidian?

Did you notice any error in the console when it occured?

Are the other properties of your fileclasses (other than "fields") preserved? (mapWithTag, icon, ....)?

What is the value of the "version" property in your fileclasses (when they are cleared, and when you restore them from your backup)?

YIRU69 commented 7 months ago

All of the properties save except for "fields".

The version turn 2.x to 2.0.

I don't notice the error in the console.

mdelobelle commented 7 months ago

I've released 0.8.3 that should prevent fields data from being cleared For some reason, the identification of the current version of the fileclass was failing during the indexing process Therefore the plugin though that the current version was "undefined" and triggered an initial migration that sets the "fields" property as an empty array. Now this migration is checking for the version of the plugin (any version > 0.6.0 shouldn't apply this initial migration)

Sorry about the data loss :/

Hopefully you can recover it and this won't happen again

YIRU69 commented 7 months ago

Thank you!