EionRobb / purple-discord

A libpurple/Pidgin plugin for Discord
GNU General Public License v3.0
382 stars 43 forks source link

Guild notifications stop after unexplained disconnections #371

Open LurkerHub opened 3 years ago

LurkerHub commented 3 years ago

Usually, when a message is sent on a channel belonging to a server on which notifications are set to "all messages", Pidgin will also get a notification, open a new window/tab for the channel if needed, display the message and write it to the log.

However, every once is a while the notifications stop, and I see many missed messages when I check the channel in the official client.

I am not sure what the trigger may be, but often the lest message I see in the Pidgin history for the channel is:

The account has disconnected and you are no longer in this chat. You will automatically rejoin the chat when the account reconnects

I see these "disconnection" messages happening quite often on guild channels whereas direct message tabs which were open at the same time do not display them, suggesting that there was no connectivity interruption. The channels don't seem to reconnect either, leading to missed messages.

If I restart Pidgin, things get back to normal for a while, until this happens again.

Questions: 1) Why do those disconnections happen, and how to stop them from happening? 2) Why don't the channels reconnect, and how to re-set the behaviour without restarting Pidgin?

EionRobb commented 3 years ago

Might need to see a debug log to see what's causing the disconnect. It might also give some info about why the channels aren't reconnecting automatically

LurkerHub commented 3 years ago

This only happens sporadically, sometimes not for days. The log file would be huge, not sure about the resources it would take.

EionRobb commented 3 years ago

Probably don't need a full log, just the last 20 or so lines. If you use the pidgin Help->Debug Window, then that has a limited amount of scrollback, so could limit the size of the logging

LurkerHub commented 3 years ago

The problem is that it can happen at any time. It was ok for several days, then happened at 2am, and only the guild channels had the disconnection message, the DM tabs did not. So I am not sure there even was an actual disconnection at that time. Also, I am using many protocols, some of them quite chatty, so "last 20 or so lines" won't work if the issue happens without any notification (or at night).

I can try simulating an actual disconnection with the logging on, but it may not behave the same.

LurkerHub commented 3 years ago

I can try simulating an actual disconnection with the logging on, but it may not behave the same.

I tried, but could not reproduce the behaviour.

LurkerHub commented 3 years ago

OK, managed to reproduce!

This happens when Pidgin gets very busy on another operation and starves the plugin for CPU time, making it think that there was a disconnection (likely due to a timeout) but since there wasn't, there is no "reconnection" to fix it.

This happens on Windows when the Pidgin window gets unresponsive for several seconds, and possibly in other situations.

LurkerHub commented 3 years ago

The problem is back with a vengeance. I am losing messages every day.

Please look into it, it makes Pidgin practically unusable for me.