matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
462 stars 151 forks source link

Message edit sent before the message itself when it is the user's first message in the room #1572

Open progval opened 2 years ago

progval commented 2 years ago

Describe the bug

Seen just now on #matrix on Libera:

19:27:11 --> rydia_[m] (@melissa_:matrix.org) (~melissama@2001:470:69fc:105::8c5f) has joined #matrix
19:27:12 <rydia_[m]> s/room/rooms/
19:27:12 <rydia_[m]> Hello. Can I find a public list of spaces somewhere, like the "explore room" option?

Expected behavior

either:

19:27:11 --> rydia_[m] (@melissa_:matrix.org) (~melissama@2001:470:69fc:105::8c5f) has joined #matrix
19:27:12 <rydia_[m]> Hello. Can I find a public list of spaces somewhere, like the "explore rooms" option?

or:

19:27:11 --> rydia_[m] (@melissa_:matrix.org) (~melissama@2001:470:69fc:105::8c5f) has joined #matrix
19:27:12 <rydia_[m]> Hello. Can I find a public list of spaces somewhere, like the "explore room" option?
19:27:12 <rydia_[m]> s/room/rooms/
jaller94 commented 2 years ago

Could you please explain the issue you have? Please explain this without implying the knowledge of an IRC power user.

I assume that s/room/rooms/ is a string replacement action with a syntax similar to the Unix tool sed. Is that something that some IRC servers support or is this to be read by humans on the IRC side?

progval commented 2 years ago

Could you please explain the issue you have?

the issue is that messages are sent in the wrong order; not because of a federation issue but because of how the bridge internally reorders them.

I assume that s/room/rooms/ is a string replacement action with a syntax similar to the Unix tool sed.

Yes, it's how the bridge sends edits to avoid repeating the whole message (when possible), it's implemented here: https://github.com/matrix-org/matrix-appservice-irc/blob/09ffef0516fba139a5142dc504a4614adfa9801b/src/util/MessageDiff.ts

Is that something that some IRC servers support or is this to be read by humans on the IRC side?

Humans.