Repository navigation
fix(desktop): Windows updates survive a signature check slowed by antivirus #25945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
juliusmarminge
wants to merge
7
commits into
main
Choose a base branch
from
fix/issue-20345
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cd5790f
test(desktop): reproduce Windows update failing when the signature ch…
juliusmarminge 2d79f44
fix(desktop): Windows updates survive a slow first signature check
juliusmarminge 718cd67
fix(desktop): retry a signature check the capability probe skipped in…
juliusmarminge 3d9adb5
Merge remote-tracking branch 'origin/main' into fix/issue-20345
juliusmarminge e8754f1
Merge remote-tracking branch 'origin/main' into fix/issue-20345
juliusmarminge a4537c8
Merge remote-tracking branch 'origin/main' into fix/issue-20345
juliusmarminge 1d57f68
Merge remote-tracking branch 'origin/main' into fix/issue-20345
juliusmarminge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: pingdotgg/t3code
Length of output: 2996
Script executed:
Repository: pingdotgg/t3code
Length of output: 22021
Web query:
raw electron-updater 6.8.9 windowsExecutableCodeSignatureVerifier.ts electron-userland electron-builderResult:
Script executed:
Repository: pingdotgg/t3code
Length of output: 37226
Handle timeout-induced skips on the first attempt without retrying every upstream skip.
electron-updater@6.8.9already resolvesnullwhen both signature execution and itsConvertTo-Jsoncapability probe fail.NsisUpdatertreatsnullas success, so the direct first-attempt return leaves this timeout path unaddressed. The PR does not introduce this fail-open behavior; it preserves an upstream behavior.Do not detect every
Ignoring signature validationwarning. That would retry and eventually reject legitimate skips, including unsupported PowerShell versions. Detect the timeout marker in the warning instead, and run attempt 1 through that detector.Suggested fix
const verifyDetectingSkip = async (publisherNames: Array<string>, path: string) => { const logger = updater.logger; - let skipped = false; + let timedOutSkip = false; updater.logger = { info: (message) => logger?.info(message), warn: (message) => { - // After a timeout, a failed capability probe makes electron-updater warn and resolve null unchecked. - skipped ||= String(message).includes("Ignoring signature validation"); + const text = String(message); + timedOutSkip ||= text.includes("Ignoring signature validation") && text.includes("ETIMEDOUT"); logger?.warn(message); }, error: (message) => logger?.error(message), debug: (message) => logger?.debug?.(message), }; try { const result = await verify(publisherNames, path); - return { result, skipped }; + return { result, timedOutSkip }; } finally { updater.logger = logger; } }; const verifyWithRetry: VerifyUpdateCodeSignature = async (publisherNames, path) => { for (let attempt = 1; ; attempt++) { const lastAttempt = attempt === SIGNATURE_CHECK_ATTEMPTS; try { - if (attempt === 1) return await verify(publisherNames, path); - const { result, skipped } = await verifyDetectingSkip(publisherNames, path); - if (!skipped) return result; - if (lastAttempt) return "Signature validation was skipped after a timed-out check."; + const { result, timedOutSkip } = await verifyDetectingSkip(publisherNames, path); + if (!timedOutSkip) return result; + if (lastAttempt) return "Signature validation was skipped after a timed-out check."; } catch (error) { if (!isTimedOut(error) || lastAttempt) throw error; } } };Add coverage for a timeout-induced skip on attempt 1 and for an unsupported-PowerShell skip that remains a single accepted upstream result.