Skip to content

Commit 6541739

Browse files
committed
fix(realtime): handle websocket race condition in node.js
1 parent 13af49b commit 6541739

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/core/realtime-js/src/RealtimeClient.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,10 @@ export default class RealtimeClient {
641641
this.conn.onerror = (error: Event) => this._onConnError(error)
642642
this.conn.onmessage = (event: any) => this._onConnMessage(event)
643643
this.conn.onclose = (event: any) => this._onConnClose(event)
644+
645+
if (this.conn.readyState === SOCKET_STATES.open) {
646+
this._onConnOpen()
647+
}
644648
}
645649

646650
/**

0 commit comments

Comments
 (0)