-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSocketManager disconnects 30-60 minutes at a time #8558
Comments
What version of |
Hi! Thanks for responding. I'm using 0.3.0. It's driving me nuts. Even overrode But that did not work as well. |
Sorta familiar with this issue. We've been trying to fix it for a while and across multiple PRs. You're not experiencing Discord constantly telling you to reconnect (at least to my understanding), but rather a reconnect loop bug. My latest attempt at patching this up was #8479, but seems like that wasn't enough. cc @SpaceEEC |
Do you think it's an issue in the underlying WebSocket package? I implemented my bot with the standard WebSocket package before finding discord.js, and I had the same issue. Also, side note, today I noticed this:
|
No. |
I'd like to clone discord.js and assist in this effort. What's a good starting point for me particularly for this recurring loop bug? |
|
Hello, it looks like this thread might be the same root cause for bots disconnecting after an hour or earlier: To summarize the findings of what I saw in that thread,
The common data point seems to be that somewhere between v13.8.1 and v13.10.3, something introduced this issue of bots disconnecting from the client. And then that ended up getting into v14.x |
@Dossar |
Hi! Are you still able to reproduce this issue on 0.4.1? |
Hi there! I just updated it and will be watching it. Will lyk! Thank you for the fix. |
@didinele Unfortunately, the issue persists with 0.4.1 :/
|
After another month of on-and-off debugging and a lot of frustration with being generally unable to reproduce this issue in a consistent matter, I've finally had a breakthrough and tracked it down to be how we handle the WS connections auto-magically close with a 1000 close code if enough time passes with no flowing payloads. The queue stays stuck after we reconnect, so our I'll have a PR fixing this later today, appreciate the flag and the effort in providing me with logs! |
|
Which package is this bug report for?
ws
Issue description
Running WebSocketManager for a bot on my own personal Discord server
Tested this locally and on a staging within an EC2 instance -- the same issue applies
Randomly throughout the day this will occur and could go on for upwards of 30-60 minutes.
How can I ensure no/minimal disconnection? (Code sample below -- very straightforward implementation)
Code sample
Package version
14.3.0
Node.js version
18.6.0
Operating system
No response
Priority this issue should have
High (immediate attention needed)
Which partials do you have configured?
Message, Reaction
Which gateway intents are you subscribing to?
Guilds, GuildMessages, GuildMessageReactions, MessageContent
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: