sm00th / bitlbee-discord

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

Failed to get backlog (0). #125

Open roughnecks opened 6 years ago

roughnecks commented 6 years ago

Hello.

Last few times I connected I got that error in &bitlbee - backlog isn't loading and I get like 30 or more seconds lag in control channel (always at startup). I'm running a Debian VM and Weechat; resources are limited but should be enough. I'm in 4 Discord servers but I'm joining less than 10 channels. I think some channels may have more than 5000+ user logged in, if that matters.

Is there something I could check? Thanks

sm00th commented 6 years ago

The lag in control channel is very likely to be caused by big user list, you can read more on the issue in #47. It is very likely that the backlog issues are caused by this 'add_user' lag as well. It seems that bitlbee-discord does the request for backlog and proceeds to join the next channel, because it takes so long to join/add all the users the reply from server expires, hence 0 status_code in reply (the number in brackets). If I understand it correctly at least the last channel you join should get backlog without errors. There shouldn't be any problems with backlog if you are joining channels one by one, but the lag will still be there.

roughnecks commented 6 years ago

Does this involve private messages too? I'm asking because a friend messaged me on new year and I didn't receive it; some days later I opened discord in my browser to check something and found out there was an unread query.

sm00th commented 6 years ago

That is an absolutely wonderful question. Thank you for it. The answer is - no, big user list did not affect your private message backlog for a reason that bitlbee-discord did not fetch private message backlogs for quite some time. As of commit 64c179b9bbdd8e17b17fc0082b69be462b7a900c it will start to do so. There is a possibility of long user lists affecting these, but it is much lower than with the group channels.

I wonder how this bug managed to go unnoticed for so long and hope that nobody missed anything important because of it.

roughnecks commented 6 years ago

Glad I've been of help - and for the patch, obviously 👍