matrix-org / matrix-org/matrix-js-sdk

getJoinedMembers() wrong displayName?

Open
#2,257 1 comment 0 reactions 0 assignees View on GitHub

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**
![image](https://user-images.githubusercontent.com/1106771/159719010-d977a266-0821-49be-8d47-daf76762870d.png)

**Desktop (please complete the following information):**
- OS: Linux
- Browser Firefox 97
- Version 16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.