@4c/graphql-subscription-server
Advanced tools
Comparing version
@@ -0,1 +1,9 @@ | ||
<a name="0.3.0"></a> | ||
# [0.3.0](https://github.com/4Catalyzer/graphql-subscription-server/compare/v0.2.0...v0.3.0) (2018-04-19) | ||
### Features | ||
* Standarize error handling for subscription limits ([#14](https://github.com/4Catalyzer/graphql-subscription-server/issues/14)) ([a07172b](https://github.com/4Catalyzer/graphql-subscription-server/commit/a07172b)) | ||
<a name="0.2.0"></a> | ||
@@ -2,0 +10,0 @@ # [0.2.0](https://github.com/4Catalyzer/graphql-subscription-server/compare/v0.1.1...v0.2.0) (2018-04-18) |
@@ -53,17 +53,15 @@ function _asyncIterator(iterable) { if (typeof Symbol === "function") { if (Symbol.asyncIterator) { var method = iterable[Symbol.asyncIterator]; if (method != null) return method.call(iterable); } if (Symbol.iterator) { return iterable[Symbol.iterator](); } } throw new TypeError("Object is not async iterable"); } | ||
}, cb) => { | ||
if (this.config.maxSubscriptionsPerConnection != null && this.subscriptions.size >= this.config.maxSubscriptionsPerConnection) { | ||
this.log('error', 'Max Subscription limit reached', { | ||
maxSubscriptionsPerConnection: this.config.maxSubscriptionsPerConnection | ||
}); | ||
this.emitError({ | ||
code: 'subscribe_failed.subscription_limit' | ||
}); | ||
acknowledge(cb); | ||
this.config.socket.disconnect(); | ||
return; | ||
} | ||
let result; | ||
try { | ||
if (this.config.maxSubscriptionsPerConnection != null && this.subscriptions.size >= this.config.maxSubscriptionsPerConnection) { | ||
this.log('debug', 'Max Subscription limit reached', { | ||
maxSubscriptionsPerConnection: this.config.maxSubscriptionsPerConnection | ||
}); | ||
this.emitError({ | ||
code: 'subscribe_failed.subscription_limit' | ||
}); | ||
return; | ||
} | ||
if (this.subscriptions.has(id)) { | ||
@@ -70,0 +68,0 @@ this.log('debug', 'Duplicate subscription attempted', { |
@@ -64,17 +64,15 @@ "use strict"; | ||
}, cb) => { | ||
if (this.config.maxSubscriptionsPerConnection != null && this.subscriptions.size >= this.config.maxSubscriptionsPerConnection) { | ||
this.log('error', 'Max Subscription limit reached', { | ||
maxSubscriptionsPerConnection: this.config.maxSubscriptionsPerConnection | ||
}); | ||
this.emitError({ | ||
code: 'subscribe_failed.subscription_limit' | ||
}); | ||
acknowledge(cb); | ||
this.config.socket.disconnect(); | ||
return; | ||
} | ||
let result; | ||
try { | ||
if (this.config.maxSubscriptionsPerConnection != null && this.subscriptions.size >= this.config.maxSubscriptionsPerConnection) { | ||
this.log('debug', 'Max Subscription limit reached', { | ||
maxSubscriptionsPerConnection: this.config.maxSubscriptionsPerConnection | ||
}); | ||
this.emitError({ | ||
code: 'subscribe_failed.subscription_limit' | ||
}); | ||
return; | ||
} | ||
if (this.subscriptions.has(id)) { | ||
@@ -81,0 +79,0 @@ this.log('debug', 'Duplicate subscription attempted', { |
{ | ||
"name": "@4c/graphql-subscription-server", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"author": "4Catalyzer", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
75762
0.25%985
-0.4%