@ledgerhq/live-network
Advanced tools
Comparing version 1.3.1-nightly.2 to 1.4.0-nightly.3
# @ledgerhq/live-network | ||
## 1.4.0-nightly.3 | ||
### Minor Changes | ||
- [#7334](https://github.com/LedgerHQ/ledger-live/pull/7334) [`53ff78c`](https://github.com/LedgerHQ/ledger-live/commit/53ff78c541d3ed69a3e74854d77f58a7e0d93978) Thanks [@gre](https://github.com/gre)! - live-network no longer retry network calls on HTTP status code that shouldn't be retried like 401 & some others. | ||
## 1.3.1-nightly.2 | ||
@@ -4,0 +10,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-nightly.2", | ||
"version": "1.4.0-nightly.3", | ||
"description": "Ledger Live network and cache utilities", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -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
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
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
125575
1794