pusher / chatkit-client-js

JavaScript client SDK for Pusher Chatkit
https://pusher.com/chatkit
MIT License
90 stars 15 forks source link

Room-based presence #169

Closed senky closed 5 years ago

senky commented 5 years ago

Your presentation page says: Snímka obrazovky 2019-05-13 o 12 02 11

Easily display which users are online or offline in your rooms or across the whole chat app.

But I don't see any option to get room-only presence list in the SDK docs. How can I get it?

neuropass commented 5 years ago

I would like to know this as well. I see no documentation about this specifically. - Right now the only code I came up with is the have online for all rooms. But this is a problem because X user might not be on X room. So its totally inaccurate. Please advice on a how to get the online list for each room when the user is currently on X room only. @vivangkumar @callum-oakley

neuropass commented 5 years ago

hey guys, please any help on this? some code example this is suppose to work as advertised? @hamchapman @callum-oakley @mdpye @vivangkumar - . For example in order to know a user status, I must subscribe to the room. But that is the problem! in order to subscribe to the room, a room must be created and this creates max RPS errors from Pusher. Its like a dog eating his own tail. It does look like you can work with presence in a clean way. A very small community based app starting from for example 500 users, its just not possible to create tons of rooms and iterate through the presence as you get RPS errors all over.

Rate Limited: Status code: 429 -> Too many requests being made in quick succession (max 100 RPS).
info: {error: "rate_limit_reached", error_description: "Rate limit had been reached.", error_uri: "https://docs.pusher.com/errors/rate_limit_reached"}

statusCode: 429

e Prototype
etc etc

so either I'm not using the API correctly or this is absolutely not realistic the way Pusher built this feature and its not gonna work for any medium size groups.

So if you please guys can shed some light on code proper code usage regarding the presence/rooms and avoiding running into RPS limit that would be much appreciated. I spent months developing the code and this is a major road block.

mdpye commented 5 years ago

@senky I'm afraid that the copy on that page appears to be mistaken. Presence is a global property of a user. I have already raised the inaccuracy internally. If you would like to register this as a feature request, please do so via support@pusher.com.

@neuropass I'm not sure I quite follow what you are attempting, but the presence status on a user is global, and will remain the same no matter which room you share with them. If you'd like more assistance then again, the best thing is to contact support@pusher.com. We're only really able to answer questions here when they relate to the implementation of this specific SDK, not the Chatkit service as a whole.

I'm sorry again about the wording of the landing page.

I'm going to close this issue, as it won't be solved here, but please do use it as a reference if you follow up.