diff --git a/src/client.js b/src/client.js index e2bf224c2..6f8d2251a 100644 --- a/src/client.js +++ b/src/client.js @@ -768,6 +768,14 @@ MatrixClient.prototype.loadRoomMembersIfNeeded = async function(roomId) { return; } const joinedMembersPromise = this.joinedMembers(roomId); + // XXX: we should make sure that the members we get back represent the + // room state at a given point in time. The plan is to do this by + // passing the current next_batch sync token to the endpoint we use + // to fetch the members. For now, this is a prototype that uses + // the /joined_members api, which does not support this synchronization, + // so there is a race condition here between the current /sync call + // and the /joined_members call: if the have conflicting information, which one + // represents the most recent state? const membersPromise = joinedMembersPromise.then((profiles) => { return Object.entries(profiles.joined).map(([userId, profile]) => { return {