fix(lint): fix ESLint errors in ExtensionPresence and add changeset
This commit is contained in:
1 parent
8f8502a536
commit
6271bb79ee
2 files changed
+19
-2
No files matched your search
@@ -0,0 +1,13 @@
|
||||
---
|
||||
sable: minor
|
||||
---
|
||||
|
||||
Rewrites the sliding sync implementation to match the Element Web approach (MSC4186).
|
||||
|
||||
- Room list sorted by notification level, recency, then name
|
||||
- `include_old_rooms` added so tombstoned rooms pass predecessor state to replacements
|
||||
- Active-room custom subscription: focused room receives `timeline_limit=50`
|
||||
- `subscribeToRoom` / `unsubscribeFromRoom` API on `SlidingSyncManager`
|
||||
- `useSlidingSyncActiveRoom` hook + `SlidingSyncActiveRoomSubscriber` component
|
||||
- Registers a custom `ExtensionPresence` so `m.presence` events from the server are processed into the SDK's `User` model — fixes components using `useUserPresence` always showing stale/default presence
|
||||
- Always reinitialises the timeline on `TimelineRefresh` events to fix a silent hang where the room timeline stops updating after a reconnect
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
import {
|
||||
ClientEvent,
|
||||
Extension,
|
||||
@@ -243,16 +244,19 @@ const getListEndIndex = (list: MSC3575List | null): number => {
|
||||
class ExtensionPresence implements Extension<{ enabled: boolean }, { events?: object[] }> {
|
||||
public constructor(private readonly mx: MatrixClient) {}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
public name(): string {
|
||||
return 'presence';
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
public when(): ExtensionState {
|
||||
// Run after the main response body has been processed so room/member state is ready.
|
||||
return ExtensionState.PostProcess;
|
||||
}
|
||||
|
||||
public async onRequest(_isInitial: boolean): Promise<{ enabled: boolean }> {
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
public async onRequest(): Promise<{ enabled: boolean }> {
|
||||
return { enabled: true };
|
||||
}
|
||||
|
||||
@@ -261,7 +265,7 @@ class ExtensionPresence implements Extension<{ enabled: boolean }, { events?: ob
|
||||
const mapper = this.mx.getEventMapper();
|
||||
data.events.forEach((rawEvent) => {
|
||||
const event = mapper(rawEvent as Parameters<typeof mapper>[0]);
|
||||
const userId = event.getSender() ?? (event.getContent() as { user_id?: string }).user_id;
|
||||
const userId = event.getSender() ?? (event.getContent().user_id as string | undefined);
|
||||
if (!userId) return;
|
||||
let user = this.mx.store.getUser(userId);
|
||||
if (user) {
|
||||
|
||||
Reference in new issue
Block a user