matrix-org / matrix-bifrost

General purpose bridging with a variety of backends including libpurple and xmpp.js
Apache License 2.0
164 stars 31 forks source link

Silent failure delivering to a JabberID with no `@` #253

Open singpolyma opened 3 years ago

singpolyma commented 3 years ago

Describe the bug

Trying to talk to a JabberID with no @ in it fails.

To Reproduce Steps to reproduce the behavior:

  1. Open conversation with @_xmpp_cheogram.com:matrix.org
  2. Send message "help"
  3. See no error and no response from the bot

Expected behavior

The message should be delivered and I should be able to see the response.

singpolyma commented 3 years ago

I think if https://github.com/matrix-org/matrix-bifrost/blob/7be54d43fb00877b84f199bed2aedbec5ee212f5/src/xmppjs/Stanzas.ts#L31 just stripped any leading @ this would fix it, since the code everywhere produces mxid like local@domain and when I send from a domain JID via bifrost it is received as @domain so the reply would come from @domain which is probably being rejected at the XMPP side as an invalid JID. So just stripping that leading @ would fix it if that's all it is.

(it would still be a bit unintuitive that you have to put the leading @ on the matrix side, but easy to document)

singpolyma commented 3 years ago

sorry, the above I should have said we need to change the line for to, not from, obviously.

Neustradamus commented 1 year ago

To follow this ticket.