#53131: fix: deliver macOS notifications without an icon when the attachment fails
Description of Change
Fixes #52295
Since the UserNotifications rewrite (#47817) a notification's icon is turned into a UNNotificationAttachment on the image task runner, and that step returns nil when the temporary PNG can't be written under the user data dir or +attachmentWithIdentifier:URL:options:error: fails. The reply on the UI thread put the result straight into @[ attachment ], so a nil there raised NSInvalidArgumentException and took down the browser process.
The notification is now scheduled without attachments when the icon couldn't be attached, and the failure is logged under --enable-logging notification debugging.
Checklist
- I have filled out the PR description
- I have reviewed and verified the changes
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Fixed a crash on macOS when a notification's icon could not be attached; the notification is now shown without the icon.
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