Skip to content

fix(desktop): Windows updates wait out a signature check slowed by antivirus - #37461

Open
Sharad-Patel1 wants to merge 1 commit into
pingdotgg:mainfrom
Sharad-Patel1:fix/windows-signature-check-timeout
Open

Sharad-Patel1 wants to merge 1 commit into
pingdotgg:mainfrom
Sharad-Patel1:fix/windows-signature-check-timeout

Conversation

@Sharad-Patel1

@Sharad-Patel1 Sharad-Patel1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On a managed Windows machine with on-access endpoint security, an in-app update downloads to 100% and then never becomes ready to install (#20345). electron-updater checks the installer's signature with powershell.exe Get-AuthenticodeSignature and gives up after a hard-coded 20 s. The reporter in #20345 ran the same check with no limit on three fresh copies of the installer. Each took 54.4 to 56.0 s and then returned a valid signature.

Change

The electron-updater patch we already carry raises that limit to 120 s, about twice the slowest check the reporter measured. The lockfile picks up the new patch hash. No app code changes.

This is a smaller alternative to #25945, which keeps the 20 s limit and makes up to five attempts. I went with one longer check because of how the 20 s timeout plays out:

  • electron-updater runs the check through cmd.exe (shell: true), and Node's timeout kills only that process. On Windows 11 the PowerShell under it keeps running (Windows item 1 below). The reporter saw the same in their timeline for the one-retry build (fix(desktop): retry a timed-out Windows update signature check once #21273): the first check was still running when the retry started, and both timed out.
  • After each timed-out check, electron-updater runs a synchronous PowerShell probe (execFileSync, 10 s cap) on Electron's main process before it rejects. Each extra attempt adds one. The probe took about 0.4 s on a stock Windows 11 box. In the reporter's timelines, the gap after each kill, which includes the probe, was 2.0 to 7.7 s.

A hung check now times out at 120 s instead of 20 s, the probe runs, and the download fails. #25945 instead runs five 20 s attempts plus five probes. If the probe fails too, electron-updater skips validation, as it does on main. #25945 behaves the same on its first attempt and never accepts a skipped check on later attempts. With a single check there are no later ones.

Upstream still hard-codes 20 s in 6.8.11 (latest) and 6.8.12 (v26). Its 7.0.0-alpha.13 rewrite of this verifier uses 60 s and fails closed. The reporter found that anything under about 60 s fails on their machine, so on a move to 7.x I'd keep a longer limit.

Scope

Refs #20345, where a maintainer accepted the bug and named retrying after a timeout or verifying in-process as possible fix directions. A longer timeout is a third option. The reporter diagnosed the 20 s kill there, and their timelines are the basis for the numbers here. #25945 builds on that diagnosis and on the earlier retry in #21273. I'd keep the issue open until someone confirms this on a machine like the reporter's.

Verification

Windows 11, without a real antivirus hold. I ran electron-updater 6.8.9's real verifier on Windows 11 Pro with real cmd.exe and PowerShell, once as published and once with this PR's patch file applied by git apply (its hash matches the lockfile). The box runs only Windows Defender. The verifier accepted a local copy of the installed T3 Code exe in about 3 s, so this run did not reproduce the hold in #20345. To stand in for the hold, I injected Start-Sleep -Seconds 55 ahead of Get-AuthenticodeSignature in the command the verifier builds. That stand-in can't model #25945, since each of its retries would get its own 55 s sleep, so I ran only the published and patched verifiers. A real antivirus hold and a full in-app update are still unverified. The reporter offered in #20345 to test a candidate build.

  1. With the verifier's command shape and a 5 s timeout, Node called back at 5.0 s with killed: true. cmd.exe was gone, and its PowerShell kept running until it finished at 15.3 s.
  2. With the 55 s sleep injected, the published verifier's check timed out at 20.0 s and Node killed its cmd.exe. The verifier ran its probe in 372 ms and threw Command failed, the error NsisUpdater turns into a failed download. The killed check's PowerShell ran to the end of its injected sleep, 37 s later. The patched verifier accepted the same file at 56.9 s.
  3. Without the sleep, the patched verifier accepted a freshly written local copy of the T3 Code exe in 2.8 s, and the published verifier then accepted the same copy in 3.0 s. The patched one still rejects a wrong publisher.
  4. The probe (ConvertTo-Json test) took 307, 373 and 408 ms.

On macOS, comparing this branch (on main at 6b7027b1f4) with #25945's head 1d57f68aa8:

  1. The installed verifier passes { timeout: 120000, shell: true } to execFile on this branch and 20000 at fix(desktop): Windows updates survive a signature check slowed by antivirus #25945's head. I captured both by intercepting child_process.execFile.
  2. The patch applies to the npm 6.8.9 tarball with git apply --check. vp i --frozen-lockfile and vp run check:changed pass on this branch.
  3. A simulated download. T3's real ElectronUpdater.downloadUpdate runs over electron-updater's real installed verifier. Electron, the verifier wiring, electron-updater's download step, execFile and execFileSync are stubbed. Time runs 20× faster. Every probe succeeds and blocks for 2.0 s, the shortest gap between a 20 s kill and the next logged step in the reporter's timelines (2.0, 6.8 and 7.7 s).
Scenario Checkout Checks Main-process probes Modelled result
Every check times out #25945 head 5 × 20 s 5 fails at 111 s
Every check times out this branch 1 × 120 s 1 fails at 122 s
Scan ends at 55.8 s #25945 head 3 × 20 s, 2 timed out 2 accepted at 55.8 s
Scan ends at 55.8 s this branch 1 × 120 s 0 accepted at 55.8 s

The second model ends the scan at 55.8 s, the reporter's first uncapped trial. A check then returns a valid signature unless its timeout fires first. The model has a retry finish as soon as the scan ends, but in the reporter's #21273 run the overlapping retry finished about 10 s after the first check, so the model favours retrying. Both approaches get the signature accepted, and the retry path pays two main-process probes on the way.

No unit test. The change is one constant in vendored code, and docs/internals/testing.md says not to ask for one assertion per constant. The checks above exercise the value the installed verifier actually uses.

Scripts and output: Windows windows-verifier-proof.cjs and windows-evidence.txt. macOS repro.sh, signature-probe-count.mjs, verifier-timeout-and-orphan.cjs and evidence-logs.txt.

Council review

Rounds: 7

Delegate Round 1 Round 2 Round 3 Round 4 Round 5 Round 6 Round 7
Claude Opus 5.5 8.8/10 9.2/10 9.5/10 9.6/10 9.3/10 9.4/10 9.6/10
GPT-6.1 Sol 8.5/10 9.2/10 9.7/10 9.8/10 9.4/10 9.4/10 9.7/10
GPT-6.1 Terra 7.5/10 9.0/10 9.4/10 9.6/10 9.3/10 9.2/10 9.7/10
Claude Fable 5.2 no score (rate limited; replaced by Terra) not run not run not run not run not run not run

Rounds 5 to 7 reviewed the Windows evidence added after rounds 1 to 4.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

…tivirus

electron-updater kills its PowerShell Get-AuthenticodeSignature check after a
hard-coded 20 s. On-access antivirus can hold the first check of a freshly
downloaded installer for 51-56 s, so the update never becomes ready. Raise the
limit to 120 s in the existing electron-updater patch.

Refs pingdotgg#20345

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 16, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Windows updates will allow signature verification 120 seconds instead of 20, accommodating slow antivirus scans. This changes the updater's default waiting behavior; a human must accept the longer delay when verification stalls.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Electron updater patch adds idle-timeout handling for response streams, expands prerelease lookup with channel-pointer and GitHub API fallbacks, and increases the Windows signature-verification timeout from 20 to 120 seconds.

Changes: Electron updater changes

Layer / File(s) Summary
Windows signature verification timeout
patches/electron-updater@6.8.9.patch
verifySignature gives the PowerShell command a 120-second timeout instead of 20 seconds.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#25945: This PR retries timed-out Windows signature checks. The current change instead increases the timeout for the same check.

Suggested reviewers: macroscopeapp, juliusmarminge

Merge Risk: Minimal · up to 1e20f

This raises the Windows installer signature-check timeout from 20 to 120 seconds, so slow antivirus scans are less likely to fail updates. No merge-blocking risk was found. The change has not been checked on Windows.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Windows update signature checks get more time because antivirus slows them. The raw summary and objectives confirm the patch raises the Get-AuthenticodeSignature timeo…
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.
Description check Passed The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and each section has substantive content. The Problem section names the bug, the 20 s…
Full details: Title check

Explanation

The title names the main change: Windows update signature checks get more time because antivirus slows them. The raw summary and objectives confirm the patch raises the Get-AuthenticodeSignature timeout from 20 s to 120 s. The title uses the conventional commit form with a scope. The phrase 'wait out' is slightly informal but still describes the change.

Full details: Description check

Explanation

The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and each section has substantive content. The Problem section names the bug, the 20 s hard-coded limit, and the reporter's measurements. The Change section states the one-constant patch and its rationale against #25945. The Scope section links #20345 and #21273 and explains why no new issue is needed. The Verification section gives Windows and macOS checks with observed results, a table of simulated scenarios, and the scripts used. It also states what was not verified: a real antivirus hold and a full in-app update. The Problem section does not state the expected behavior in a single sentence, but the reproduction context and expected outcome are clear enough. The model and harness line is present, and it names the model and harness used. The description is detailed and somewhat long compared with the template, but it covers every required section and its information.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6b7027b and 1e20ff4.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 1

  • patches/electron-updater@6.8.9.patch

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant