besteon / Ironmon-Tracker

A Lua script for the Bizhawk/mGBA emulator compatible with Pokemon Fire Red, Leaf Green, Ruby, Sapphire, and Emerald that tracks relevant data for the IronMon challenge.
MIT License
130 stars 45 forks source link

Hotfix 7.2.1 #332

Closed UTDZac closed 1 year ago

UTDZac commented 1 year ago

This adds some protective checks (not actual fixes) during the automatic update that is executed while the Tracker is open and running. As of 7.2.0 release, I have seen at least two people attempt to update shortly after starting up Bizhawk, only for it to fail. Not only does the update not complete, it also breaks halfway through the process of overwriting and removing files.

Goal of this PR

To be extra cautious during the parallel update process (while Tracker is running already). I don't want people corrupting their Tracker and stumbling to have to manually redownload the Tracker and lose files or settings.

So far I've witnessed two potential causes for this, both of which are included in this hotfix patch. As a note, this hotfix will be applied immediately to anyone attempting to use the Updater (v7.1.6+), as new code gets loaded after it's downloaded but before the update scripts run.

  1. The Tracker files are kept inside a folder structure that includse OneDrive
    • This check identifies the folder path contains "OneDrive" and aborts the update process before any files are removed or replaced.
  2. The Tracker files are kept on a separate harddrive that isn't the primary harddrive C:\
    • This is a simple check on the folder path.

To add to this, I was not able to reproduce either of this issues on my local machine.

While it's definitely possible that some users with Tracker files on OneDrive or a non-primary harddrive could still update without issue, there doesn't seem to be a good rhyme or reason for when it decides to break. This is really hard to pinpoint or even reproduce.

After Review

Please feel free to merge this in as soon as you want and create a new release. You can copy the release notes exactly from the old one (v7.2.0), as I want to keep showing that the major update includes the new Log Viewer.

UTDZac commented 1 year ago

Couldn't sleep, snuck in two additional fixes. One small one with icon colors, the other is larger and fixes a bug.

The Randomizer Log Parser failed for games/logs made with 4.4.0 Randomizer. This is because of the terrible method I chose to implement it, assuming the order of the log sectors remained consistent. Turns out, this isn't the case.

I fixed this by rewriting it to work purely on line number references instead of remove lines from a large table. This had a side-effect of greatly increasing the speed at which a log could be parse.