Skip pre-releases when picking "latest"; consolidate platform matching - #110
Open
999sian wants to merge 1 commit into
Open
Skip pre-releases when picking "latest"; consolidate platform matching#110999sian wants to merge 1 commit into
999sian wants to merge 1 commit into
Conversation
999sian
commented
Jul 9, 2026
Fixes SirDiabo#89 and removes duplicated platform-detection logic. Pre-release handling (SirDiabo#89): the launcher treated the newest GitHub release as "latest" via Releases.FirstOrDefault(). The /releases API is newest-first but includes pre-releases, so a repo whose newest release is a pre-release (e.g. Skate 3 Recomp's nightly builds) was offered as the current version even though it isn't the finished build. Added GameInfo.SelectLatestRelease(), which prefers the newest stable release and falls back to the newest pre-release only when a repo publishes no stable releases at all (so pre-release-only repos still work). Mirrors GitHub's own /releases/latest semantics. Wired into all three selection sites: GameInfo version-check + download, and MainWindow "Update now". Consolidation: App.axaml.cs and CLIHandler.cs each carried a private copy of GetPlatformIdentifier() duplicating PlatformAssetMatcher.GetPlatformIdentifier(TargetOS.Auto). Removed both copies and call the shared Core method. Self-update asset selection in both files used a naive name.Contains(platformIdentifier) check, weaker than the PlatformAssetMatcher.MatchesPlatform() the game-download path already uses (e.g. "Linux-X64" is a substring of a "Linux-X64"/"Linux-ARM64" pairing only by lucky naming). Routed both self-update paths through MatchesPlatform for consistent, robust matching; the existing .zip/.tar.gz extension filter is preserved. Verified against the real compiled GameInfo.SelectLatestRelease (via reflection) and PlatformAssetMatcher: prerelease-at-top is skipped, all-stable picks newest, prerelease-only falls back, empty/null -> null; and the self-update matcher picks the correct asset per platform from the launcher's real release asset names without the ARM64/X64 mixup.
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.