Repository navigation
fix(updater): humanize update-error card and hide raw error behind Show details - #9248
Conversation
…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).
📝 WalkthroughWalkthroughWindows 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)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
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.
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/renderer/src/components/UpdateCard.error-card.test.tsx (1)
85-85: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAssert 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 winAdd 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-AuthenticodeSignatureandnot 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 winUntranslated 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/2summary(Line 375), and the generic branchtitle/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 translatedmessage, moving to a rawsummaryis an i18n regression for that copy — non-English users will now see English here. Wrap these intranslate(...)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
📒 Files selected for processing (10)
src/main/updater.tssrc/renderer/src/components/UpdateCard.error-card.test.tsxsrc/renderer/src/components/UpdateCard.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/updater-windows-signature-check.test.tssrc/shared/updater-windows-signature-check.ts
👮 Files not reviewed due to content moderation or server errors (1)
- src/renderer/src/i18n/locales/ja.json
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 59a73b31-635b-40b4-988c-0fd24f57b3e3
📒 Files selected for processing (3)
src/main/updater.test.tssrc/main/updater.tssrc/renderer/src/components/UpdateCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/components/UpdateCard.tsx
| autoUpdaterMock.downloadUpdate | ||
| .mockRejectedValueOnce(new Error('signature check blocked')) | ||
| .mockImplementationOnce(() => new Promise(() => {})) |
There was a problem hiding this comment.
📐 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 ...'))…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
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
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.windows_signature_check_blockedlifecycle event so we can size the affected Windows cohort in the field.Validation
Tests (classifier + UpdateCard),
pnpm typecheck, and fullpnpm 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

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

Wrong-publisher signature mismatch — security stop, no retry

Generic failure — one line + retry, raw error hidden

HTTP/2 blocked — existing compatibility action, unchanged

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: