deepstream.io-client-js
deepstream.io-client-js copied to clipboard
Unsubscribing from Presence causes several client errors
Setup
-
client:
deepstream.io-client-js
(v2.3.0) -
server:
deepstream.io
(v3.1.0) -
client code for subscribing and unsubscribing from Presence:
const deepstream = require('deepstream.io-client-js')
const client = deepstream('localhost:6030')
const userId = client.getUid()
client.on('error', (error, event, topic) => {
console.log('client error')
console.log(error, event, topic)
})
client.login({username: userId}, (success, data) => {
console.log('login')
console.log(success, data)
})
const presenceHandler = (conId, loggedIn) => {
console.log(conId, loggedIn)
}
client.presence.subscribe(presenceHandler)
setTimeout(() => {
client.presence.unsubscribe(presenceHandler)
}, 4000)
Expected Behavior
A user can subscribe (client.presence.subscribe(callback)
) and unsubscribe (client.presence.unsubscribe(callback)
) from Presence.
Actual Behavior
Client login and logouts are detected when subscribed to Presence as expected. However, when unsubscribing from Presence via client.presence.unsubscribe(presenceHandler)
several errors are emitted:
client error
E UNSOLICITED_MESSAGE U
client error
[ 'INVALID_PRESENCE_USERS',
'users are required to be a json array of usernames' ] 'INVALID_PRESENCE_USERS' 'U'
client error
No ACK message received in time for US ACK_TIMEOUT U
bump
Same here! Any updates on this issue?
BTW: I am NOT using the Javascript Client, but the Java Client.
Meanwhile I found the issue on the server and created a pull request: https://github.com/deepstreamIO/deepstream.io/pull/915