Skip to content

🤖 fix: surface update errors with phase-aware feedback#2358

Merged
ibetitsmike merged 11 commits intomainfrom
mike/update-error-feedback
Feb 11, 2026
Merged

🤖 fix: surface update errors with phase-aware feedback#2358
ibetitsmike merged 11 commits intomainfrom
mike/update-error-feedback

Conversation

@ibetitsmike
Copy link
Contributor

@ibetitsmike ibetitsmike commented Feb 11, 2026

Summary

Adds user-facing feedback when update operations fail, plus a DEBUG_UPDATER_FAIL flag to test error states locally.

Background

Follow-up to #2335 (moved update controls into About dialog). Several failure modes were identified:

  • downloadUpdate() / installUpdate() could throw without emitting an UpdateStatus.error
  • TitleBar had no icon for the error state — failures were invisible unless the About dialog was open
  • Transient errors during manual "Check for Updates" silently reverted to idle, identical to background auto-checks — users couldn't tell if the check actually ran
  • No easy way to test error UI locally in dev mode

Implementation

Schema: phase-aware errors

  • Extended UpdateStatusSchema error variant with phase: "check" | "download" | "install" so the UI can tailor messaging and retry CTAs.

Backend: source-aware checks + error emission

  • update.check now accepts { source?: "auto" | "manual" }:
    • Auto checks (background polling): transient errors still silently back off to idle (no spam)
    • Manual checks (user clicks): transient errors surface as { type: "error", phase: "check" } so the user gets feedback
  • Wrapped downloadUpdate() and installUpdate() in try/catch to emit proper error statuses with the relevant phase instead of silently throwing
  • All error paths throughout the updater now include the phase field

UI: discoverable errors

  • About dialog open behavior: Opening About now uses existing streamed update state and does not force a manual check; update checks occur only when the user clicks Check for Updates.
  • TitleBar: Added AlertTriangle badge icon when updateStatus.type === "error" — failures are now visible even with the About dialog closed
  • About dialog: Phase-aware error section with tailored copy and retry CTAs:
    • Check errors → "Update check failed" + "Try again"
    • Download errors → "Download failed" + "Retry download" + "Check again"
    • Install errors → "Install failed" + "Try install again" + "Check again"

DEBUG_UPDATER_FAIL — dev-mode failure simulation

New env var to exercise error UI locally:

DEBUG_UPDATER=1.0.0 DEBUG_UPDATER_FAIL=check    make dev  # check fails
DEBUG_UPDATER=1.0.0 DEBUG_UPDATER_FAIL=download  make dev  # download fails at ~40%
DEBUG_UPDATER=1.0.0 DEBUG_UPDATER_FAIL=install   make dev  # install fails

Only takes effect when DEBUG_UPDATER is set with a fake version string. Extended parseDebugUpdater() to parse the fail phase and gated simulation in each fake path.

Validation

  • make static-check — all checks pass
  • bun test src/desktop/updater.test.ts — 25 tests pass (includes new source/phase + fail simulation tests)
  • bun test ./tests/ui/aboutDialog.integration.test.ts — 7 tests pass (includes 3 new error phase tests)

Risks

Low. Changes are additive — the phase field is new, and source input is optional (existing call sites passing undefined remain valid). DEBUG_UPDATER_FAIL is dev-only and gated behind DEBUG_UPDATER.


Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: xhigh • Cost: $4.77

Copy link

@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: c7b6b2194a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike
Copy link
Contributor Author

@codex review

Copy link

@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: c455bdd779

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Upgrade in-flight checking source to manual when a skipped manual request arrives, and map downloaded-state updater errors to install phase.

Added regression tests for both cases in updater.test.ts.
@ibetitsmike
Copy link
Contributor Author

@codex review

Copy link

@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: c02478ef2e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike
Copy link
Contributor Author

@codex review

1 similar comment
@ibetitsmike
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike ibetitsmike added this pull request to the merge queue Feb 11, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 11, 2026
@ibetitsmike
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike ibetitsmike added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit 8193c67 Feb 11, 2026
23 checks passed
@ibetitsmike ibetitsmike deleted the mike/update-error-feedback branch February 11, 2026 22:06
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