Fix "Version upgrade failed" popup on fresh configs (inverted null check) - #40
Open
HendoBuilds wants to merge 1 commit into
Open
Fix "Version upgrade failed" popup on fresh configs (inverted null check)#40HendoBuilds wants to merge 1 commit into
HendoBuilds wants to merge 1 commit into
Conversation
The branches of the IsNullOrWhiteSpace check were swapped: a fresh
config (LastVersion = "") kept the blank string, so IsVersionGreater
hit int.Parse("") and threw, showing the "Version upgrade failed"
popup on every launch. A stored version was replaced with "0.0.0",
re-running every upgrade action (and resetting customized instruments
to defaults) on each start.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
|
Update: I've now built and tested this properly on Windows rather than just reviewing it. I tested both unpatched master and this branch, same four scenarios, checking window titles and config state after each run: Unpatched master
This branch, same scenarios |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Saw a new user in the Bards Guild lutebot-help channel hit the "Version upgrade failed" popup on a fresh install and conclude the download itself was broken, so I dug into the source. The branches of this check in
DetectVersionChange(LuteBotForm.cs) are swapped:Two effects:
LastVersionis""per DefaultConfig.txt):lastVersionstays"", soIsVersionGreater("3.6.0", "")hitsint.Parse("")and throws, which triggers the "Version upgrade failed" message box. Because the throw skips theSetProperty(PropertyItem.LastVersion, ...)at the end of the method,LastVersionnever gets written, so the popup repeats on every launch. LuteBot still works after dismissing it, but it reads like a broken install to new users.LastVersionvalue:lastVersionbecomes"0.0.0", so every upgrade action runs on every launch, includingInstrument.Write(true), which resets customized instruments to defaults each start.This PR swaps the two branches, so a blank
LastVersionis treated as0.0.0(upgrade actions run once, then the version is recorded) and a stored version is used as-is.Heads up that I reviewed the change but could not compile it here (no .NET toolchain on this machine); it is a straight swap of the two existing branch expressions.
Thanks for maintaining this!
🤖 Generated with Claude Code