fix(gui): survive GitHub API rate limits; don't wipe existing install before a verified download - #28
Open
edufalcao wants to merge 1 commit into
Conversation
…tact until download succeeds - Resolve the latest release tag via the releases/latest redirect instead of the GitHub API, which is rate-limited to 60 unauthenticated requests/hour per IP (shared across CGNAT users). The release channel no longer touches api.github.com at all. - Validate VERSION/DOWNLOADURL and abort with a visible zenity error before deleting the existing services folder, instead of silently continuing to a broken 'Install finished' state. - Download PluginLoader to a temp file first and only wipe/replace the existing install after the download is verified. Fixes SteamDeckHomebrew#16 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCRmEjYtRFKUVG36VsN9ay
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.
Fixes #16. Full root-cause investigation in SteamDeckHomebrew/decky-loader#940 (also the resurfaced reports in SteamDeckHomebrew/decky-loader#492).
Problem
When the GitHub API rate-limits an IP (60 unauthenticated requests/hour, shared by everyone behind the same CGNAT/proxy IP), the GUI installer:
jq: error ... Cannot index string with string "prerelease";$DOWNLOADURL, so PluginLoader is never downloaded (chmod: cannot access .../PluginLoader);rm -rf "${HOMEBREW_FOLDER}/services"before contacting the API — so trying to update a working install destroys it.Changes (gui/user_install_script.sh only)
releases/latestredirect (location:header) and the asset is fetched fromreleases/download/<tag>/PluginLoader. Neither endpoint is rate-limited — verified working from an IP whose API quota was exhausted (403,x-ratelimit-remaining: 0) at that exact moment. This makes default installs immune to the rate limit. The prerelease channel still needs the API (GitHub has no "latest prerelease" redirect).VERSION/DOWNLOADURLbefore touching anything. If empty/null(rate limit, API change, network failure), show a zenity error explaining the likely rate limit and exit — the existing install is left intact. Previously the failure was invisible to GUI users since it only went to stdout.services/only after a verified download (curl exit code viaPIPESTATUS+ non-empty file check,curl -fso HTTP errors fail instead of saving an error page). This is the ordering fix suggested in install script is not working when api returns rate limit #16 — a failed update can no longer delete a working install.Note:
chmod +xbecamechmod 755becausemktempcreates files as 600; 755 preserves the exact permissions the installed binary had before this change.Testing
bash -npasses.v3.2.6, asset URL answers HTTP 200 (~27 MB).rm -rf.🤖 Generated with Claude Code
https://claude.ai/code/session_01FCRmEjYtRFKUVG36VsN9ay