fix: use GitHub API instead of curl binary for version check (#808)#810
Open
MrRealORG wants to merge 1 commit into
Open
fix: use GitHub API instead of curl binary for version check (#808)#810MrRealORG wants to merge 1 commit into
MrRealORG wants to merge 1 commit into
Conversation
…iMo#808) The curl installation method's latestImpl() spawned the curl binary to follow GitHub releases redirect. This fails silently (text() catches errors and returns empty string) when curl is not installed, producing a confusing 'failed to resolve latest version from GitHub releases redirect' error. Replace with GitHub REST API call (GET /repos/.../releases/latest) using the existing HttpClient, which is already available and doesn't depend on any external binary. Parse tag_name from the JSON response. Root cause of XiaomiMiMo#808: v0.1.1 was released without the curl handler in latestImpl() at all, causing 'unsupported update channel: curl'. The handler was added in main but used the curl binary. This fix makes it robust by using HTTP.
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.
Summary
Fixes #808
Root cause
v0.1.1 was released without a curl handler in latestImpl() at all. The curl handler was added in main after v0.1.1, but it spawned the curl binary which may not be installed.
Fix
Replace curl binary with GitHub REST API call using the existing HttpClient. No external binary dependency.