matrix-org / matrix-org/matrix-js-sdk
getJoinedMembers() wrong displayName?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 704
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 40
Description
After the user enters the room, I want to update the Local Userlist.
Unfortunately after calling getJoinedMembers() I don't get the correct `displayName` of the user , it should be "Denis 123" but it`s only the userId(see picture)
```js
client.on('RoomMember.membership', function (event, member) {
if (
member.membership === 'join' &&
member.userId === client.getUserId()
) {
const room = client.getRoom(member.roomId);
room.getJoinedMembers().forEach((roomMember) => {
console.log('JOINED USER', roomMember.user);
});
}
});
```
**To Reproduce**
Steps to reproduce the behavior:
1. Invite User to the Room
2. Join/Auto Join Room with User
3. Get Room Members with getJoinedMembers()
4. displayName == userId
**Expected behavior**
DisplayName should be "Denis 123"
**Screenshots**

**Desktop (please complete the following information):**
- OS: Linux
- Browser Firefox 97
- Version 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the getJoinedMembers() implementation and the RoomMember.membership event handling in the matrix-js-sdk. Reproduce the reported join flow and inspect how displayName is populated for returned members. Done means getJoinedMembers() returns the expected "Denis 123" displayName rather than only the userId, with regression coverage if the existing tests support it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100