pusher/chatkit-android

usersForRoom returning no users on a room with 2 users

Closed this issue ยท 9 comments

After upgrading from 0.2.4 to 1.0.x (tried with both 1.0.3 and 1.0.5), currentUser.usersForRoom does not return any users, even though pusher's dashboard clearly says there are 2 users on the requested room.

Sample code:
Working -> v.0.2.4.txt
Not Working -> v1.0.x.txt

Same here.I've tried to create room and then add member to it, or add member while creating the room. Room is created, but getMemberUserIds() in both cases returns empty List.

Hi!

I'm experiencing the same issue here ๐Ÿ˜Ÿ

Is there any solution?

Thanks and best regards!

I've noticed that if you subscribe to a room and after that ask for members you'll get correct data. But still, currentUser without room subscription is not returning rooms with members.

Subscribing to the room does indeed solve the issue, but this not the documented behavior as per https://docs.pusher.com/chatkit/reference/android#user-properties.

Will use the workaround on the meantime.

Hi!

Room members are only populated after you subscribe to a room because there is a separate subscription established to get updates about memberships. The initial state event for this subscription contains the member list for the room that is then used to populate the list of members for the room. Following this, if there are more updates to a room such as a user leaving, or joining, they invoke the respective handlers and also update the member list.

I understand what you mean, but shouldn't that be what currentUser.usersForRoom is internally doing on each request? Otherwise what is the point of having said method?

Any update on this? This is such a simple feature yet not being fixed.

any update here ?

Hi, We added the feature to get usersForRoom without subscribing to the room in 1.9.0. Closing this issue out. If this is still an issue please contact support@pusher.com, and they can give you more direct help ๐Ÿ™‚