addMembers does not include any user properties
Describe the bug
In demo, addMembers does not include the user properties but the id
Dev environment info (please complete/provide the following information):
- Package version (stream-chat-react-native/stream-chat-expo): 3.6.0
- react-native or expo version: 0.64.2
- Device/Emulator (android/ios) and OS version: iphonesimulator 14.5
To Reproduce Steps to reproduce the behavior:
- Go to any channel with appropriate access
- Go to channel info screen
- Add any new member
- Observe the new member entry is a blank row
- In
channel.state.member, all other additional properties are missing.
Expected behavior
User data should be queried and included in channel.state.member list. Either addMember should accept User object with additional properties or handle the query of the user and populate the properties by id
gz#13722
Has this issue been looked into? @vishalnarkhede This also happens when you update the channel server-side.
e.g.
Server: Receive webhook events after channel.created and promote the creator of the channel to a moderator.
Client: Channel receives ws push, then the updated user object within member is reduced to id only without other properties(name, image,...custom properties).
Hi,
Thanks for reaching out.
We haven't been able to reproduce this issue unfortunately. In the channel.state.members array, each member object contains the banned status, channel_role, created_at, few other fields and the user object attached to the member. This user object should contain all the properties related to the user.
This is the way the API is currently implemented, are you having a different behaviour?
Best,
Hi,
Since we are not directly integrating with the js-lib but the rn-components, we can provide you a simple demo here, it was freshly cloned and using the latest packages as of today. Please let me know if more details need to be provided.
https://user-images.githubusercontent.com/27749440/126355734-b126769d-f2ac-4716-944f-f13ae754fc4f.mp4
In: https://github.com/GetStream/stream-chat-js/blob/master/src/channel.ts
As the event may not contain the full properties of a user, whenever there's an update on the member, the properties in the user will be replaced with the incomplete one from the event.
case 'member.added':
case 'member.updated':
if (event.member?.user_id) {
channelState.members[event.member.user_id] = event.member;
}
Hi,
Thanks for reaching out. We haven't been able to reproduce this issue unfortunately. In the
channel.state.membersarray, each member object contains thebannedstatus,channel_role,created_at, few other fields and the user object attached to the member. This user object should contain all the properties related to the user. This is the way the API is currently implemented, are you having a different behaviour?Best,
@SeniYG Updated my example above. Hopefully, it can help you resolve this issue swiftly.
@StronkMan thanks for reaching out, this issue slipped through. Is this issue still relevant with the latest versions of our RN SDK and Chat JS client?
@StronkMan I'll be closing this issue due to inactivity Please don't hesitate to contact us in the future if this issue or any questions arise.