Skip to content

fix(desktop): play Linux notification sounds from blob URLs - #6937

Open
Muammer06 wants to merge 5 commits into
block:mainfrom
Muammer06:fix/linux-notification-sounds
Open

fix(desktop): play Linux notification sounds from blob URLs#6937
Muammer06 wants to merge 5 commits into
block:mainfrom
Muammer06:fix/linux-notification-sounds

Conversation

@Muammer06

Copy link
Copy Markdown

Summary

Linux desktop notification sounds never play. WebKitGTK cannot load media from Tauri's custom URI scheme (tauri://localhost), so new Audio("/sounds/*.mp3") fails with MEDIA_ERR_SRC_NOT_SUPPORTED (code 4) and the empty catch swallows it. Settings preview still flips to pause, which is why this looks like "sound settings do nothing".

This loads each mp3 through fetch and plays from a blob: URL (allowed by media-src), caches the element, and plays the chosen alert even when OS toast delivery fails.

Related issue

Fixes #2562. Closest existing PR is #2691 (blob-URL sounds mixed with unrelated workflow mention parsing; not landed).

Testing

  • pnpm exec biome check on the six touched desktop files
  • node --import ./test-loader.mjs --experimental-strip-types --test src/features/notifications/lib/sound.test.mjs (7 passed)
  • pnpm exec tsc --noEmit in desktop/
  • Standalone WebKitGTK repro on this machine with desktop/public/sounds/flutter.mp3:
    • tauri://localhost/sounds/flutter.mp3MEDIA_ERROR readyState 0 code 4
    • fetch() + blob: URL → ENDED readyState 4

Manual: just desktop-standalone, then Settings → Notifications → play any alert sound.

WebKitGTK cannot load media from Tauri's custom URI scheme, so
`new Audio("/sounds/*.mp3")` fails with MEDIA_ERR_SRC_NOT_SUPPORTED
and the empty catch swallows it. Fetch the asset and play from a
blob: URL instead, and keep playing even when OS toast delivery
fails.

Fixes block#2562

Signed-off-by: Muammer <muammer@clonifylabs.com>
@Muammer06
Muammer06 requested a review from a team as a code owner August 27, 2026 12:42
Copilot AI lite review requested due to automatic review settings August 27, 2026 12:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…permission

WebKitGTK often reports Notification.permission as denied for tauri-dev
builds, which forced desktopEnabled off and skipped native posting. Linux
toasts already go through notify_rust; treat that path as granted, return
D-Bus show() errors to the frontend, and fall back to AudioContext when
HTMLAudio autoplay is blocked.

Signed-off-by: Muammer <muammer@clonifylabs.com>
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 80177e4c8e97e7bf1f1a3760c4e3503aace22860...f06767356d6a6ba5625bfefb1f07c9996bae22c6.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review f06767356d6a6ba5625bfefb1f07c9996bae22c6 to authorize a new review.
Any previous review applies only to its recorded range.

…wing

Settings preview is a click so HTMLAudio works. Live DM/mention alerts
have no gesture; WebKitGTK often resolves play() while staying silent.
Use the unlocked AudioContext for live playback, keep HTMLAudio for
preview, and still ding when the open conversation is focused.

Signed-off-by: Muammer <muammer@clonifylabs.com>
Add an All messages notification slot, on by default, so ordinary
channel posts play a sound and raise an OS toast. Android posts a local
notification with sound when that setting is on, and Windows uses the
same native toast path as Linux.

Signed-off-by: Muammer <muammer@clonifylabs.com>
Closing the main window hides to the system tray instead of quitting so
live alerts keep working. Register a login item on Linux and Windows
(with --hidden) so Buzz comes back after reboot. A second launch or
tray click restores the window; Quit Buzz from the tray still exits.

Signed-off-by: Muammer <muammer@clonifylabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Linux: notification sounds never play, WebKitGTK can't load media from Tauri's custom URI scheme (MEDIA_ERR_SRC_NOT_SUPPORTED)

2 participants