#55725: fix: remove notification observer from the center it was registered on
Requested by John Kleinschmidt · Slack thread
Description of Change
Request ids for macOS notification subscriptions come from a single counter shared by the distributed, local and workspace notification centers. When an id was unsubscribed through a different method than the one it was subscribed with (for example, an id from subscribeLocalNotification passed to unsubscribeNotification), DoUnsubscribeNotification erased the subscription but called removeObserver on the caller's notification center rather than the one the observer was registered on, so the observer stayed registered for the life of the process. It now removes the observer from the center stored with the subscription, as ClearNotificationSubscriptions already does, and the now-unused kind parameter is dropped.
This was found by a review bot while backporting #55629 (#55680). No spec was added because the leak isn't observable from JS: with the subscription erased, the callback no longer fires either way.
Checklist
- I have filled out the PR description
- I have reviewed and verified the changes
Release Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01Vf2yMwv2LMkF9YULfTdXCy
Notes: Fixed a macOS notification observer leak when unsubscribing via another method.
Backports
Semver Impact
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