gengjiawen

#54739: docs: fix utilityProcess 'login' args and setSSLConfig minVersion values

Merged
Created: Oct 7, 2026, 8:47:31 PM
Merged: Oct 13, 2026, 9:44:41 AM
6 comments
Target: main

Description of Change

Two small API doc fixes. Both also change the generated electron.d.ts.

utilityProcess 'login' event is missing its event argument

UtilityProcessWrapper emits 'login' via gin_helper::EventEmitterMixin::Emit() (shell/browser/login_handler.cc), which prepends an Event. Listeners actually receive (event, authenticationResponseDetails, authInfo, callback), which is also what spec/api-utility-process.spec.ts destructures. As with app's 'login' event, the request is cancelled unless the listener calls event.preventDefault() (or calls callback synchronously).

The documented signature leaves out event, so the example passes credentials to authInfo and throws TypeError: callback is not a function. This PR adds event to the documented arguments, documents the preventDefault() requirement using the same wording as app's 'login', and fixes the example. The event was added in #51279.

ses.setSSLConfig() minVersion lists values that are rejected

The docs say minVersion can be tls1, tls1.1, tls1.2 or tls1.3, defaulting to tls1. In practice SSLProtocolVersionFromString() only accepts tls1.2 and tls1.3, and anything else makes setSSLConfig() throw. Chromium's network::mojom::SSLVersion only has kTLS12 and kTLS13, and SSLConfig defaults version_min to kTLS12. 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:docs passes, which includes regenerating electron.d.ts and running ts-smoke. I diffed the generated electron.d.ts before and after; the only changes are the five 'login' listener overloads on UtilityProcess and the minVersion type 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.fetch with session and respondToAuthRequestsFromMainProcess: true, and setSSLConfig() with each value.

    Case Result
    'login' listener arguments 4 args: Event (has preventDefault), details, authInfo, callback
    Example as currently documented TypeError: callback is not a function, request gets 401
    Async callback, no preventDefault() cancelled (401)
    Async callback with preventDefault() authenticated (200)
    setSSLConfig({ minVersion: 'tls1' / 'tls1.1' }) TypeError: Error processing argument at index 0, conversion failure
    setSSLConfig({ minVersion: 'tls1.2' / 'tls1.3' }) accepted

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 utilityProcess login and ses.setSSLConfig().

Backports

43-x-y
Merged
PR Number
#54881
Merged At
Oct 13, 2026, 11:53:48 AM
Released In
v43.7.11
Release Date
Oct 13, 2026, 6:40:36 PM
44-x-y
Merged
PR Number
#54880
Merged At
Oct 13, 2026, 11:53:46 AM
Released In
v44.7.2
Release Date
Oct 13, 2026, 6:39:49 PM
45-x-y
Merged
PR Number
#54882
Merged At
Oct 13, 2026, 11:53:49 AM
Released In
v45.0.0-beta.3
Release Date
Oct 13, 2026, 8:07:43 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron