@enisdenjo/graphql-transport-ws
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,9 @@ | ||
## [1.1.1](https://github.com/enisdenjo/graphql-transport-ws/compare/v1.1.0...v1.1.1) (2020-08-28) | ||
### Bug Fixes | ||
* add the sink to the subscribed map AFTER emitting a subscribe message ([814f46c](https://github.com/enisdenjo/graphql-transport-ws/commit/814f46c119792aaa240d0fcdb318dccdd1cc0e87)) | ||
* notify only relevant sinks about errors or completions ([62155ba](https://github.com/enisdenjo/graphql-transport-ws/commit/62155ba0b79516141633b86765921b2401fcc2ed)) | ||
# [1.1.0](https://github.com/enisdenjo/graphql-transport-ws/compare/v1.0.2...v1.1.0) (2020-08-28) | ||
@@ -2,0 +10,0 @@ |
@@ -125,7 +125,7 @@ "use strict"; | ||
else { | ||
// all other close events are considered erroneous for all sinks | ||
// reading the `CloseEvent.reason` can either throw or empty the whole error message | ||
// (if trying to pass the reason in the `Error` message). having this in mind, | ||
// simply let the user handle the close event... | ||
Object.entries(pendingSinks).forEach(([, sink]) => sink.error(closeEvent)); | ||
// only the subscribed sinks should be errored out because | ||
// the pending ones are probably waiting on a new socket | ||
Object.entries(subscribedSinks).forEach(([, sink]) => sink.error(closeEvent)); | ||
@@ -162,4 +162,7 @@ } | ||
socky.dispose(); | ||
// only pending sinks can error out here because opening a | ||
// socket and receiving a connection ack message means | ||
// all subscribed ones are disposed (or on a different socket) | ||
// and we are now creating a fresh connection | ||
Object.entries(pendingSinks).forEach(([, sink]) => sink.error(err)); | ||
Object.entries(subscribedSinks).forEach(([, sink]) => sink.error(err)); | ||
if (!done) { | ||
@@ -193,3 +196,2 @@ done = true; | ||
} | ||
subscribedSinks[uuid] = sink; | ||
messageListener = socky.registerMessageListener(({ data }) => { | ||
@@ -224,2 +226,4 @@ const message = message_1.parseMessage(data); | ||
})); | ||
// the sink is now subscribed | ||
subscribedSinks[uuid] = sink; | ||
}) | ||
@@ -226,0 +230,0 @@ .catch(sink.error); |
{ | ||
"name": "@enisdenjo/graphql-transport-ws", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A WebSocket client for GraphQL subscriptions", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66023
1048