0neGal / viper

Launcher+Updater for TF|2 Northstar
https://0negal.github.io/viper
GNU General Public License v3.0
151 stars 21 forks source link

Fixes broken JSON files on restart #181

Closed LumiKattlin closed 1 year ago

LumiKattlin commented 1 year ago

On restart, if the json file was broken supposedly would try to repair but it wouldn't work, it would keep repairing but failing. This should fix it by deleting the json file and creating a new one at the start with the correct settings (hopefully)

itscynxx commented 1 year ago

This has been an issue for a long while, where resetting config simply doesn't do anything, seeming to be because it just writes {} to the config file which also invalidates it (this may not be the exact cause but, regardless, it does not work)

As Lumi mentioned, this simply makes it delete the viper.json when detected as invalid. Deleting it won't affect the end user's device, as it would be reset normally and it being deleted simply makes viper hard reset it. This may require things such as an update to the version number or possibly packaging the code for release, however this is still an issue that should be actively worked on as it affects plenty of end users while trying to help them, and end users shouldn't be required to find the .json file themselves and delete it, as the point of a manager is to mitigate the effort put in by an end user.

We have tested this on Windows as well as Silverblue Linux, however it should realistically work anywhere that viper already works on.

0neGal commented 1 year ago

I've actually had multiple people message me about this, and I haven't been able to reproduce it myself, and the people who have messaged me with it haven't replied back or similar, so I haven't been able to diagnose it through that either. I did however notice someone talking about deleting the file fixing the issue, and so it's even in the notes of my list of stuff to work on.

The weirder thing is that I can't reproduce it no matter what, if I reset it, it automatically corrects itself, hence why it was the way it was... weird...

I'll quickly test this myself, then merge. And given the bug make a release to fix it ASAP.

LumiKattlin commented 1 year ago

Okay, thanks!

0neGal commented 1 year ago

Everything works as expected, tho I still can't reproduce the error no matter what, oh well. A new release should be out within 30-60 minutes or so.