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. That run used the patch from before this branch was rebased onto main (hash d7d7b5d0, recorded in the evidence). The rebase brought in #38038's download hunks in the same file and left the verifier hunk unchanged. 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.

After rebasing onto main at 21a96989b0, I re-ran 1 to 3 on this branch and got the same results, except that the scan model finished at 55.9 s instead of 55.8 s.

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

@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 timeout retries and resume handling for stalled downloads, 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. The command and subsequent error handling remain unchanged.

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

Change: Bug fix

Possibly related issues

Possibly related PRs

  • pingdotgg/t3code#25945: That PR retries timed-out Windows signature checks. This patch raises the timeout for the same check.

Suggested labels: bugfix

Suggested reviewers: macroscopeapp, shivamhwp, juliusmarminge

Merge Risk: Minimal · up to 38405 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title is a conventional-commit style summary that matches the change: the Windows signature check timeout for electron-updater is raised so updates wait out an antivirus-slowed check. The raw summ…
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 is thorough and follows the template's main sections. Problem: it explains that on managed Windows machines with on-access endpoint security, an in-app update stalls at 100% because el…
Full details: Title check

Explanation

The title is a conventional-commit style summary that matches the change: the Windows signature check timeout for electron-updater is raised so updates wait out an antivirus-slowed check. The raw summary describes a broader patch (retries, resumable downloads, GitHub provider channel scanning), which the title does not mention, so the title covers only part of the changeset. The title itself is specific and clear.

Full details: Description check

Explanation

The description is thorough and follows the template's main sections. Problem: it explains that on managed Windows machines with on-access endpoint security, an in-app update stalls at 100% because electron-updater's hard-coded 20 s limit on the PowerShell Get-AuthenticodeSignature check expires. Change: it raises the limit to 120 s via the existing patch and updates the lockfile hash, and it explains why this was chosen over the retry approach in #25945. Scope: it links #20345 and states the bug is accepted by a maintainer. Verification: it gives detailed Windows 11 and macOS checks with observed timings, states what was not verified (a real antivirus hold and a full in-app update), and notes that no unit test was added with a reason. The template asks for the model and harness at the end when an agent was used; the author gives 'Created with Claude Opus 5.5 in Claude Code (T3 Code)', which satisfies that. The description is long and includes a council review table that is not in the template, but the required information is present.

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 1e20ff4 and 384052e.

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; 9 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

This PR conflicts with main. Rebase it or merge main into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

See the conflict window.

@github-actions github-actions Bot added the needs-rebase Conflicts with its base branch. Closes after 7 days with no activity. label Nov 23, 2026
…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>
@Sharad-Patel1
Sharad-Patel1 force-pushed the fix/windows-signature-check-timeout branch from 1e20ff4 to 384052e Compare November 25, 2026 11:30

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

needs-rebase Conflicts with its base branch. Closes after 7 days with no activity. 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