Skip to content

tui: u rechecks GitHub instead of trusting the hourly poll - #308

Merged
erickgnclvs merged 1 commit into
mainfrom
u-rechecks-updates
Sep 29, 2026
Merged

erickgnclvs merged 1 commit into
mainfrom
u-rechecks-updates

Conversation

@erickgnclvs

Copy link
Copy Markdown
Owner

Problem

Pressing u only read UpdateVersion, which the background check refreshes at startup and then hourly. A release published since the last poll made u flash "already up to date" while brew update && brew upgrade would happily install it.

Fix

  • With no newer version cached, u now checks GitHub on the spot ("checking for updates…") via a new recheckUpdateCmd / UpdateCheckedMsg, and goes straight into the brew upgrade if it finds one. Otherwise it flashes "already up to date", or the error if the check failed.
  • updatecheck.Latest treats a non-200 response as an error. Before this, a rate-limit body decoded to an empty tag and read as "up to date".

Testing

  • New TestUpdateKeyRechecksWhenNothingCached covers the up-to-date, error, and newer-found paths (fails on the old code).
  • go test ./internal/tui ./internal/updatecheck passes. internal/terminal fails locally only when run inside Ghostty (env leak, unrelated) and passes with the GHOSTTY_* vars unset.

🤖 Generated with Claude Code

u only read UpdateVersion, which the background check refreshes hourly,
so a release published since the last poll got 'already up to date'
while brew upgrade would install it. With nothing cached, u now asks
GitHub on the spot and goes straight into the upgrade if it finds one.

Also treat a non-200 from the releases API as an error: a rate-limit
body decoded to an empty tag and read as 'up to date'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@erickgnclvs
erickgnclvs merged commit 374f9e1 into main Sep 29, 2026
3 checks passed
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