codebytere

#47162: fix: remove extra 'suspend'/'resume' handling from powerMonitor

Merged
Created: May 20, 2025, 8:52:20 AM
Merged: May 21, 2025, 10:00:39 AM
4 comments
Target: main

Description of Change

Closes #44252.

'suspend'/'resume' handling was added initially to electron_api_power_monitor_{win|mac} prior to base::PowerSuspendObserver being added upstream - these events are now emitted via OnSuspend and OnResume and the extra handling causes them to be emitted twice. On Windows, for example, resuming after sleeping shows:

The system is resuming
The system is resuming

Checklist

Release Notes

Notes: Fixed an issue where the 'suspend' and 'resume' events could be emitted in duplicate.

Backports

35-x-y
Merged
PR Number
#47190
Merged At
May 22, 2025, 1:31:19 PM
Released In
v35.5.0
Release Date
May 28, 2025, 11:03:13 AM
36-x-y
Merged
PR Number
#47189
Merged At
May 22, 2025, 5:37:09 AM
Released In
v36.3.0
Release Date
May 22, 2025, 8:18:58 AM
37-x-y
Merged
PR Number
#47188
Merged At
May 22, 2025, 12:01:18 AM
Released In
v37.0.0-alpha.6
Release Date
May 22, 2025, 10:18:26 AM

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