Closed moufmouf closed 1 year ago
This is also why I cannot properly catch and handle the error.
You shouldn't have to anyway. This looks like a bug in xmpp.js
The error happens when sending the
stanza (see stream-management/index.js:114)
Looks like an await
is missing here :hand_over_mouth: – could you send a PR with a test covering entity.send
rejecting?
Describe the bug
We use XMPP.js in a NodeJS application to connect to an XMPP server (Ejabberd).
The problem happens randomly and rarely (a few times a day on a server with ~500 people). The NodeJS server crashes.
Logs
In the logs, we see:
So the error is linked to closing connection. Looking at the stacktrace, I cannot detect what triggers it from my own application (because the whole code is triggered by a
runMicrotasks
). This is also why I cannot properly catch and handle the error.The error happens when sending the
<enable/>
stanza (seestream-management/index.js:114
)My guess (but I may be wrong) is that if a network issue happens just after the connection (and before the
<enable/>
stanza is sent), the exception is not caught properly and goes back to the top level without anyone having a change to properly catch it.Environment
The problem occurs in the "pusher" container of WorkAdventure, available at https://github.com/thecodingmachine/workadventure/ We use the latest version of xmpp/client (0.13.1)