Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Improve room list performance when receiving messages #1801

Merged
merged 2 commits into from
Mar 15, 2018

Conversation

lukebarnard1
Copy link
Contributor

@lukebarnard1 lukebarnard1 commented Mar 14, 2018

In summary this makes RoomTiles (and RoomAvatars) do more for
themselves in terms of reacting individually to state changes in
the js-sdk.

Instead of force updating the entire room list for avatar changes
and room name changes, do this in the RoomTile and RoomAvatar
instead. This increases the number of listeners listening to the
matrix client, but allows us to properly implement a
shouldComponentUpdate for RoomTile (because the avatar, name and
notification count are now in component state).

Mitigates element-hq/element-web#6060

In summary this makes RoomTiles (and RoomAvatars) do more for
themselves in terms of reacting individually to state changes in
the js-sdk.

Instead of force updating the entire room list for avatar changes
and room name changes, do this in the RoomTile and RoomAvatar
instead. This increases the number of listeners listening to the
matrix client, but allows us to properly implement a
shouldComponentUpdate for RoomTile (because the avatar, name and
notification count are now in component state)
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Leaving it to you to merge with tests as appropriate.

@dbkr dbkr assigned lukebarnard1 and unassigned dbkr Mar 14, 2018
@lukebarnard1
Copy link
Contributor Author

@lampholder says we can merge following his QA

@lukebarnard1 lukebarnard1 merged commit 0d7099f into develop Mar 15, 2018
lukebarnard1 added a commit to element-hq/element-web that referenced this pull request Mar 16, 2018
so that the notification count is updated.

Previously we relied on a force update from RoomList, which was
removed as part of the optimisations in
  matrix-org/matrix-react-sdk#1801
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants