increase the timeout for background clients to 60s, separates them into their own store, and makes sliding sync respect the setting instead of the client setting, and hopefully better management
adds a startup timeout of 45s to the main loading screen to prevent anything from getting stuck behind that which may or may not actually do anything.
so much writing for such little change :(
### Description
Fixes several timeline bugs introduced after the
timeline-reset-on-navigation refactor:
- Scroll-to-bottom no longer gets stuck after navigating to a room
- Timeline pagination no longer uses a stale timeline chain after a
sliding sync reset
- URL preview requests are deduplicated so the same URL only fires one
network request
- Removed a redundant spidering call that was generating an extra
sliding sync request per room visit
Fixes #
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [x] Partially AI assisted (GitHub Copilot)
`RoomTimeline.tsx`: Added a `liveTimelineLinked` guard so the initial
scroll doesn't fire with stale data from the previous room, and a
`pendingReadyRef` that defers `setIsReady(true)` when `processedEvents`
is still empty (preventing the room opening at position 0).
`useTimelineSync.ts`: A `useEffect` resets the timeline state on room
change so revisited rooms aren't stuck with `liveTimelineLinked =
false`. Reads `linkedTimelines` fresh after each `await` in pagination
so a sliding sync reset mid-paginate doesn't cause count comparisons on
a detached chain. A `continuing` flag prevents two concurrent pagination
calls from racing on the lock. URL preview dedup uses a module-level
`Map` to share in-flight promises for the same URL. Removed a redundant
`startSpidering` subscription call in the sync setup path.
The Matrix SDK for sliding sync deliberately does not call resetLiveTimeline()
on limited:true (the handling is in a commented-out TODO block). This means
events from a previous visit remain in the live timeline and new events get
appended after them, with the backward pagination token pointing to the gap
between old and new events rather than to before all events. The result is
that new messages appear out of order or the gap is unreachable via the UI.
Two fixes:
1. useSlidingSyncActiveRoom: reset the live timeline synchronously before
the subscription request is sent on room navigation. This ensures the
fresh initial:true response populates a clean timeline, not one polluted
with events from the previous visit. Also removes the 100ms delay that
was added as an incomplete workaround for the same issue.
2. SlidingSyncManager.onLifecycle: in RequestFinished state (fires before
any room data listeners run), reset the live timeline for active-room
subscriptions that receive initial:true or limited:true. This covers the
reconnect/background case where the pos token expires and all active rooms
get a fresh initial:true in the same sync cycle.
- Add StateEvent.RoomAbbreviations ('moe.sable.room.abbreviations')
- Include abbreviations event in sliding sync required state
- Add AbbreviationsPage to RoomSettingsPage enum
- New RoomAbbreviations settings page (add/remove term+definition pairs)
- Wire page into RoomSettings.tsx menu
- New useRoomAbbreviations hook + RoomAbbreviationsContext
- Provide context in Room.tsx
- RenderBody.tsx: highlight defined terms in plain-text messages with
TooltipProvider+abbr tooltip; HTML messages unaffected
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.