sleepy-discord icon indicating copy to clipboard operation
sleepy-discord copied to clipboard

Endless reconnects

Open TylerTheFox opened this issue 5 years ago • 10 comments

I don't know whos bug this is but ill mention it here for the time being. After 8 days of uptime I encountered an issue where the bot tried to connect to Discord 1000 times in a short amount of time. Calling onReady a 1000 times, thus Discord revoked my token.

image

TylerTheFox avatar Sep 03 '18 22:09 TylerTheFox

I'm aware of this issue. It has happened to be me a few times already. I don't exactly know why it's happening and I've been making changes that I think would fix it. However, there's currently no way for me to know if it's fixed or not without having to wait at least a week for it to happen.

yourWaifu avatar Sep 03 '18 22:09 yourWaifu

On Visual Studio you could try a hit counter breakpoint that breaks after like 500 reconnects. image

TylerTheFox avatar Sep 03 '18 23:09 TylerTheFox

The bot that use that runs for a week is using Ubuntu. I can use GDB to do it, but that would still require me to wait for it happen.

yourWaifu avatar Sep 03 '18 23:09 yourWaifu

image Is this it? lol

Moulijin avatar Sep 15 '18 01:09 Moulijin

yea that looks like the issue

yourWaifu avatar Sep 15 '18 01:09 yourWaifu

I think it happened to everyone who uses my software and your library at the exact same time which as 13:00 PDT today.

TylerTheFox avatar Sep 20 '18 02:09 TylerTheFox

hmm really? that's very useful info to know.

yourWaifu avatar Sep 20 '18 02:09 yourWaifu

This was my method to detect it but then I figured out everytime it reconnects it doesn't invoke onReady image

Know any function that'll be invoked on each reconnect?

TylerTheFox avatar Sep 29 '18 00:09 TylerTheFox

@Brandantl Yes, onDisconnect should be called or invoked on every reconnect.

yourWaifu avatar Sep 29 '18 02:09 yourWaifu

I haven't found the root cause, but for now, I'll make it delay reconnects by increasing the time til reconnecting again on each fail and placing a limit on the number of times it can automatically fail reconnecting in a row.

yourWaifu avatar Oct 09 '18 16:10 yourWaifu