Member count in room details is wrong if list is not loaded
When opening the room details of a room, before the members list is loaded from the homeserver, we only show the number of members we have locally. However we should have from sync the number of joined (and invited) members. It is available via the SDK with BaseRoom::joined_members_count()
.
See this screenshot where the number of members is initially 88 when opening the dialog, but after the list is loaded it goes up to 2012 (which seems wrong too, it's the whole number of members we have, ignoring the membership state, but we should only count the joined members).
Also it seems that opening the list doesn't work, I often get a blank screen, although we should be able to see the members we have locally. If we make that work, we also need to tell the user that we don't have all the members and we are trying to load them.
So, the to-do list is:
-
Use the members count from sync if the members are not synced. We could also use it when they are synced, if the number is reliable. -
If we don't use the count from sync, only display the number of joined members. -
Make sure that members show up when the member list is opened before it is downloaded, and make sure that receiving the full list is handled gracefully. As a last resort, we could deactivate the members list while it is loading. -
Tell the user when we don't have the full list.