Skip to content

fix: self-update silently failing with 403 since v0.38.5#303

Merged
LargeModGames merged 3 commits into
mainfrom
fix/self-update-403
Jun 12, 2026
Merged

fix: self-update silently failing with 403 since v0.38.5#303
LargeModGames merged 3 commits into
mainfrom
fix/self-update-403

Conversation

@LargeModGames

Copy link
Copy Markdown
Owner

Problem

Auto-update has been silently broken since v0.38.5 for every shipped client. Users on v0.38.5, v0.38.6, and v0.39.0 never receive updates, with no error shown anywhere.

Root cause

verify_release_checksum (added in a7c2d74, first shipped in v0.38.5) downloads the .sha256 sidecar and the release asset with a bare reqwest client:

  1. It sends no User-Agent header, and the GitHub API rejects such requests with 403 Forbidden. Reproduced with the released v0.38.6 binary: Error: HTTP status client error (403 Forbidden) for url (https://api.github.com/repos/LargeModGames/spotatui/releases/assets/...).
  2. Latent second bug: it also omits Accept: application/octet-stream, so even with a User-Agent the asset API URL would return JSON metadata instead of the file.

run_auto_update then swallowed the error with .ok().and_then(|r| r.ok()), which is why this went unnoticed for three releases. v0.38.4 (the first self-update release) had no verify step, so updates into 0.38.5/0.38.6 still worked.

Changes

  • src/cli/update.rs: the verify client now sends User-Agent: spotatui/<version> and Accept: application/octet-stream on both asset downloads.
  • src/runtime.rs: auto-update failures are logged with log::warn! instead of being discarded, so the next regression is visible in the log file.
  • src/runtime.rs: spotatui update now runs through spawn_blocking like the silent path. Calling reqwest::blocking machinery on the async runtime thread can panic with "Cannot drop a runtime in a context where blocking is not allowed" (reproduced in a dev build; same crash signature as an older panic log).

Verification

Built this branch with the version temporarily set to 0.38.6 and ran update --install on a throwaway copy: it detected v0.39.0, passed checksum verification, downloaded, extracted, and replaced the binary with the exact release exe (17,045,504 bytes, matching the release zip). cargo fmt, clippy -D warnings (slim and slim+self-update), and all 251 tests pass.

Note for release

Shipped clients 0.38.5 through 0.39.0 carry the broken verify in their own binaries, so they can never self-update regardless of what we publish. This fix needs to go out as v0.39.1, and users need one manual update (winget/brew/AUR/release download) to get there. Release notes should mention this.

- send User-Agent and Accept headers when downloading release assets for
  checksum verification (GitHub returns 403 without a User-Agent and JSON
  metadata without Accept: application/octet-stream)
- log auto-update failures instead of silently discarding them
- run 'spotatui update' via spawn_blocking so reqwest::blocking cannot
  panic the async runtime
@LargeModGames LargeModGames merged commit 791379b into main Jun 12, 2026
9 checks passed
@LargeModGames LargeModGames deleted the fix/self-update-403 branch June 12, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant