Skip to content
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

"undefined" debug message on successful websocket closure #9594

Closed
Renegade334 opened this issue May 24, 2023 · 0 comments · Fixed by #9846
Closed

"undefined" debug message on successful websocket closure #9594

Renegade334 opened this issue May 24, 2023 · 0 comments · Fixed by #9846

Comments

@Renegade334
Copy link
Contributor

Which package is this bug report for?

discord.js

Issue description

Very minor issue, but on a successful closure of a shard's websocket (ie. code 1000), the client will emit "undefined" as a debug event:

[WS => Shard 0] undefined

This happens because at present, in client/websocket/WebSocketManager.js, the close code is only resolved against discord-api-types/v10::GatewayCloseCodes and not also against @discordjs/ws::CloseCodes.

Should ideally be changed to resolve against both.

Code sample

No response

Versions

14.11.0

Issue priority

Low (slightly annoying)

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

Renegade334 added a commit to Renegade334/discord.js that referenced this issue Sep 21, 2023
@kodiakhq kodiakhq bot closed this as completed in #9846 Oct 21, 2023
kodiakhq bot pushed a commit that referenced this issue Oct 21, 2023
…9846)

* style: prevent 'undefined' debug message on intentional shard closure

addresses #9594

* refactor(WebSocketManager#destroy): improve debug messaging

cleaner stacktrace format
gracefully closing shards will display an appropriate debug `reason`

* style: unresumable debug messaging

---------

Co-authored-by: Almeida <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants