Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@enisdenjo/graphql-transport-ws

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@enisdenjo/graphql-transport-ws - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

8

CHANGELOG.md

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

12

lib/client.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc