Skip to content

fix(updater): humanize update-error card and hide raw error behind Show details - #9248

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/windows-update-error-fix
Jul 18, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/windows-update-error-fix

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Windows auto-update failures surfaced the raw electron-updater error as the card headline — most visibly the PowerShell Command failed: … Get-AuthenticodeSignature … dump that appears when antivirus/EDR blocks the post-download signature check. That reads like a crash, not an actionable state, and gives the user nothing to do.

This reshapes the error card to lead with one plain-language sentence + the right action, and keeps the raw error one click away behind a Show details caret. Mirrors how mature Electron updaters present failures (a friendly line, not a stack trace) while keeping the raw text reachable for support.

What changed

  • New shared classifier (src/shared/updater-windows-signature-check.ts): distinguishes an AV/EDR-blocked signature check (environment — safe to retry) from a genuine wrong-publisher mismatch (a security stop). The two are mutually exclusive, so a real integrity failure is never softened into "try again".
  • UpdateCard.tsx: raw error moves behind a Show details caret disclosure that sits directly above the action buttons and expands the last-error block in place; adds a security-stop variant (wrong publisher → no retry, "Open official releases") and the AV-blocked variant ("Update Verification Blocked"). HTTP/2 and generic paths keep their existing actions with the same disclosure.
  • Main process records a windows_signature_check_blocked lifecycle event so we can size the affected Windows cohort in the field.

Validation

Tests (classifier + UpdateCard), pnpm typecheck, and full pnpm lint (incl. localization gates) all green. Each error scenario was driven in a running Electron build and screenshotted:

Signature check blocked (AV/EDR) — the common Windows failure
signature check blocked

Show details expanded — caret reveals the raw error in place, buttons pinned below
show details expanded

Wrong-publisher signature mismatch — security stop, no retry
security stop

Generic failure — one line + retry, raw error hidden
generic

HTTP/2 blocked — existing compatibility action, unchanged
http2

Scope / follow-ups

Deliberately scoped to the renderer error-card UX. Two ideas from the design exploration are left as separate follow-ups because they touch different subsystems:

  • A "Finishing update…" state with a Restart now button for the install/restart-freeze case (needs main-process install-phase state + IPC; targets a different bug than this).
  • The one-line "installs when you quit" reassurance on the ready-to-install card.

…ow details

Windows auto-update failures surfaced the raw electron-updater message as the
card headline — most visibly the PowerShell "Command failed: … Get-Authenticode
Signature …" dump when antivirus/EDR blocks the post-download signature check.
That reads as a crash, not an actionable state.

Classify each failure and lead with one plain-language sentence + the right
action, keeping the raw error one click away:

- New shared classifier (updater-windows-signature-check): distinguishes an
  AV/EDR-blocked signature check (environment) from a genuine wrong-publisher
  mismatch (security). The two are mutually exclusive so a real integrity
  failure is never softened into "try again".
- UpdateCard: raw error moves behind a collapsed "Show details" toggle; adds a
  security-stop variant (wrong publisher → no retry, "Open official releases")
  and the AV-blocked variant ("Update Verification Blocked"). HTTP/2 and generic
  paths keep their existing actions, now with the same details disclosure.
- Main process records a windows_signature_check_blocked lifecycle event so we
  can size the affected Windows cohort in the field.

Verified each error scenario in a running Electron build (signature-check
blocked, wrong-publisher security stop, HTTP/2, generic, and the expanded
details view).
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Windows signature errors now have dedicated classifiers for publisher mismatches and unavailable signature checks. The main updater records a warning lifecycle event for blocked checks and initializes download status before starting downloads. The renderer categorizes these failures with security, retry, and compatibility states, supports explanatory and expandable detail content, and allows custom manual-download labels. English, Spanish, Japanese, Korean, and Chinese locales receive new error-card strings. Tests cover classifier behavior, download state transitions, and updated error-card interactions.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description has useful content but misses required template sections like Summary, Testing checklist, AI Review Report, Security Audit, and Notes. Reformat it to the repo template and add the missing Summary, Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main UX update: humanized updater errors with a hidden raw-error details toggle.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Move the raw-error toggle directly above the Retry/Download buttons and give it
a rotating chevron; the Last error block now expands in place beneath the caret
instead of appearing above the summary, with the action buttons pinned below.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
src/renderer/src/components/UpdateCard.error-card.test.tsx (1)

85-85: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Assert the presence of the updated copy instead of the absence of the old copy.

It appears this assertion was updated to check that the old copy ("Windows verifies the installer..." from the PR description) is absent after the text was changed. To ensure the component renders the correct message, consider asserting the presence of the new summary text instead.

♻️ Proposed refactor
-    expect(screen.queryByText(/Windows verifies the installer/)).toBeNull()
+    expect(screen.getByText(/get the installer from our official releases/)).toBeTruthy()
src/shared/updater-windows-signature-check.test.ts (1)

55-63: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a combined-message test for the guard's core case.

The mutual-exclusivity test uses two disjoint messages. The scenario the early-return guard actually protects — a single message containing both Get-AuthenticodeSignature and not signed by the application owner (electron-updater typically spawns the command and then reports the mismatch) — isn't exercised. That's the case where misclassification would soften a security stop, so it's worth asserting explicitly.

🧪 Suggested test
it('classifies a message with both the command and the mismatch phrase as mismatch only', () => {
  const combined =
    'Command failed: powershell.exe ... Get-AuthenticodeSignature ...; ' +
    'New version 1.4.144 is not signed by the application owner: publisherNames: X'
  expect(isWindowsSignatureMismatchFailure(combined)).toBe(true)
  expect(isWindowsSignatureCheckUnavailableFailure(combined)).toBe(false)
})
src/renderer/src/components/UpdateCard.tsx (1)

375-375: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Untranslated user-facing strings bypass the localization catalog.

Several summaries/titles in the error-card branches are raw literals while their siblings use translate(...): the HTTP/2 summary (Line 375), and the generic branch title/summary (Lines 428-431), plus 'Could not restart to install the update.' (Line 452). Notably 'Update Error' is localized at Line 451 but raw at Line 428. Since the HTTP/2 card previously used a single translated message, moving to a raw summary is an i18n regression for that copy — non-English users will now see English here. Wrap these in translate(...) so the sync catalog picks them up.

Also applies to: 428-431


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 018e8ca6-3716-4ece-8287-6ce63af46503

📥 Commits

Reviewing files that changed from the base of the PR and between 613dcd8 and 6e3e5e3.

📒 Files selected for processing (10)
  • src/main/updater.ts
  • src/renderer/src/components/UpdateCard.error-card.test.tsx
  • src/renderer/src/components/UpdateCard.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/updater-windows-signature-check.test.ts
  • src/shared/updater-windows-signature-check.ts
👮 Files not reviewed due to content moderation or server errors (1)
  • src/renderer/src/i18n/locales/ja.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 59a73b31-635b-40b4-988c-0fd24f57b3e3

📥 Commits

Reviewing files that changed from the base of the PR and between 6e3e5e3 and 9c16511.

📒 Files selected for processing (3)
  • src/main/updater.test.ts
  • src/main/updater.ts
  • src/renderer/src/components/UpdateCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/UpdateCard.tsx

Comment thread src/main/updater.test.ts
Comment on lines +1182 to +1184
autoUpdaterMock.downloadUpdate
.mockRejectedValueOnce(new Error('signature check blocked'))
.mockImplementationOnce(() => new Promise(() => {}))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use an accurate error message to trigger the signature check classifier.

Although this test correctly verifies generic retry behavior, the mock error string 'signature check blocked' does not match the new isWindowsSignatureCheckUnavailableFailure classifier (which checks for 'get-authenticodesignature'). As a result, the windows_signature_check_blocked lifecycle event described in the PR is bypassed here.

Consider updating the mock error to match a real PowerShell failure so the test fully exercises the error pipeline:

.mockRejectedValueOnce(new Error('Command failed: ... Get-AuthenticodeSignature ...'))

@brennanb2025
brennanb2025 merged commit 24ac5a5 into main Jul 18, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ow details (stablyai#9248)

* fix(updater): humanize update-error card and hide raw error behind Show details

Windows auto-update failures surfaced the raw electron-updater message as the
card headline — most visibly the PowerShell "Command failed: … Get-Authenticode
Signature …" dump when antivirus/EDR blocks the post-download signature check.
That reads as a crash, not an actionable state.

Classify each failure and lead with one plain-language sentence + the right
action, keeping the raw error one click away:

- New shared classifier (updater-windows-signature-check): distinguishes an
  AV/EDR-blocked signature check (environment) from a genuine wrong-publisher
  mismatch (security). The two are mutually exclusive so a real integrity
  failure is never softened into "try again".
- UpdateCard: raw error moves behind a collapsed "Show details" toggle; adds a
  security-stop variant (wrong publisher → no retry, "Open official releases")
  and the AV-blocked variant ("Update Verification Blocked"). HTTP/2 and generic
  paths keep their existing actions, now with the same details disclosure.
- Main process records a windows_signature_check_blocked lifecycle event so we
  can size the affected Windows cohort in the field.

Verified each error scenario in a running Electron build (signature-check
blocked, wrong-publisher security stop, HTTP/2, generic, and the expanded
details view).

* fix(updater): make Show details a caret disclosure above the action row

Move the raw-error toggle directly above the Retry/Download buttons and give it
a rotating chevron; the Last error block now expands in place beneath the caret
instead of appearing above the summary, with the action buttons pinned below.

* fix(updater): prevent signature-check bypass

* fix(updater): surface retry start immediately
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