Skip to content

fix(updater): make CLI updates resilient and actionable#52

Merged
francoischalifour merged 2 commits into
mainfrom
fc/debug-auto-update-crash
Jul 13, 2026
Merged

fix(updater): make CLI updates resilient and actionable#52
francoischalifour merged 2 commits into
mainfrom
fc/debug-auto-update-crash

Conversation

@francoischalifour

Copy link
Copy Markdown
Member

Context

Automatic CLI update checks could crash otherwise successful commands when configuration or update-state persistence failed. Atomic writes also created temporary files outside the destination directory, which could cause cross-filesystem rename failures.

The updater experience had several related issues:

  • Update notices were only displayed during a fresh daily network check, so cached updates disappeared from subsequent commands.
  • Help output bypassed update notices entirely.
  • update --clear-cache cleared the state but returned without performing the promised fresh check.
  • Source checkouts recommended an unnecessarily verbose package-manager command and rejected the simpler altertable update --install flow.
  • Native release binaries were version-checked only after replacing the existing executable.
  • Human output included unnecessary installation and release metadata.

Proposed solution

This change makes the updater resilient, safe, and more actionable:

  • Contain the complete automatic-check path so updater failures never interrupt the user’s command.
  • Create temporary state and replacement files beside their destinations to preserve atomic same-filesystem renames.
  • Keep the network refresh cadence daily while displaying cached update availability on eligible interactive commands until the user upgrades.
  • Show cached update notices after root and subcommand help output.
  • Make update --clear-cache immediately perform a fresh release check.
  • Recommend altertable update --install unless a package-manager installation is positively detected.
  • Route source checkouts through the detected package manager internally so the recommended command remains actionable.
  • Verify downloaded native binaries before replacing the current executable.
  • Preserve checksum validation, backup-and-rename replacement, and rollback behavior.
  • Reduce human-facing update output to the version summary and installation command.

User-visible behavior

When an update is available:

image

Prevent automatic update checks from interrupting successful commands when configuration, cache persistence, or release discovery fails. Keep atomic temporary files beside their destinations so writes and replacements stay on the same filesystem.

Verify downloaded native binaries before replacing the current executable, preserve rollback behavior, and route source checkouts through the detected package manager while recommending the concise self-update command.

Simplify human-facing update output, reuse cached availability between daily network checks, show notices after help, and make --clear-cache perform an immediate refresh. Add regression coverage for failure containment, installation routing, binary verification, cached notices, and command output.
@francoischalifour francoischalifour enabled auto-merge (squash) July 13, 2026 13:12
@francoischalifour francoischalifour merged commit 5d0c0af into main Jul 13, 2026
8 of 9 checks passed
@francoischalifour francoischalifour deleted the fc/debug-auto-update-crash branch July 13, 2026 13:14
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.

2 participants