Closed dcsan closed 5 years ago
We've hit this bug too, and its pretty annoying, is it going to get fixed ? ETA ?
I am using the PHP SDK, and I'm hitting the same bug. I thought it was because the rooms were private, but I can see from your dumps that it seems to affect all types of rooms. Please keep me posted on any updates.
I started implementing Chatkit and Channels only a few days ago, and I just wanted to say a big thank you to Pusher for a pretty solid product with very helpful documentation.
This behaviour actually is by design, though I'm the first to admit it makes more sense from the perspective of the client SDK than from the server SDK.
On the client, you can't see the members of a room unless you yourself are a member of the room, so getting a room from the context of a user (getUserRooms
) shows you the memberships, but getting all rooms irrespective of memberships (getRooms
) does not. However, from the perspective of the server SDK this distinction does seem a little pointless. I'll bring this up internally as a feature request. Thanks for bringing it to our attention!
Closing this issue because this is a feature request against the API, not an issue with the node SDK specifically.
haha, so there is method to the madness!
Hey guys, what's new with member_user_ids always null
issue?
@GlebkaF they said above it's by design... confusing though.
but @callum-oakley in that case it would be better to return a descriptive error message like not_a_member
somewhere?
How can i get rooms list with members via nodejs-sdk? I end up with this solution, but it's horrible:
const roomsWithMembers = Promise.all(chatkit.getRooms(...).map(({ id } ) => chatkit.getRoom({ roomId: id}))
What?
I'm using a query getRooms https://docs.pusher.com/chatkit/reference/server-node#get-rooms
this shows every room has an empty
member_user_ids
but when I iterate through the users, withgetUserRooms
it shows different info.This is after using your console, and also trying manually to add users to rooms.
Suggested improvements
If a user is in a room, then they should show up in that room when using the API to check room info.
for all rooms you can see the 'lobby' is supposedly empty:
when using a different API and checking a user's rooms, the lobby and other rooms now have members:
because of #39 I also tried it both ways:
Is there some weird options to the
chatkit.getRooms({})
that somehow masks the users in that room?FWIW I am connecting like this (in my own Class wrapper) It seems to accept a userId like the client lib, but this does not have any effect.
Basically seems that getRooms is not checking and lying on members, always null. This is a simple bug to fix I guess.