-
Notifications
You must be signed in to change notification settings - Fork 289
[Feature] Automatically fetch full members list for rooms when needed #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This requires an Basically the following + a way to get a generic output of the task: pub trait Executor {
fn spawn(future: F) -> Task;
} Possibly also a |
Do we? I don't see why, an executor is only needed to run things in parallel, since we support WASM we can't just use I don't think there's parallelism needed in #143, unless I'm misunderstanding something. |
@poljar Maybe i wasn't clear in #143 about this part, but I think the timeline should also be automatically loaded if the request can't be fulfilled with the information in the I actually assumed that the |
I understand that, but why do you need to The methods are already async, where does an executor come into place? |
Ah right, I noted this issue to be a general "load the members from the server", not a "load the members when the user requests them" issue. We can add this without the executor, but I would like to load the members after a sync response so the members are available in the general case. So after a sync, check rooms that need the members to be fetched, and fire out all the requests at once +/- a delay. Sorry for being confused. |
@poljar I was about to write that i'm confused now :) |
If we load the the members immediately (or with a delay) after a sync response, i think we reduce the usefulness of lazy-loading the room members and could directly include them in the sync request. To make full use of lazy-loading we should load the members only when they are actually needed or maybe when nothing more important needs to be loaded. |
Since |
The usefulness of lazy loading is to lower the amount of data a client needs to handle on an initial sync (ideally it would do so for all sync but currently synapse doesn't do any lazy loading on subsequent syncs), an initial sync lets you display the room list. Spawning tasks after the initial sync is done to fetch room members won't block anything else and when the client wants to display a room fully, including the member list, the members will likely already be loaded thus reducing the delay we would otherwise have to display a room. |
That still leaves the possibility that client receives an incomplete members list (even when unlikely) which I really would like to avoid. |
What do you mean? When would that occur? |
When the client needs the member list immediately after the "initial" sync. to me it sounds like a race condition. |
Well the method would need to be locked per room, so you can have only one of them in flight and the |
works for me :) |
matrix_sdk_base::Room
has methods to get the members of a room, but they only return members stored in theStateStore
, but the stored list may be incomplete if lazy-loading is used.The client developer can request the full list from the matrix server if they like, but I think we should do the request for them automatically.
I would suggest adding an boolean argument to
Room::joined_user_ids()
,Room::active_members()
,Room.get_member()
,Room::joined_members()
for letting the user decide whether to automatically request the full member list, when not already stored, before return any result or return without making a request to the Matrix server.The text was updated successfully, but these errors were encountered: