fix(desktop): deliver Windows notifications and clear false "blocked" banner - #6678
Open
Cynthia427 wants to merge 1 commit into
Open
fix(desktop): deliver Windows notifications and clear false "blocked" banner#6678Cynthia427 wants to merge 1 commit into
Cynthia427 wants to merge 1 commit into
Conversation
… banner On Windows the desktop app misreported notification permission and never posted native toasts, which also suppressed the in-app notification sound. - getDesktopNotificationPermissionState() trusted the WebView2 DOM Notification.permission, which defaults to "denied" on Windows even though native toasts are delivered by the Tauri notification plugin. That surfaced a false "Desktop notifications are blocked" banner and bounced the enable toggle; because no notification "sent", playNotificationSound() never fired. Read the plugin (the real delivery path here) as the source of truth on Windows instead. - sendDesktopNotification() posted only via the DOM Notification API on Windows, which WebView2 does not surface as an OS toast. Route Windows through the plugin's sendNotification (native Windows toast); click-through arrives via the existing onAction listener, and silent avoids doubling the in-app sound. Adds isWindowsPlatform(); macOS and Linux paths are unchanged. Signed-off-by: Cynthia Rohr <cynthia.r@kreativreason.co>
Chessing234
suggested changes
Aug 25, 2026
Chessing234
left a comment
Contributor
There was a problem hiding this comment.
sendNotification isn't awaited, so the try/catch never sees a plugin failure and you return true before the toast exists. also this overlaps #6689 which takes the native winrt path — please pick one.
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.
Problem
On Windows, the desktop app's Settings → Notifications pane shows two red banners at once — "Desktop notifications are blocked. Enable them in your system settings." and "Desktop notifications are blocked for Buzz…" — the enable toggle bounces straight back to off, and no notification sound ever plays. None of this is caused by the user's Windows settings, and no Windows setting can clear it.
Root cause
The app runs in WebView2 on Windows, whose DOM
Notification.permissionreports"denied"by default even though native toasts are actually delivered by the Tauri notification plugin (notification:defaultcapability, already wired up).getDesktopNotificationPermissionState()trusted that DOM value before ever consulting the plugin, so it returned"denied"on Windows → the "blocked" banner shows and the enable toggle is refused.sendDesktopNotification()bails out early on a non-grantedstate,didSendisfalse, soplayNotificationSound()(an in-app<audio>element, independent of the OS toast) never fires — hence no sound.sendDesktopNotification()posted only via the DOMNotificationAPI on Windows, which WebView2 does not surface as an OS toast.macOS (WKWebView, native UN delegate) and Linux (WebKitGTK, D-Bus backend) don't hit this because their permission and delivery paths differ.
Fix
isPermissionGranted()) as the source of truth instead of the misleading WebView2 DOM value. Clears both banners, unblocks the toggle, and lets the in-app sound play.sendNotification()(native Windows toast). Click-through arrives via the existingonActionlistener (already registered for non-Linux/non-macOS), which reads the target fromextra;silent: trueavoids doubling the app's own notification sound.isWindowsPlatform()helper. macOS and Linux paths are unchanged.Test plan
tsc --noEmit— cleantauri devrun.