Register a custom MSC4186 presence extension with the SlidingSync object so
that m.presence events delivered via extensions.presence.events are processed
into the SDK's User model on every poll.
Without this, the SlidingSync object only auto-registers ExtensionToDevice and
ExtensionAccountData (via SlidingSyncSdk), so presence payloads from the server
were silently discarded. Components using useUserPresence (Profile, MembersDrawer,
UserRoomProfile, UserHero, Presence) would always show stale/default presence.
The extension follows the same path as regular /sync: map raw events through
client.getEventMapper(), call user.setPresenceEvent() to update User state and
emit UserEvent.Presence, UserEvent.CurrentlyActive, UserEvent.LastPresenceTs,
then emit ClientEvent.Event on the client.
- Sort lists by notification level, recency, then name
- Add include_old_rooms for tombstoned room predecessor state
- Active-room custom subscription (timeline_limit=50) for the viewed room
- SlidingSyncManager.subscribeToRoom / unsubscribeFromRoom
- Export getSlidingSyncManager from initMatrix
- useSlidingSyncActiveRoom hook + SlidingSyncActiveRoomSubscriber component
- No changes to the classic sync path (startClassicSync / buildClient)
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).
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.
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.
- 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