Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of null (reading 'once') in 'promise.js' #974

Open
CamilleDrapier opened this issue Feb 7, 2023 · 0 comments
Open

Comments

@CamilleDrapier
Copy link

Describe the bug
Upon calling client.disconnect(); I notice I sometimes having the following problem raised in promise.js

Sadly, I'm not completely sure about how to reproduce this problem as it might be related to the reconnection mechanism being triggered, or because of multiple disconnection attempts being called in parallel?

Logs

TypeError

Cannot read properties of null (reading 'once')

Crashed in non-app:
./node_modules/@xmpp/events/lib/promise.js in <anonymous>
<anonymous> in new Promise
Called from:
./node_modules/@xmpp/events/lib/promise.js in module.exports

It seems that the problem is that the socket has been reset to null (maybe while the promise was awaited?), probably by the _detachSocket method. but I'm not sure of the order of events that allow this to happen. It seems this happens while handling a timeout error from a ping we send from clients to the server in order to check if the client is indeed still connected; so maybe there was some concurrent event happing at that time leading to the socket being reset.

Environment
As much as possible information about the environment running xmpp.js

browser: Chrome 109.0.0
Xmpp.js version: 0.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant