Skip to content

feat(update): background update check with post-command notice#104

Merged
eddietejeda merged 1 commit into
mainfrom
feat/update-background-check
May 23, 2026
Merged

feat(update): background update check with post-command notice#104
eddietejeda merged 1 commit into
mainfrom
feat/update-background-check

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

Summary

  • Spawns the GitHub release check in a background thread before the command runs, so the network call overlaps with command execution
  • Joins the result after the command finishes via recv_timeout(6s), ensuring the notice always appears at the bottom of output
  • Uses mpsc::Receiver instead of JoinHandle::join to avoid indefinite blocking if the HTTP request stalls past its own 5s timeout
  • Unifies the upgrade message to hotdata update for all install methods (drops the Homebrew-specific branch in the notice)

Test plan

  • Run any command (e.g. hotdata query status <id>) when a newer version exists — notice appears after command output in yellow
  • Run hotdata update — no notice printed (skipped for the update command itself)
  • Set HOTDATA_NO_UPDATE_CHECK=1 — no notice printed
  • Run in a non-TTY context (e.g. pipe output) — no notice printed
  • Simulate a slow/hanging network: notice is skipped gracefully after 6s, command still exits cleanly

🤖 Generated with Claude Code

Spawn the GitHub release check in a background thread before the command
runs, then join it (recv_timeout 6 s) after the command finishes so the
notice always appears at the bottom of output. Uses mpsc::Receiver instead
of JoinHandle::join to prevent blocking if the HTTP request stalls past
its own 5 s timeout. Unifies the notice message to "hotdata update" for
all install methods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented May 23, 2026

Codecov Report

❌ Patch coverage is 47.61905% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/update.rs 41.17% 10 Missing ⚠️
src/main.rs 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@eddietejeda eddietejeda merged commit b059ae4 into main May 23, 2026
11 checks passed
@eddietejeda eddietejeda deleted the feat/update-background-check branch May 23, 2026 19:03
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