matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
460 stars 149 forks source link

The stored nickname for a BridgedClient and the actual nickname for a session can get out of sync #1742

Open Half-Shot opened 1 year ago

Half-Shot commented 1 year ago

Which leads to the double posted messages for Matrix users.

The logs tend to look like:

2023-06-01 08:55:45 INFO:req [inpai5upicg00] [[I->M]] $localNick@irc.libera.chat#asemfpz2dck00~$mxid : Sending metadata 'Received an error on irc.libera.chat: err_cannotsendtochan

2023-06-01 07:47:55 INFO:BridgedClient <$localNick@irc.libera.chat#asemfpz2dck00> ($mxid) Trying to change nick from $localNick to $actualNick
2023-06-01 07:47:29 INFO:BridgedClient <$localNick@irc.libera.chat#asemfpz2dck00> ($mxid) Client is now CONNECTED
2023-06-01 07:47:29 INFO:BridgedClient <$localNick@irc.libera.chat#asemfpz2dck00> ($mxid) Connecting to IRC server irc.libera.chat as $localNick (user=daedricagu)
2023-06-01 07:47:29 INFO:BridgedClient <$localNick@irc.libera.chat#asemfpz2dck00> ($mxid) Created client for $mxid

Which then results in the user being permanently stuck as the wrong nick even though this has changed on the server. We probably need to listen for nick changes on the client and update accordingly.