Wire onMembershipLeave to RoomMemberEvent.Membership in attach()/dispose().
When the local user leaves or is banned from a subscribed room, calls
unsubscribeFromRoom() which prunes timelines exceeding PRUNE_TIMELINE_THRESHOLD.
Previously, unsubscribeFromRoom() was dead code — nothing in the app called it.
Also add 5 unit tests covering: leave, ban, other-user leave, join (no-op),
and non-subscribed room (no-op).
Replace the adaptive 50/100/150 timeline limit system with a flat
ACTIVE_ROOM_TIMELINE_LIMIT=50, matching Element Web approach.
Stop calling unsubscribeFromRoom() on room navigation so subscriptions
accumulate across the session for instant room switching.
Element Web SlidingSyncManager.setRoomVisible() never removes subscriptions
at all -- no pruning whatsoever. Our PRUNE_TIMELINE_THRESHOLD=100 guard
is more conservative than their approach.
- Remove AdaptiveSignals type, readAdaptiveSignals(),
resolveAdaptiveRoomTimelineLimit(), applyRoomTimelineLimit()
- Remove adaptiveTimeline and configuredTimelineLimit class fields
- Remove adaptiveTimeline from SlidingSyncDiagnostics type and UI
- Stop unsubscribing on nav in useSlidingSyncActiveRoom
- Lower PRUNE_TIMELINE_THRESHOLD from 150 to 100
Two memory management issues fixed:
1. SlidingSyncManager.dispose() now calls this.slidingSync.stop() before
removing listeners. Without this the SDK's internal Promise loop keeps
polling the sliding sync proxy even after the client is disposed, leaking
network connections and preventing garbage collection.
2. pruneRoomTimeline() is called from unsubscribeFromRoom(). When a room
leaves the active subscription its EventTimeline chain can hold hundreds of
events in memory. Once the event count exceeds PRUNE_TIMELINE_THRESHOLD
(= ACTIVE_ROOM_TIMELINE_LIMIT_HIGH = 150) the live timeline is reset via
EventTimelineSet.resetLiveTimeline(). The full history remains on disk in
IndexedDBStore and is re-fetched via the active-room subscription on next
open, so there is no user-visible change.
Adds 5 unit tests: 1 for dispose, 4 for the pruning threshold boundary.
The scroll queued at TimelineReset fires when range.end=0 (SDK fires Reset
before populating the fresh timeline), so the DOM is empty and the scroll
is a no-op. The stay-at-bottom effect then correctly expands the range but
never re-queues a scroll, leaving the user at the wrong position.
Fix: increment scrollToBottomRef.count in the stay-at-bottom effect before
calling setTimeline. The next render sees the new count, the useLayoutEffect
fires, and scroll-to-bottom runs against the now-populated DOM.
Also adds monitoring:
- Sentry breadcrumb (ui.scroll) recording each range expansion + scroll,
with rangeGap, eventsLength, and wasReset fields for Replay analysis.
- slidingSync onFirstRoomData now records the live-timeline event count at
subscription activation time as a Sentry metric and breadcrumb, making
the list-to-subscription page size visible in dashboards.
- Add comprehensive sync cycle logging in slidingSync.ts:
- Track room count changes per list with deltas
- Log initial sync completion with timing and room counts
- Monitor list expansion progress with detailed stats
- Detect slow sync cycles (>1s) and expansions (>500ms)
- Track network connectivity changes with connection info
- Log attach/dispose lifecycle with diagnostics
- Add error logging for list operations
- Fix filter button closing settings dialog in DebugLogViewer:
- Add stopPropagation to category/level menu button handlers
- Prevents event bubbling that was closing parent dialog
- Add .envrc for automatic Node 24 environment activation via direnv
- Add .nvmrc to specify Node v24.14.0 requirement
- Change debugLoggerEnabledAtom from getter function to direct value atom to properly update UI
- Convert PopOut components from children function to anchor-based pattern
- Add click handlers for category and level filter menus
- Fix TypeScript errors with entry.data unknown type checks
- Filters should now display correctly when clicked
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)
Centralize Matrix SDK imports behind a local compatibility module, migrate matrix subpath imports to the boundary, and switch to the $types alias. Upgrade TypeScript to latest so matrix-js-sdk typings resolve correctly before the next cleanup phase.