Open brycied00d opened 5 years ago
just dropping by to confirm this!
I am also running into issues with replies not being bridged, rather randomly.
spec:
To strip the fallback on the body, the client should iterate over each line of the string, removing any lines that start with the fallback prefix ("
>
", including the space, without quotes) and stopping when a line is encountered without the prefix. This prefix is known as the "fallback prefix sequence".
irc bridge:
match
/> <(@.*:.*)>(.*)\n\n(.*)/
in eventbody
and use the third capture group as the fallback-free body
-@tulir
anyway the fix is to remove reply fallbacks properly in the irc bridge (i.e. remove all lines starting with
>
until a blank line is reached) that can be done without regex by splitting it by newline, removing the fallback lines and joining by newline
-@tulir
adding that this is tangentially related to #683 (measured by the result == loss of message)
Is this the same issue?
It appears that replying to some Matrix messages will fail to relay the message to IRC and throws the following exception:
I was able to produce the issue when replying to the following Matrix messages:
For reference, the above was in reply to this message:
And another failed reply:
Versions
Observed while running: matrix-synapse 0.33.8 matrix-appservice-irc tag 0.11.2 (26f39c9fea97a9c94421ee02d8d02f1ed66914f8) bridged to Freenode
Steps to reproduce
As the issue appears to be caused by replying to a message that begins with some form of Markdown-based formatting, specifically block-quote or ``` quoting, then to reproduce:
Cause
Based on the backtrace, it appears to be caused by a regular expression failing to match the message body, and there being no graceful handling of such a situation. Specifically, the regular expression expects two consecutive newlines, however the markdown-to-plaintext routine prefixes the second newline with the raw markdown. Perhaps the regular expression should not expect that second consecutive newline, or accept one/some wildcard matches before that second newline. https://github.com/matrix-org/matrix-appservice-irc/blob/master/lib/bridge/MatrixHandler.js#L1524-L1531