Skip to content

fix: hex-encode Windows notification icon temp filenames#50454

Merged
VerteDinde merged 2 commits intomainfrom
fix-win-icon
Mar 25, 2026
Merged

fix: hex-encode Windows notification icon temp filenames#50454
VerteDinde merged 2 commits intomainfrom
fix-win-icon

Conversation

@codebytere
Copy link
Copy Markdown
Member

@codebytere codebytere commented Mar 24, 2026

Description of Change

Refs #48768
Closes #50424

NotificationPresenterWin was using SHA1HashString(origin.spec()) directly as the basename for the temporary PNG written for toast icons.

SHA1HashString returns raw digest bytes, so the generated filename could contain invalid path characters on Windows. That caused WriteFile to fail when saving notification icons, which left toast XML without the expected icon path.

Hex-encode the digest before appending .png so the temporary filename is filesystem-safe while keeping deterministic naming for a given origin.

Checklist

Release Notes

Notes: Fixed a bug where Windows notification icons could fail to save because their temporary filenames contained invalid characters.

NotificationPresenterWin was using SHA1HashString(origin.spec()) directly
as the basename for the temporary PNG written for toast icons.

SHA1HashString returns raw digest bytes, so the generated filename could
contain invalid path characters on Windows. That caused WriteFile to fail
when saving notification icons, which left toast XML without the expected
icon path.

Hex-encode the digest before appending .png so the temporary filename is
filesystem-safe while keeping deterministic naming for a given origin.
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels Mar 24, 2026
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 24, 2026
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Mar 25, 2026
@VerteDinde VerteDinde merged commit ec3a18d into main Mar 25, 2026
63 of 64 checks passed
@VerteDinde VerteDinde deleted the fix-win-icon branch March 25, 2026 16:30
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 25, 2026

Release Notes Persisted

Fixed a bug where Windows notification icons could fail to save because their temporary filenames contained invalid characters.

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 25, 2026

I have automatically backported this PR to "42-x-y", please check out #50482

@trop trop bot added in-flight/42-x-y and removed target/42-x-y PR should also be added to the "42-x-y" branch. labels Mar 25, 2026
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 25, 2026

I have automatically backported this PR to "41-x-y", please check out #50483

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 25, 2026

I have automatically backported this PR to "40-x-y", please check out #50484

@trop trop bot added in-flight/41-x-y in-flight/40-x-y and removed target/41-x-y PR should also be added to the "41-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. in-flight/41-x-y labels Mar 25, 2026
@trop trop bot added merged/41-x-y PR was merged to the "41-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/40-x-y in-flight/42-x-y labels Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Icon in Windows Notification does not appear

4 participants