@ledgerhq/live-network
Advanced tools
Comparing version 1.3.1 to 1.3.2-nightly.0
# @ledgerhq/live-network | ||
## 1.3.2-nightly.0 | ||
### Patch Changes | ||
- Updated dependencies [[`4bd91de`](https://github.com/LedgerHQ/ledger-live/commit/4bd91de13442d12acce3ee83d5f2fd5f087570cf)]: | ||
- @ledgerhq/live-env@2.2.0-nightly.0 | ||
## 1.3.1 | ||
@@ -4,0 +11,0 @@ |
@@ -133,2 +133,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
// inspired by https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md#retry | ||
const retryableHttpStatusCodes = [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]; | ||
/** | ||
@@ -152,5 +154,4 @@ * Network call | ||
if (error && error.status) { | ||
// A 422 shouldn't be retried without change as explained in this documentation | ||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422 | ||
return error.status !== 422; | ||
// not all status codes are retryable | ||
return retryableHttpStatusCodes.includes(error.status); | ||
} | ||
@@ -157,0 +158,0 @@ return true; |
@@ -142,2 +142,4 @@ "use strict"; | ||
}; | ||
// inspired by https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md#retry | ||
const retryableHttpStatusCodes = [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]; | ||
/** | ||
@@ -161,5 +163,4 @@ * Network call | ||
if (error && error.status) { | ||
// A 422 shouldn't be retried without change as explained in this documentation | ||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422 | ||
return error.status !== 422; | ||
// not all status codes are retryable | ||
return retryableHttpStatusCodes.includes(error.status); | ||
} | ||
@@ -166,0 +167,0 @@ return true; |
{ | ||
"name": "@ledgerhq/live-network", | ||
"version": "1.3.1", | ||
"version": "1.3.2-nightly.0", | ||
"description": "Ledger Live network and cache utilities", | ||
@@ -68,3 +68,3 @@ "keywords": [ | ||
"@ledgerhq/errors": "^6.18.0", | ||
"@ledgerhq/live-env": "^2.1.0", | ||
"@ledgerhq/live-env": "^2.2.0-nightly.0", | ||
"@ledgerhq/live-promise": "^0.1.0", | ||
@@ -71,0 +71,0 @@ "@ledgerhq/logs": "^6.12.0" |
@@ -178,2 +178,6 @@ import axios, { | ||
}; | ||
// inspired by https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md#retry | ||
const retryableHttpStatusCodes = [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]; | ||
/** | ||
@@ -202,5 +206,4 @@ * Network call | ||
if (error && error.status) { | ||
// A 422 shouldn't be retried without change as explained in this documentation | ||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422 | ||
return error.status !== 422; | ||
// not all status codes are retryable | ||
return retryableHttpStatusCodes.includes(error.status); | ||
} | ||
@@ -207,0 +210,0 @@ return true; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
125592
1794
2