fix(desktop): play Linux notification sounds from blob URLs - #6937
Open
Muammer06 wants to merge 5 commits into
Open
fix(desktop): play Linux notification sounds from blob URLs#6937Muammer06 wants to merge 5 commits into
Muammer06 wants to merge 5 commits into
Conversation
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>
…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>
🔐 Codex Security Review
|
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Linux desktop notification sounds never play. WebKitGTK cannot load media from Tauri's custom URI scheme (
tauri://localhost), sonew Audio("/sounds/*.mp3")fails withMEDIA_ERR_SRC_NOT_SUPPORTED(code 4) and the emptycatchswallows it. Settings preview still flips to pause, which is why this looks like "sound settings do nothing".This loads each mp3 through
fetchand plays from ablob:URL (allowed bymedia-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 checkon the six touched desktop filesnode --import ./test-loader.mjs --experimental-strip-types --test src/features/notifications/lib/sound.test.mjs(7 passed)pnpm exec tsc --noEmitindesktop/desktop/public/sounds/flutter.mp3:tauri://localhost/sounds/flutter.mp3→MEDIA_ERRORreadyState 0 code 4fetch()+blob:URL →ENDEDreadyState 4Manual:
just desktop-standalone, then Settings → Notifications → play any alert sound.