codebytere

#54506: fix: crashReporter.setUploadToServer() having no effect after start

Merged
Created: Sep 28, 2026, 4:57:54 AM
Merged: Sep 28, 2026, 12:36:12 PM
3 comments
Target: main

Description of Change

crashReporter.setUploadToServer() did not change whether crash reports were uploaded once crashReporter.start() had run. It only updated the consent flag on Electron's crash reporter client, which Crashpad reads once while it is being initialized; the handler decides per report from the uploads-enabled setting in the Crashpad database, and nothing wrote that setting again after start(). So getUploadToServer() reported the new value while reports written after setUploadToServer(false) were still uploaded, and reports written after setUploadToServer(true) on a reporter started with uploadToServer: false were not. This applies to macOS, Windows and Linux alike.

setUploadToServer() now also writes the value to the Crashpad database through crash_reporter::SetUploadConsent(), the same call start() goes through. Two specs crash the main process after toggling the setting in each direction; the spec crash server now records the reports it receives so the existing "should not send a minidump" assertion can fail.

Checklist

Release Notes

Notes: Fixed an issue where crashReporter.setUploadToServer() had no effect after crashReporter.start() was called.

Backports

44-x-y
In-flight
PR Number
#54518
Waiting to be merged
45-x-y
In-flight
PR Number
#54519
Waiting to be merged

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