fix(update): a folder newer than the latest release is not offered the older one #2519
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2519
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/update-no-downgrade"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The bug. The v2.2.0 test build (built from main, labelled v2.2.0 while v2.1.0 is the latest release) opened with the update prompt: "A new version of Hookshot is out: v2.1.0 (this game is v2.2.0). Update now?". Update would have built 2.1.0 over the test folder. The log said it plainly:
update: this folder is v2.2.0, the latest release is v2.1.0.hos_update_checkonly kept a release candidate from being offered an older version; a release was offered any tag that differed from its own.The fix (
host/hos_update.c, Windows and Linux): a release or release candidate newer than the latest release is offered nothing. Nightlies are unchanged. The existing release-candidate guard stays as it was.Tests:
tests/test_update_tracks.pychecks the new guard is in both copies; the version order it relies on (newer_version) is already compiled and checked there. 6 tests pass (clang).🤖 Generated with Claude Code
Looks good. The guard is right:
newer_version(have, tag)is only true when both parse as vX.Y.Z[-rc.N] and the folder is strictly newer, so v2.2.0 against a latest of v2.1.0 returns before any prompt, and an equal or older folder, or a version that does not parse, is offered exactly as before. Nightlies are skipped by!nightly_version(have), and both the Windows and Linux copies sit right after the existing equal/skipped/rc checks, before anything is shown or the builder is looked up.Nits, none blocking:
newer_versionis already compiled and tested there.-dirtyrelease) is still offered whatever the latest is. Same as before, so no regression.Overlap with #2430: that PR also edits
host/hos_update.c(builder shape check, env stripping, skip-file writes) andtests/test_update_tracks.py, but in other hunks. On the Windows side it starts at thehas_builderlines, a few lines below this guard. On Linux it addsstruct stat bst;after thesnprintf(path, ...)line, one line below this guard. So I expect a clean merge in either order, though I only compared the patches and did not try a merge. Semantically they are independent: this decides whether to offer, #2430 how the offer runs.CI is green. Nobody else has reviewed or commented so far.
github-sync referenced this pull request2026-11-12 06:22:54 +00:00