Skip to content

fix: avoid stale desktop auto-update checking state#1070

Open
anthhub wants to merge 1 commit intomainfrom
fix/desktop-auto-update-startup-state
Open

fix: avoid stale desktop auto-update checking state#1070
anthhub wants to merge 1 commit intomainfrom
fix/desktop-auto-update-startup-state

Conversation

@anthhub
Copy link
Copy Markdown
Contributor

@anthhub anthhub commented Apr 13, 2026

What

Fix desktop auto-update startup state so packaged macOS builds do not get stuck showing a stale checking/loading banner during automatic background update checks.

Why

On Apple Silicon packaged builds, the first visible update popup could remain in a checking/loading state for a long time before finally switching to downloading or ready. This made startup update UX feel broken and hid the real updater progress.

How

  • only emit update:checking for user-initiated update checks
  • keep automatic background checks silent in the main updater flow
  • expose typed update:get-status state through the desktop host bridge
  • hydrate the desktop auto-update hook from main-process status so renderer state catches up to background downloads / ready state
  • add regression tests for background checks staying silent and for hook status hydration

Affected areas

  • Desktop app (Electron shell)
  • Controller (backend / API)
  • Web dashboard (React UI)
  • OpenClaw runtime
  • Skills
  • Shared schemas / packages
  • Build / CI / Tooling

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes
  • pnpm generate-types run (if API routes/schemas changed)
  • No credentials or tokens in code or logs
  • No any types introduced (use unknown with narrowing)

Screenshots / recordings

  • Packaged arm64 + local mock feed regression now shows 正在下载更新… as the first visible update state instead of a stale checking/loading popup.

Notes for reviewers

  • Verified end-to-end with a packaged arm64 app against a local mock update feed.
  • Full local validation passed: pnpm typecheck, pnpm lint, pnpm test.

@sentry
Copy link
Copy Markdown

sentry bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/desktop/src/hooks/use-auto-update.ts 67.44% 14 Missing ⚠️
apps/desktop/main/updater/update-manager.ts 33.33% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a920109f82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/hooks/use-auto-update.ts
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