fix(notifications): notification delivery and routing fixes#99
Open
Just-Insane wants to merge 9 commits intoSableClient:devfrom
Open
fix(notifications): notification delivery and routing fixes#99Just-Insane wants to merge 9 commits intoSableClient:devfrom
Just-Insane wants to merge 9 commits intoSableClient:devfrom
Conversation
ec938e2 to
6fd0dc7
Compare
8335b46 to
634d9d8
Compare
added 9 commits
March 9, 2026 21:39
… audio, media session) - resolveSilent = () => false — OS/Sygnal handles push sound entirely; the in-app sound setting no longer affects push notification sound - remove notificationSoundEnabled from SW postMessage payload - move OS notification block before visibilityState guard so desktop notifications fire even when the browser window is minimised - pass isEncryptedRoom:false for in-app banner preview — events are already decrypted by the SDK so the actual message body is always shown - call clearMediaSessionQuickly() after play() to dismiss the iOS lock screen media player; only clears playbackState if no real media metadata is set
… sound tweak Two bugs caused by sliding sync's limited required_state (only $ME member): 1. DM badge was grey instead of green Synapse sends highlight_count=0 for DMs without mention; the badge only showed as Success (green) when highlight>0. DMs should always display the green badge for any unread. Fix: RoomNavItem treats direct && total>0 as highlight for the UnreadBadge highlight prop. 2. DM OS notification was silent PushProcessor evaluates .m.rule.room_one_to_one by checking room_member_count==2, but with only m.room.member/$ME in required_state the member count is 1, so the rule fails. Events fall through to .m.rule.message (notify, no sound), leaving loudByRule=false and the OS notification silent:true. Fix: isLoud = loudByRule || isDM so that known DM rooms always produce non-silent notifications when sounds are on.
…ual mentions/replies
useNotificationJumper was using roomToParents.get(roomId) — the direct parent set — which could be a subspace rather than a root-level space. The router only recognises /space/<root-space-id>/room paths, so linking via a subspace ID would hit JoinBeforeNavigate instead of opening the room. Replace with the same logic as useRoomNavigate: getOrphanParents() walks the full hierarchy to find root-level spaces, guessPerfectParent() picks the best one to route through.
…p in try/catch
Two bugs caused in-app notifications to silently vanish on desktop when
the window was focused:
1. window.Notification() was called unconditionally even when the window
had focus. In some browsers/environments (certain Chrome versions,
Electron, macOS DnD mode) calling the Notification constructor throws
or is silently rejected when the tab is active. Without a try/catch
the uncaught exception aborted the entire RoomEvent.Timeline handler
before setInAppBanner was ever reached — so neither the OS notification
NOR the in-app banner appeared. InviteNotifications already used
try/catch for the same reason; MessageNotifications did not.
2. The OS notification was semantically wrong when focused: the in-app
banner is the correct alert while the window is active. Added a
!document.hasFocus() guard to match the comment's stated intent
("alert when minimised or tab not active") and to prevent a duplicate
OS+in-app banner when another window is simply on top.
Mobile is unaffected: mobileOrTablet() already gates the OS block.
The in-app banner path (visibilityState === 'visible' → setInAppBanner)
is unchanged and continues to fire correctly on both desktop (focused)
and mobile (app visible in browser).
634d9d8 to
f655498
Compare
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.
A collection of notification reliability fixes.
useNotificationJumperusesgetOrphanParentsandguessPerfectParentto navigate correctly to threaded/nested events, avoiding the JoinBeforeNavigate dead-end caused by navigating via a sub-spaceunread.highlight > 0); unreads without a mention show count or dot per user badge settings