fix(update): tolerate release asset naming changes across releases - #28
Open
Nordikdata wants to merge 1 commit into
Open
fix(update): tolerate release asset naming changes across releases#28Nordikdata wants to merge 1 commit into
Nordikdata wants to merge 1 commit into
Conversation
`polar update` looked up the release asset by an exact name built from a hardcoded os/arch->extension mapping. Darwin releases switched from .tar.gz to .zip in v1.3.4; anyone still running a pre-v1.3.4 binary has an update path baked in that permanently expects the old .tar.gz name, which no longer exists in newer releases, so `polar update` hard-fails with "No release asset found for platform: darwin-arm64" forever after, with no fallback and no actionable error message. The same failure mode would recur on any future naming change. findReleaseAsset() tries the exact expected name first (no behavior change for the common case), then falls back to any archive for the same os/arch regardless of extension. The error message, if no asset is found at all, now also points at the one workaround that already reliably works today: a clean reinstall via install.sh. Fixes polarsource#18.
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.
What
polar updatefails withNo release asset found for platform: darwin-arm64on darwin-arm64 for anyone running a binary built before the darwin.tar.gz->.ziprelease asset rename (v1.3.4, 2026-04). The lookup indownloadAndUpdatematches the release asset by an exact name derived from a hardcoded os/arch->extension mapping baked into the running binary, so an older binary can never find a match again once the naming convention changes, and the same thing will happen again on any future rename.Fix
findReleaseAsset(): tries the exact expected archive name first (unchanged fast path), then falls back to any asset for the same os/arch regardless of extension.install.sh.Note: I could not reproduce the second symptom described in the issue (install.sh resolving the version string to the release title instead of the semver tag) against the current install.sh's
get_latest_version()— the shipped grep/sed logic extractstag_namecorrectly for the current API response shape (v1.3.9), and the live-servedhttps://polar.sh/install.shis byte-identical to the repo'sinstall.shat HEAD and at the v1.3.6 tag. Left as-is since I could not confirm a live repro; happy to dig further if it's still reproducing for you with details on your environment.Fixes #18.