Boss upgrade not working (downgrades to 3.0.9)
I do on non-elevated command-prompt the following on Windows 10:
boss -v v3.0.9
boss upgrade [==========================================================================================================================] 100.00% 4.05 MiB/4.05 8.03 MiB/s 0s
[INFO ] Update applied successfully to v3.0.9
but I have been getting this result for sometime now, even though I see there are newer versions in releases
it is not some rights issue most probably (it doesn't show any such message anyway) since boss.exe is on a subfolder at my desktop (which is redirected to exist under my OneDrive - not sure if that could be an issue but it's standard practive nowadays if you tell OneDrive to backup your folders)
Seems it's always installing 3.0.9. I got 3.0.12 from Releases and was using it find and when I tried -upgrade on it, it replaced it with 3.0.9 again!
boss -v [WARN ] Please restart your console after complete. v3.0.12
boss upgrade [WARN ] Please restart your console after complete. [===============================================================================] 100.00% 4.05 MiB/ 8.74 MiB/ 0s
[INFO ] Update applied successfully to v3.0.9
boss -v v3.0.9
btw, not sure why it was saying initially "[WARN ] Please restart your console after complete.", even at -v (and why there's a space char after WARN btw) and then after it downgraded to 3.0.9 it stopped saying that. Probably some message introduced after 3.0.9, but not sure why -v would show that
at https://pkg.go.dev/github.com/hashload/boss#section-readme
it says:
Upgrade This command upgrade the client latest version. Add --dev to upgrade to the latest pre-release.
boss upgrade boss upgrade --dev
but where is the releases metadata it uses? Does it query github for that (there's a /releases/latest there to get latest release page)? I don't see 3.0.12 marked as pre-release, so I don't suppose the --dev parameter would help the upgrade comnmand fetch that instead of 3.0.9
So I indexed this repo at Deepwiki and told its agent Devin to analyze the issue
Copying from there:
Root Cause
The issue is in the findLatestRelease function which uses string comparison instead of semantic version comparison: github.go:59
This line performs a simple string comparison (release.GetTagName() > bestRelease.GetTagName()) rather than proper semantic version comparison. This means:
"3.0.9" > "3.0.12" evaluates to true in string comparison The system incorrectly selects 3.0.9 as the "latest" version