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.