We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1ba7d9 commit d4cb87eCopy full SHA for d4cb87e
packages/core/realtime-js/src/RealtimeClient.ts
@@ -595,6 +595,17 @@ export default class RealtimeClient {
595
*/
596
private _teardownConnection(): void {
597
if (this.conn) {
598
+ if (
599
+ this.conn.readyState === SOCKET_STATES.open ||
600
+ this.conn.readyState === SOCKET_STATES.connecting
601
+ ) {
602
+ try {
603
+ this.conn.close()
604
+ } catch (e) {
605
+ this.log('error', 'Error closing connection', e)
606
+ }
607
608
+
609
this.conn.onopen = null
610
this.conn.onerror = null
611
this.conn.onmessage = null
0 commit comments