In-app message toasts only appear if the browser's notification permission is granted, so people who declined (or were never asked) get no in-app toasts #324

Closed
opened 2026-10-05 17:57:50 -04:00 by jared · 1 comment
Owner

MessageNotifications.deliverNotification (src/app/pages/client/ClientNonUIFeatures.tsx:~638) only calls notify(...) inside

if (showNotifications && notificationPermission('granted')) { notify({...}) }

notify is what shows the in-app toast when the window is focused (if (document.hasFocus()) { setToast(...); return; }, line ~524). It falls back to an OS notification only when the window isn't focused. An in-page toast needs no permission, but it's gated on the OS one.

Measured: a focused page in another room, showNotifications: true, and Notification.permission denied (also what a user who clicked "Block" gets). Bob sends a DM and no toast appears (polled 8 s). The sound still plays (playSound isn't gated), so you hear a ping with nothing on screen.

On the web, this hits everyone who hasn't enabled browser notifications. Many people decline the prompt precisely because they only want in-app cues. The desktop app is unaffected because its bridge grants the permission. Invite toasts (InviteNotifications, line ~251) follow the same pattern; worth checking together.

Fix: split the two: show the in-app toast whenever the window is focused and showNotifications is on, and require notificationPermission('granted') only for the OS-notification path. Test with permission denied: a toast should appear for a message in another room.


Found in the October 2026 client audit (Playwright against a local Synapse + LiveKit stack, plus code reading). Code refs are at cinny 30e2dbcd, cinny-desktop 8f67ec7, element-call 3b0050e8.

`MessageNotifications.deliverNotification` (src/app/pages/client/ClientNonUIFeatures.tsx:~638) only calls `notify(...)` inside ```ts if (showNotifications && notificationPermission('granted')) { notify({...}) } ``` `notify` is what shows the **in-app toast** when the window is focused (`if (document.hasFocus()) { setToast(...); return; }`, line ~524). It falls back to an OS notification only when the window isn't focused. An in-page toast needs no permission, but it's gated on the OS one. **Measured:** a focused page in another room, `showNotifications: true`, and `Notification.permission` **denied** (also what a user who clicked "Block" gets). Bob sends a DM and **no toast appears** (polled 8 s). The sound still plays (`playSound` isn't gated), so you hear a ping with nothing on screen. On the web, this hits everyone who hasn't enabled browser notifications. Many people decline the prompt precisely because they only want in-app cues. The desktop app is unaffected because its bridge grants the permission. Invite toasts (`InviteNotifications`, line ~251) follow the same pattern; worth checking together. **Fix:** split the two: show the in-app toast whenever the window is focused and `showNotifications` is on, and require `notificationPermission('granted')` only for the OS-notification path. Test with permission denied: a toast should appear for a message in another room. --- _Found in the October 2026 client audit (Playwright against a local Synapse + LiveKit stack, plus code reading). Code refs are at cinny `30e2dbcd`, cinny-desktop `8f67ec7`, element-call `3b0050e8`._
jared added the priority: lowuxarea: notifications labels 2026-10-05 17:57:50 -04:00
Author
Owner

Confirmed the other half with headed Chromium (permission really granted, page focused): the in-app toast does appear for a DM while in another room. So the toast works only when the OS permission is granted, and never when it's denied or never asked, as described above.

Confirmed the other half with headed Chromium (permission really **granted**, page focused): the in-app toast does appear for a DM while in another room. So the toast works only when the OS permission is granted, and never when it's denied or never asked, as described above.
jared closed this issue 2026-10-18 03:06:13 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#324