Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cache-sliding-sync-room-metadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Cache room banners, abbreviations, power-level labels, and widgets for faster sliding sync warm starts.
5 changes: 5 additions & 0 deletions src/client/slidingSyncSidebarCache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { MatrixClient, MSC3575RoomData, SlidingSync } from '$types/matrix-sdk';
import { EventType, MatrixEvent, SlidingSyncEvent } from '$types/matrix-sdk';
import { CustomAccountDataEvent } from '$types/matrix/accountData';
import { CustomStateEvent } from '$types/matrix/room';

const CACHE_VERSION = 1;
const CACHE_KEY_PREFIX = 'sable.slidingSyncSidebarCache.';
Expand Down Expand Up @@ -37,6 +38,10 @@ const CACHED_STATE_TYPES = new Set<string>([
EventType.RoomServerAcl,
EventType.SpaceChild,
EventType.SpaceParent,
CustomStateEvent.PowerLevelTags,
CustomStateEvent.RoomWidget,
CustomStateEvent.RoomAbbreviations,
CustomStateEvent.RoomBanner,
]);

const emptyCache = (): SidebarCacheData => ({
Expand Down
Loading