apollo-link-retry
Advanced tools
Comparing version 2.2.0 to 2.2.2
@@ -5,2 +5,5 @@ # Change log | ||
### 2.2.2 | ||
- Fix a bug where `observer` is null during onComplete, onNext, onError [#528](https://github.com/apollographql/apollo-link/pull/528) | ||
### 2.2.0 | ||
@@ -7,0 +10,0 @@ - handle Promises from `retryIf` and `attempts` [#436](https://github.com/apollographql/apollo-link/pull/436) |
@@ -96,2 +96,4 @@ (function (global, factory) { | ||
var observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.next(value); | ||
@@ -104,2 +106,4 @@ } | ||
var observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.complete(); | ||
@@ -124,2 +128,4 @@ } | ||
observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.error(error); | ||
@@ -126,0 +132,0 @@ } |
@@ -66,2 +66,4 @@ var __extends = (this && this.__extends) || (function () { | ||
var observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.next(value); | ||
@@ -74,2 +76,4 @@ } | ||
var observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.complete(); | ||
@@ -94,2 +98,4 @@ } | ||
observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.error(error); | ||
@@ -96,0 +102,0 @@ } |
{ | ||
"name": "apollo-link-retry", | ||
"version": "2.2.0", | ||
"version": "2.2.2", | ||
"description": "Retry Apollo Link for GraphQL Network Stack", | ||
@@ -26,3 +26,4 @@ "author": "Evans Hauser <evanshauser@gmail.com>", | ||
"scripts": { | ||
"build:browser": "browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-link && npm run minify:browser", | ||
"build:browser": | ||
"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-link && npm run minify:browser", | ||
"build": "tsc -p .", | ||
@@ -33,4 +34,6 @@ "bundle": "rollup -c", | ||
"filesize": "npm run build && npm run build:browser", | ||
"lint": "tslint --type-check -p tsconfig.json -c ../../tslint.json src/*.ts", | ||
"minify:browser": "uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js", | ||
"lint": | ||
"tslint --type-check -p tsconfig.json -c ../../tslint.json src/*.ts", | ||
"minify:browser": | ||
"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js", | ||
"postbuild": "npm run bundle", | ||
@@ -66,10 +69,5 @@ "prebuild": "npm run clean", | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"json" | ||
], | ||
"moduleFileExtensions": ["ts", "tsx", "js", "json"], | ||
"mapCoverage": true | ||
} | ||
} |
@@ -136,2 +136,3 @@ import { | ||
for (const observer of this.observers) { | ||
if (!observer) continue; | ||
observer.next(value); | ||
@@ -144,2 +145,3 @@ } | ||
for (const observer of this.observers) { | ||
if (!observer) continue; | ||
observer.complete(); | ||
@@ -153,7 +155,9 @@ } | ||
// Should we retry? | ||
const shouldRetry = await this.retryIf(this.retryCount, this.operation, error) | ||
const shouldRetry = await this.retryIf( | ||
this.retryCount, | ||
this.operation, | ||
error, | ||
); | ||
if (shouldRetry) { | ||
this.scheduleRetry( | ||
this.delayFor(this.retryCount, this.operation, error), | ||
); | ||
this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error)); | ||
return; | ||
@@ -164,2 +168,3 @@ } | ||
for (const observer of this.observers) { | ||
if (!observer) continue; | ||
observer.error(error); | ||
@@ -166,0 +171,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
63633
26
1032
1