More socket-io client fixes from PR feedback (#7619)

This commit is contained in:
Chris Estreich 2025-09-03 00:41:56 -07:00 committed by GitHub
parent c1509da9bd
commit aa4144e10e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -222,7 +222,9 @@ export class SocketTransport {
// This is a custom event fired by the server.
this.socket.on("auth_error", (error) => {
console.error(`[SocketTransport] on (auth_error):`, error)
console.error(
`[SocketTransport] on(auth_error): ${error instanceof Error ? error.message : String(error)}`,
)
if (connectionTimeout && this.connectionState !== ConnectionState.CONNECTED) {
clearTimeout(connectionTimeout)
@ -243,6 +245,7 @@ export class SocketTransport {
if (this.socket) {
this.socket.removeAllListeners()
this.socket.io.removeAllListeners()
this.socket.disconnect()
this.socket = null
}