You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IIdentifyThrottler.ts waitForIdentify method errors is not being handled by the ws package.
While this works in the SimpleIdentifyThrottler, this will introduce issues when you extend the IdentifyThrottler depending on your needs. You can't be sure that only the shard that sends an abort signal is the only thing that will error here, hence if you do nothing, your shard will be just left connected and heartbeating without any actual connection in it.
To reproduce, just spawn 2 shards, let the first identify, then throw an error on the 2nd shard when it will identify, you will be left with a shard that didn't identify and a potential memory leak due to the promise not resolving and not being removed from map. This could be a big issue as this will make the bot offline in shards where it didn't identify
A fix is to let the WebsocketShard class detect if something errored in waitForIdentify, and check if it's already closed. if not closed, destroy and reconnect.
Code sample
No response
Versions
ws: 0.8.3
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered:
Which package is this bug report for?
ws
Issue description
The IIdentifyThrottler.ts waitForIdentify method errors is not being handled by the ws package.
While this works in the SimpleIdentifyThrottler, this will introduce issues when you extend the IdentifyThrottler depending on your needs. You can't be sure that only the shard that sends an abort signal is the only thing that will error here, hence if you do nothing, your shard will be just left connected and heartbeating without any actual connection in it.
To reproduce, just spawn 2 shards, let the first identify, then throw an error on the 2nd shard when it will identify, you will be left with a shard that didn't identify and a potential memory leak due to the promise not resolving and not being removed from map. This could be a big issue as this will make the bot offline in shards where it didn't identify
A fix is to let the WebsocketShard class detect if something errored in waitForIdentify, and check if it's already closed. if not closed, destroy and reconnect.
Code sample
No response
Versions
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: