Only update config version when migration happens#48
Only update config version when migration happens#48JuneStepp wants to merge 1 commit intoAnKing-VIP:mainfrom
Conversation
|
Thanks for the PR! However, I did have a reason for saving last-used addon version. In the past, one of my addon's minor version update had an issue that broke user data. After that incident I like to store the last opened add-on version, so I can run some script to reverse the breakage as part of migration. I'm not sure what may be the best solution here. Does Nix perhaps have a config to ignore that warning for a specific addon? cc. @musjj Edited: realized after reading again that the solution indeed wouldn't work and removed it. |
|
How I handle this in my code is I have a specific config format/schema, in my case represented as a Python class. The config is never edited directly. Rather, the class is serialized and de-serialized. Whenever that schema is changed in a non backwards compatible way, the schema version is updated too. This way, the config is never in an unexpected state. |
|
I think I'll just include this patch in the Nix version and close the PR. ReColor can't edit the Nix config, so there's no chance of ReColor accidentally breaking the config in an update there. |
There's no need to update the version in user config if no config schema change has occurred. Only saving the config when necessary, solves issues with using this add-on on NixOS.