Browse Source

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

Chris Estreich 4 months ago
parent
commit
aa4144e10e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      packages/cloud/src/bridge/SocketTransport.ts

+ 4 - 1
packages/cloud/src/bridge/SocketTransport.ts

@@ -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
 		}