not-ilinked / Anarchy

The superior Discord API wrapper

Home Page:https://anarchyteam.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

random logging out

iphqne opened this issue · comments

all bots ran on anarchy will randomly log out after a random period of time (12-24hours ish) with no error message and error code 1000
image

I second this. Even at times, onLoggedOut doesn't trigger so it's just stuck in limbo until you restart the app. Not sure what exactly is the cause of this but it is definitely infuriating. Sometimes it happens even within 6 hours of being logged in

Sometimes it happens even sooner, within an hour. I've also had it run for days. Normally it happens within 24h. It seems random.

The socket is closed by our application, not by the discord server. It's closed with close code 1000 which falsely suggests it was willingly closed (without error) by the client.

Closing the connection is initiated somewhere within the websocketsharp.core assembly. I've not yet had time to look into why. If I'm the one who gets to this first, then I'll just remove the websocketsharp.core assembly. I'll use the .NET framework's web socket implementation in its place.

I've had this for a very long time already, so it's not a new problem.

Even at times, onLoggedOut doesn't trigger

I can't say I've seen this. With an error code of 1000 the OnLoggedOut delegate is always invoked. Might suggest you have a different issue?

Even at times, onLoggedOut doesn't trigger

I can't say I've seen this. With an error code of 1000 the OnLoggedOut delegate is always invoked. Might suggest you have a different issue?

Yes perhaps it is a different issue. The accounts don't really give any specific info. Onloggedout isn't triggered but also it doesn't re-log back in because it technically is logged in already.

What I mean by this:

For example I use an official discord bot token that has a status message update every time someone has posted on a specific server, with the channel name and how long ago it was. The status message disappears, but the account is still "logged on" and can be seen in green on the discord server, however, it does not receive any messages anymore nor can it interact with the api anymore. It's just a "ghost" login; seems to get stuck somehow. By manually disposing of the discordsocketclient and re logging in every hour, it fixes the issue. To make sure it wasn't just that specific server, I made it log every single message it receives from OnMessageReceived, no logs are present after the issue is present.

It is most likely the same issue you have commented above.

would be great if you could do this, this bug gets quite annoying

would be great if you could do this, this bug gets quite annoying

I'm just a guy who uses the library, just like you.