xmpp.js icon indicating copy to clipboard operation
xmpp.js copied to clipboard

Connect failure (invalid username/password) results in an uncaught exception

Open silverbucket opened this issue 9 months ago • 2 comments

⚠ If you need help with XMPP itself, please visit https://xmpp.org/community/ instead.

Describe the bug I tried a simple connect with an invalid username and password

Logs The connect fails, and the error message has tons of parsing errors:

Error: Illegal XML entity &��DoP_|��� s�g6
G�                                                                                         m��u��O���<�Qt��Җ��
  u����>����J:�;
1 | "use strict";
2 |
3 | module.exports = class XMLError extends Error {
4 |   constructor(...args) {
5 |     super(...args);
        ^
XMLError: J    HM�����'QRґT]�!]�w���'� must be a child.
      at new XMLError (/Users/njenning/code/projects/sockethub/node_modules/@xmpp/xml/lib/XMLError.js:5:5)
      at onText (/Users/njenning/code/projects/sockethub/node_modules/@xmpp/xml/lib/Parser.js:63:26)
      at emit (node:events:87:22)
      at write (/Users/njenning/code/projects/sockethub/node_modules/ltx/lib/parsers/ltx.js:121:22)
      at write (/Users/njenning/code/projects/sockethub/node_modules/@xmpp/xml/lib/Parser.js:71:17)
      at _onData (/Users/njenning/code/projects/sockethub/node_modules/@xmpp/connection/index.js:49:17)
      at emit (node:events:87:22)
      at addChunk (internal:streams/readable:265:47)
      at readableAddChunkPushByteMode (internal:streams/readable:243:18)
      at data (node:net:70:56)

silverbucket avatar Feb 25 '25 10:02 silverbucket

This seems to be coming from jabber.org and not other xmpp hosts, while it would be nice if xmpp.js handled it a little more elegantly, it doesn't seem like a bug, per-say.

silverbucket avatar Feb 25 '25 11:02 silverbucket

The issue template has the following line

Share logs using https://github.com/xmppjs/xmpp.js/tree/main/packages/debug

It's not optional, specially to debug an issue like this :)

sonnyp avatar Jun 11 '25 08:06 sonnyp

Information needed.

sonnyp avatar Jul 06 '25 16:07 sonnyp