feat(sliding-sync): rewrite MSC4186 sliding sync to match Element Web approach#101
Open
Just-Insane wants to merge 6 commits intoSableClient:devfrom
Open
feat(sliding-sync): rewrite MSC4186 sliding sync to match Element Web approach#101Just-Insane wants to merge 6 commits intoSableClient:devfrom
Just-Insane wants to merge 6 commits intoSableClient:devfrom
Conversation
60acbfd to
4f00fdc
Compare
bc369dc to
9ad69ac
Compare
6f03387 to
049dea2
Compare
added 6 commits
March 9, 2026 21:39
- 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)
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.
049dea2 to
57905d7
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.
Rewrites the sliding sync implementation to more closely match how Element Web handles MSC4186 simplified sliding sync. The classic sync path (
startClassicSync) is not modified.Sliding sync improvements (
slidingSync.ts,initMatrix.ts)include_old_roomsadded so tombstoned rooms pass predecessor state to their replacementstimeline_limit=50; all other rooms use the default list subscriptionSlidingSyncManager.subscribeToRoom()/unsubscribeFromRoom()API for per-room subscription lifecyclegetSlidingSyncManager()exported frominitMatrixuseSlidingSyncActiveRoomhook +SlidingSyncActiveRoomSubscribercomponent to wire the active room into the sliding sync subscriptionPresence extension (
slidingSync.ts)ExtensionPresenceand registers it with theSlidingSyncobjectSlidingSyncSdkonly auto-registersExtensionToDeviceandExtensionAccountData, soextensions.presence.eventspayloads from the server were silently discarded — components usinguseUserPresencewould always show stale/default presenceclient.getEventMapper(), callsuser.setPresenceEvent()to updateUserstate, and emitsClientEvent.Event— matching the classic sync presence path exactlySlidingSyncManager.setPresenceEnabled()exposes an enable/disable toggle (consumed by the presence toggle in feat(presence): presence status setting #108)Timeline reliability (
RoomTimeline.tsx,ClientNonUIFeatures.tsx)TimelineRefreshevents (previously guarded by a staleliveTimelinereference check)