Repository navigation
docs: fix utilityProcess 'login' args and setSSLConfig minVersion values - #54739
Merged
jkleinsc merged 2 commits intoOct 13, 2026
Merged
Conversation
UtilityProcess emits 'login' through gin_helper::EventEmitterMixin::Emit(), which prepends an Event object, so listeners receive (event, authenticationResponseDetails, authInfo, callback). As with app's 'login' event, the request is cancelled unless the listener calls event.preventDefault() or invokes the callback synchronously. The documented signature omitted `event`, so the example called `authInfo` as the callback and threw "TypeError: callback is not a function". Since electron.d.ts is generated from these docs, the listener type was wrong as well. Assisted-By: Claude Opus 5.5, Claude Code
SSLProtocolVersionFromString() only accepts "tls1.2" and "tls1.3"; any other minVersion fails argument conversion and setSSLConfig() throws a TypeError. Chromium's network::mojom::SSLVersion only has kTLS12 and kTLS13, and SSLConfig defaults version_min to kTLS12. Assisted-By: Claude Opus 5.5, Claude Code
|
Release note looks good now. |
jkleinsc
approved these changes
Oct 13, 2026
|
Release Notes Persisted
|
|
Congrats on merging your first pull request! 🎉🎉🎉 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #54880 |
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #54881 |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54882 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of Change
Two small API doc fixes. Both also change the generated
electron.d.ts.utilityProcess'login'event is missing itseventargumentUtilityProcessWrapperemits'login'viagin_helper::EventEmitterMixin::Emit()(shell/browser/login_handler.cc), which prepends anEvent. Listeners actually receive(event, authenticationResponseDetails, authInfo, callback), which is also whatspec/api-utility-process.spec.tsdestructures. As withapp's'login'event, the request is cancelled unless the listener callsevent.preventDefault()(or callscallbacksynchronously).The documented signature leaves out
event, so the example passes credentials toauthInfoand throwsTypeError: callback is not a function. This PR addseventto the documented arguments, documents thepreventDefault()requirement using the same wording asapp's'login', and fixes the example. The event was added in #51279.ses.setSSLConfig()minVersionlists values that are rejectedThe docs say
minVersioncan betls1,tls1.1,tls1.2ortls1.3, defaulting totls1. In practiceSSLProtocolVersionFromString()only acceptstls1.2andtls1.3, and anything else makessetSSLConfig()throw. Chromium'snetwork::mojom::SSLVersiononly haskTLS12andkTLS13, andSSLConfigdefaultsversion_mintokTLS12. This PR corrects the docs, and the generated type narrows from'tls1' | 'tls1.1' | 'tls1.2' | 'tls1.3'to'tls1.2' | 'tls1.3'.Verification
yarn lint:docspasses, which includes regeneratingelectron.d.tsand running ts-smoke. I diffed the generatedelectron.d.tsbefore and after; the only changes are the five'login'listener overloads onUtilityProcessand theminVersiontype and doc comment.I checked the runtime behavior against the released Electron v44.6.0 (linux-x64) with a small app: a local server that returns 401, a utility process that calls
net.fetchwithsessionandrespondToAuthRequestsFromMainProcess: true, andsetSSLConfig()with each value.'login'listener argumentsEvent(haspreventDefault), details, authInfo, callbackTypeError: callback is not a function, request gets 401callback, nopreventDefault()callbackwithpreventDefault()setSSLConfig({ minVersion: 'tls1' / 'tls1.1' })TypeError: Error processing argument at index 0, conversion failuresetSSLConfig({ minVersion: 'tls1.2' / 'tls1.3' })AI assistance: these changes were drafted with Claude Code (Claude Opus 5.5). I reviewed them and verified the behavior as described above.
Checklist
Release Notes
Notes: Fixed TypeScript types for
utilityProcessloginandses.setSSLConfig().