-
-
Notifications
You must be signed in to change notification settings - Fork 832
Make RoomListStore aware of Room.timeline events #1756
Conversation
so that we can do reorderings of lists ordered by most recent event. No optimisations here; we only update for timeline events on live timelines that could update the "unread count".
if (toStartOfTimeline) return; | ||
if (!room) return; | ||
if (data.timeline.getTimelineSet() !== room.getUnfilteredTimelineSet()) return; | ||
this._delayedRefreshRoomList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These checks seem to have disappeared, as well as the _delayedRefreshRoomList?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So:
- the
_delayedRefreshRoomList
is done when we get an update from RoomListStore; - the timeline set check I thought would be handle by
isLiveEvent
? Unless I've got that confused? toStartOfTimeline
this is handled byisLiveEvent
, which includes!toStartOfTimeline
.!room
nothing uses theroom
, so I'll remove it from the MatrixAction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, OK. I think this almost all true apart from the timeline set check, where live timeline !== unfiltered timeline set. There are multiple timeline sets, the first is the unfiltered one (the normal one that isn't a search result). Each timeline set has many timelines, one of which is live. liveEvent
is telling you if it's to the live timeline in a timeline set, not if it's to the timeline set you're interested in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in theory we shouldn't get live events for search result or any other timeline set apart from the unfiltered one. We're not sure how true this is though. Investigation of exactly when Room.timeline is emitted will have to be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seemingly this isn't true, as @dbkr has said, each set (be it a room timeline, notification timeline, rooms timeline) has a live timeline, and the only way of us knowing which is the room's live timeline if by comparing references.
Only do so for the live timeline of rooms.
!payload.isLiveUnfilteredRoomTimelineEvent || | ||
!this._eventTriggersRecentReorder(payload.event) | ||
) break; | ||
this._generateRoomLists(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't _generateRoomLists have a ratelimiter on it? surely this is quite a heavy operation, and we shouldn't be doing it each and every time a live timeline event happens?
so that we can do reorderings of lists ordered by most recent event.
No optimisations here; we only update for timeline events
on live timelines that could update the "unread count".
Fixes element-hq/element-web#6132