From 1ed7bca2c3e405b408ccac5e83487d59864b29c5 Mon Sep 17 00:00:00 2001 From: Patrik Johansson Date: Mon, 5 Aug 2019 17:07:44 +0200 Subject: [PATCH 1/2] Clear WebSocket event listeners on close. --- src/client.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client.ts b/src/client.ts index e7a3fd72f..c36b4b045 100644 --- a/src/client.ts +++ b/src/client.ts @@ -167,6 +167,10 @@ export class SubscriptionClient { } this.client.close(); + this.client.onopen = null; + this.client.onclose = null; + this.client.onerror = null; + this.client.onmessage = null; this.client = null; this.eventEmitter.emit('disconnected'); From 0348bb62b1b5a1d536827b22016f98a00dfed15e Mon Sep 17 00:00:00 2001 From: hwillson Date: Mon, 10 Aug 2020 07:44:44 -0400 Subject: [PATCH 2/2] Changelog update --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0a8a3e1f..78a4dd5c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - Do not send GQL_STOP when unsubscribing after GQL_COMPLETE is received.
[@onhate](/~https://github.com/onhate) in [#775](/~https://github.com/apollographql/subscriptions-transport-ws/pull/775) +- Clear WebSocket event listeners on close.
+ [@tretne](/~https://github.com/tretne) in [#615](/~https://github.com/apollographql/subscriptions-transport-ws/pull/615) ### New Features