Closed apkostka closed 2 years ago
Ok, I kind of figured this out. presence.getAll()
actually returns 2 parameters, the first is null
and the second is a list of connected clients (e.g. `[ 'user1', 'user2' ]). There's no indication that this is the case in the documentation, but I'm not sure what the first return parameter is.
Additionally, it seems like when you specify a list of clients (ds.presence.getAll(['client1', 'client2'])
), you get a different result type: an object with the client names as keys, rather than an array. That makes sense based on how they're used but probably needs to be documented. I'd be happy to make the PR if you'd like.
In either case, I'm guessing this probably belongs in https://github.com/deepstreamIO/deepstream.io-client-js , since it seems to be on the client side.
hey! can you please raise a PR against the website for this?
Using 4.2.2 deepstream docker image with docker-compose, a 4.x client querying presence, and a 2.3.0 client logging in.
Client logs in with a username:
Which does trigger a response from
ds.presence.subscribe(device_id, (dev, login) => {...
However, if the client logs in, then deepstream (the docker container) is restarted, the initial call for
getAll()
returns null instead of an object: