@applitools/ufg-client
Advanced tools
Comparing version
# Changelog | ||
## [1.6.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/ufg-client@1.5.3...js/ufg-client@1.6.0) (2023-08-03) | ||
### Features | ||
* add stuck request retries to all requests to UFG and Eyes ([#1826](https://github.com/applitools/eyes.sdk.javascript1/issues/1826)) ([5884d42](https://github.com/applitools/eyes.sdk.javascript1/commit/5884d428b230e3a832a2110a388ebe63a94006fc)) | ||
### Bug Fixes | ||
* improve fetch error experience when fetching from tunnel ([e7d8b49](https://github.com/applitools/eyes.sdk.javascript1/commit/e7d8b49947c07beb27f110cb4952e8c3206469af)) | ||
## [1.5.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/ufg-client@1.5.2...js/ufg-client@1.5.3) (2023-07-27) | ||
@@ -4,0 +16,0 @@ |
@@ -116,14 +116,16 @@ "use strict"; | ||
afterResponse({ response }) { | ||
const headers = {}; | ||
for (const [name, value] of response.headers) { | ||
if (name.startsWith('x-fetch-response-header')) { | ||
headers[name.replace('x-fetch-response-header-', '')] = value; | ||
if (response.headers.has('x-fetch-status-code')) { | ||
const headers = {}; | ||
for (const [name, value] of response.headers) { | ||
if (name.startsWith('x-fetch-response-header')) { | ||
headers[name.replace('x-fetch-response-header-', '')] = value; | ||
} | ||
} | ||
return { | ||
body: response.body, | ||
status: Number(response.headers.get('x-fetch-status-code')), | ||
statusText: response.headers.get('x-fetch-status-text'), | ||
headers, | ||
}; | ||
} | ||
return { | ||
body: response.body, | ||
status: Number(response.headers.get('x-fetch-status-code')), | ||
statusText: response.headers.get('x-fetch-status-text'), | ||
headers, | ||
}; | ||
}, | ||
@@ -130,0 +132,0 @@ }; |
@@ -42,2 +42,3 @@ "use strict"; | ||
connectionTimeout: (_a = settings.connectionTimeout) !== null && _a !== void 0 ? _a : 300000 /* 5min */, | ||
requestTimeout: 30000, | ||
retry: { | ||
@@ -47,3 +48,3 @@ limit: 5, | ||
statuses: [404, 500, 502, 504], | ||
codes: ['ECONNRESET', 'ECONNABORTED', 'ETIMEDOUT', 'ENOTFOUND', 'EAI_AGAIN'], | ||
codes: ['ECONNRESET', 'ECONNABORTED', 'ETIMEDOUT', 'ENOTFOUND', 'EAI_AGAIN', 'STUCK_REQUEST'], | ||
}, | ||
@@ -50,0 +51,0 @@ hooks: [handleLogs({ logger }), handleUnexpectedResponse()], |
{ | ||
"name": "@applitools/ufg-client", | ||
"version": "1.5.3", | ||
"version": "1.6.0", | ||
"homepage": "https://applitools.com", | ||
@@ -5,0 +5,0 @@ "bugs": { |
115698
0.65%1990
0.15%