-
-
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
isReady returns false although the client is ready #10493
Comments
While an issue, I'd recommend avoiding retry logic like that. By design just about any error will be retried internally other than those "really bad" exceptions (using an intent you can't use, bad token, etc). Generally, if we throw a hard error it means just restarting won't fix it and you need to adjust something. |
My specific case was that I encountered the error "Opening handshake has timed out" and after the retry it worked by itself (at least that is my assumption so far) As I use |
You are correct. As didinele already pointed out: if |
And it didn't recover by itself from that? |
That's something I'm not 100 % sure about. My error log stated (using discord.js 14.15.3 at that point)
without a timestamp. The next log entry of my own logging told me |
I recommend listening to the error event (and ShardError), and also the debug event to help diagnose this sort of thing better. |
So far I was only listening to the |
Which package is this bug report for?
discord.js
Issue description
I wanted to try out if my login retry strategy is working and therefore disabled a privileged gateway intent my bot is requesting on login. This makes it 100 % reproducible but of course this happens too if there are network issues or issues from Discords side on the first login attempt(s)
Steps to reproduce:
I'd expect the readyClient to return
true
forisReady()
but since PR #9942 got merged it also takesws.destroyed
into account which is still set to destroyed despite the new connection attempt is successful. So this is not a bug introduced in this PR but rather an already exisiting inconsistency with thews.destroyed
not being set back totrue
when the websocket has successfully connected and is fully operational I believe.It could also be an implementation error of my retry strategy, but I assumed it's common practice to simply try again via login if it didn't work the first time (of course, with a deeper look at the returned error and not retrying infitite, but I tried to keep the code example as simple as possible)
Code sample
Versions
Issue priority
Low (slightly annoying)
Which partials do you have configured?
No Partials
Which gateway intents are you subscribing to?
Guilds, GuildMembers
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: