sm00th / bitlbee-discord

Bitlbee plugin for Discord (http://discordapp.com)
GNU General Public License v2.0
291 stars 27 forks source link

Problem with a lot of unicode usernames. #167

Open zertap opened 6 years ago

zertap commented 6 years ago

If you are on very large servers with a lot of unicode usernames (try the public cyberpunk 2077 server for example) bitlbee takes so long to handle the nicknames it will timeout before it is done. So you can't login.

Login attempt looks like this: (Snipped about 200 of those warnings and left the last few)

...
<@root>   Warning: Something went wrong while trying to generate a nickname for contact ノーフェイス on discord.
<@root>   This might be a bug in BitlBee, or the result of a faulty nick_format setting. Will use xx62e7abf6 instead.
<@root>   Warning: Something went wrong while trying to generate a nickname for contact Месье_Ваншот on discord.
<@root>   This might be a bug in BitlBee, or the result of a faulty nick_format setting. Will use xx7df96ce instead.
<@root>   discord - Logging in: Logged in
<@root>   discord - Error: Failed to get backlog (0).
<@root>   discord - Remote host is closing websocket connection
<@root>   discord - Performing soft-reconnect
<@root>   discord - Error: Invalid session, reconnecting
<@root>   discord - Signing off..
<@root>   discord - Reconnecting in 5 seconds..

It will then reconnect and do the same, unless I do discord off at some point. My IRC client shows lag of about 150 seconds on bitlbee while it handles the nicks (so it takes maybe 160 seconds to process, during that, whole bitlbee is unresponsive and timeouts all my other accounts too)

I did a quick test with the libpurple discord plugin (through bitlbee), and it did not have this problem.

My nick_format is the default, nick_format = `%-@nick'

sm00th commented 6 years ago

Are you sure unicode has anything to do with it and it's not the same issue as https://github.com/sm00th/bitlbee-discord/issues/47? Can you try bitlbee's develop branch that has a fix for #47 to see if that solves your issue as well?

zertap commented 6 years ago

Ah, most likely is. I'll test later when I got time.

surskitt commented 5 years ago

Did you manage to test this? I'm not getting timeouts but I am getting constant errors like below:

23:50  root Warning: Something went wrong while trying to generate a nickname for contact 누구사랑해오직 on discord.
23:50  root This might be a bug in BitlBee, or the result of a faulty nick_format setting. Will use xx624b8ab4 instead.

Strange thing is, looks like they're coming from the same user constantly.

Sorry if the error I'm experiencing is different and I've ended up hijacking, didn't want to open another issue if it's the same.

dequis commented 5 years ago

Yeah the original issue is about mistakenly associating the unicode nick warnings with the more serious timeout problem.

Did you try set utf8_nicks on?

surskitt commented 5 years ago

Ah yeah, that fixed my issue at least. Thanks!