Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
fix: clear timeout in downloader (#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
tripodsan authored Aug 9, 2021
1 parent 79fea74 commit 3a89f46
Show file tree
Hide file tree
Showing 25 changed files with 26,417 additions and 1,665 deletions.
23,734 changes: 22,069 additions & 1,665 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
"xml2js": "0.4.23",
"xmlbuilder": "15.1.1"
},
"mocha": {
"require": "test/setup-env.js"
},
"lint-staged": {
"*.js": "eslint"
},
Expand Down
4 changes: 4 additions & 0 deletions src/utils/Downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ class Downloader {
} catch (e) {
res = e;
res.ok = false;
} finally {
if (options.signal) {
options.signal.clear();
}
}

if (res.status === 404) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"log": {
"_recordingName": "Test non-existing content/Getting XDM README (from wrong URL)",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "5.1.1"
},
"entries": [
{
"_id": "3f25a666522e98899fdb8870d64e3462",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"name": "host",
"value": "raw.githubusercontent.com"
},
{
"name": "user-agent",
"value": "helix-fetch"
},
{
"name": "accept",
"value": "*/*"
},
{
"name": "accept-encoding",
"value": "gzip,deflate,br"
}
],
"headersSize": 183,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [],
"url": "https://raw.githubusercontent.com/nobody/xdm/master/README.md"
},
"response": {
"bodySize": 14,
"content": {
"mimeType": "text/plain; charset=utf-8",
"size": 14,
"text": "404: Not Found"
},
"cookies": [],
"headers": [
{
"name": "connection",
"value": "close"
},
{
"name": "content-length",
"value": "14"
},
{
"name": "content-security-policy",
"value": "default-src 'none'; style-src 'unsafe-inline'; sandbox"
},
{
"name": "strict-transport-security",
"value": "max-age=31536000"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "x-frame-options",
"value": "deny"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "content-type",
"value": "text/plain; charset=utf-8"
},
{
"name": "x-github-request-id",
"value": "F75C:5DDC:BA1A30:C364AB:610EAC22"
},
{
"name": "accept-ranges",
"value": "bytes"
},
{
"name": "date",
"value": "Sat, 07 Aug 2021 15:52:02 GMT"
},
{
"name": "via",
"value": "1.1 varnish"
},
{
"name": "x-served-by",
"value": "cache-fra19174-FRA"
},
{
"name": "x-cache",
"value": "MISS"
},
{
"name": "x-cache-hits",
"value": "0"
},
{
"name": "x-timer",
"value": "S1628351522.148754,VS0,VE172"
},
{
"name": "vary",
"value": "Authorization,Accept-Encoding"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "x-fastly-request-id",
"value": "7b44d412a8cf56d0f1dc1a4da323203b24e82f0e"
},
{
"name": "expires",
"value": "Sat, 07 Aug 2021 15:57:02 GMT"
},
{
"name": "source-age",
"value": "0"
}
],
"headersSize": 720,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 404,
"statusText": "Not Found"
},
"startedDateTime": "2021-08-07T15:52:02.200Z",
"time": 187,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 187
}
}
],
"pages": [],
"version": "1.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"log": {
"_recordingName": "Test non-existing content/Getting XDM README (with missing ref)",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "5.1.1"
},
"entries": [
{
"_id": "8801a2001578e12b49266529916516fa",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"name": "host",
"value": "raw.githubusercontent.com"
},
{
"name": "user-agent",
"value": "helix-fetch"
},
{
"name": "accept",
"value": "*/*"
},
{
"name": "accept-encoding",
"value": "gzip,deflate,br"
}
],
"headersSize": 182,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [],
"url": "https://raw.githubusercontent.com/adobe/xdm/master/README.md"
},
"response": {
"bodySize": 2946,
"content": {
"_isBinary": true,
"mimeType": "text/plain; charset=utf-8",
"size": 2946,
"text": "[\"1f8b0800000000000003ad587f6fe3c611fd5f9f627b9722566091b62f4012034dabc8be40c9d91624df5d52238856e48ada98e4b2bba465e5af7c87f613e693f4cdec92a2ec3ba4450b2477a7e5fe987933f3e6edbe14978f95b25a95891217b296e2caa42a17473f5c5c0dc522d9a8420e06777fba9b689be46a32fde96853d7953b8fe38447121d25a688b34d2c53b352f1635a44ee21fbabab77b9fa0bfe35fc0f560c054ef8d62a55de2b0573c44aa699da2fe49f2ecaf633226d0e0fec1df364da7030b8dd2871f74147f7abb6db6dc43bd21a53a93276b52c536953e74df49068276aec96cb326b64a684598b5467ba96b950dd012e1a6032cd95a26a56b94ef29d484dd214aaac552a5c0514d63a91b536e5b148ad7e50a558edc4980c10b511baa8ac79507c96c61a0b8bac5ce95cd7bb633ac92ae76815fe3a16b05354660be03e66ceed06c6585519a76b63772231652d75e99d71a6b140250120626d2c8fe1ef029b1c584abbd337f2ad20f48e45e37499f1e0778b9beb90301d3ad160f0f2a59834d6c26ff14e59875d061d36b578f04362791a9dbe8a5e2db1e047d388449662ade15461ac1272659a5ac0c6763a1da94b7107445d0c74ac499b840c8c8af4a7a30f8dbedcaf1cb24d64c23bed1a99eb5fd9b7c160a190240ffdb1d6df42ba9a92d2ca32d9ec338692c443171287d21aa972b06f8c38a6b1df211e1e8bed46271bc1c15823861b648382713b717a2636d8cc79cce64aa61dd60b0461301889bbc9465664c9e9b998f61cfcb0cfc3fe8ab3736c994b4abe459bd6615997e64fd7bc3a17b7ca16ba34b9c9766176bd1f793afff3739049adca94e203bbc30a4563047e77c0b8aa68d6a31893556b652949c36cdbfe8ee797e38bab4b5a237effed9f0003a075692bf3dca72e279c13a942bec039d4104e660867d6fca2925abc913be48f27812a8c61ab5cea54506221937cc2e7b9d992e95bb93b27b89764d0f25c5c497b9f9a2da564aea86290b8c110b1b6f8c7a89035003816fd08f8aa2c4d392aa9946a14aba8a4ad1d6515d9880382f53883abc7ffec1fe3dd6233432eaecca348ac710ea507ccc30eb419b2af32250aed8ff7a38dc69733b15f42bba52d143c0ca2a012e03a27464aac42fa7480374eae7225b61a7129c5dbd9824cd887fa0f4d0075a5a01afce74cdef0512dd73c332b1cf261d3800b5ca1d32b99dc13e9fce24c89f3a558353a4ff96ca6b56559154b6f84a4587bf2cbc0a1b62bf77dacad299ef15a204aef0d85f7884aca0e3fb011186c7c7925824d0420883d55556e76f0c8786f3cdd4fe31bf15eade0952237babc870f9cf4741c7d98dc5cdfcea7dfbcbd9d5e7feb3f678d060480d3b183949456af1a303c9a4282fe61299f91f409b7097c07ec64a1b73e554e67656f17ae9bd784d7edaea29f38f5b3c8c7d0c3daf6bf5e5cd18ea22c02fcd6d0cfc3e954b95b24be4eee79dd328c7350ba7461eb95743be176a8ab47b1d1d926c7ff75a07a9552db72de1ef5288b0a077db63709688751bf330779ab4112c0f701649c32f5c98cc8a3f6963c71ccbb42b0e8b5704d4290ad1bb4b842d98c6b0331fcd84221d986e58b60c50b1a56483ee90fb3c674151ca05ba9353537cd64c491b1757b4c97858085f503f509efbc2ed99d27ce87d1ff0b0891987a439761d7e062bb8313476b993b04950bf141a1abf5fca2043106f4fac860d2174a44226c5f8f6cd15aea3c7a7282f39f4a400583fbb0b7d289abcb37c85b6390b299a7f5daffe8e8fd88339292aa2d4a7cec403dd8edb8c32cf8c763fda23f980e7b7012c908ee212691f59e37efbc2225283d1867a4473a590a166b562c123e306f28f0bda7d0d8cb97e24251ab443fd4548ea48d4aa552b4a7d348886b102002c73833b90dce30ba4c1a9b2ffdf2779d\",\"4f947d646e2e920dd419c0aeac26ad17989d1092e54ecc1a8460aefed12857532445a7b2075e44b618ef5bb18020d02416f7082219acaeea96f1c90747a477773dbb3a94dc30fb1747a00c23d14a3f903ed5050e6f736ecfc4fd0c7707b9dc8f59f8ba265952c87b72ae751bbb2a44027783c1e0754bf25c9fa9b6708cd471a8548f574f35dba604f4cbe57225dd66f08980f182ce4772875f280f488daf05f0fadb49f455f48a4744fc16cddac5eb4221e080d3d924aed03b486533b65fa39bc1c24114c12cbf150e13c8b59ac770e66080ba8494110e42752b2d65a1238650d6e24f6ced243978841f009194c7afb83700315db3b6479dae21bae059d1b24fc0866e293979ca61f705762d0bfa34d9f70c6a077436a7fa64df6b3e75be85fc74f4a4430d7d12521f9c853ef8edbe491e998afe9639a6bd474458d3a5bd7c6fa155e9318371a8d2903285a4b45aff7741fc8300d241a1697bd039e93d67a93a796e25935fd9128ddad34c2085e5a1ac5df62c0cfcd85bfc4435343804ba050932a25da25f75b58c040bd93083ca0564d94057c8144cb4bf8f057c9e7a4bfef9d9debda5ffb1f42efa1f2274babd3cc19d21f3ad986e0bb8f0807f7b93ab9eeaa5e20d9b9ed3f89217e13a1379aef6fe39b73536250e25ba77f2a165d1c36bea118298d0ad889217c9c6f94f3e3b551345b4ee720b657f9f85173cb5d6192f201c5934ba73a98a9f3b2b3e814d3fcfc68bc5fb9bf9452fead45b9d6bb80e9607939662838ebf52881dddd335410f1c767449a5cad065631a479734958574773ba050b0e08529a6ec0789ea5c859a044d1154f3a6e47bee617c4c99efa8687d111e76265c5d3549f2b0f50bd9d41b635f74313bf638154a82b4693229aa36d4243e09588e8652dc0a42011d365f0a7c902408c0be30976d7249e4c10372792982e43e180d29d1162f1c1d8b35714f10a9626b9a3c54456ecc3d906167b5fbdf03fb51be7e5ef9cf6a653fd07af2941dba1a7e222fc2bde9b0b28f5b332889890bf1235343e163e665687b104d6939ce62a533bead7621a47ab0ed7bc173a9440c0ca95073661cea09aac7c36b53dbb8fb8487cd738873a478fb5c1332831ceae86e8a8b99a57efbdd781eea9284886f266f7479ef7c3758f45f94b8a7dcf53ab71707d00664cd28685363b378d84e1cbdb910a7d1c9a18ad8bee249b773bf2e4ffdfc1fae666231bb9c4c5f4f27e3db294e998de7b7e2545c8c6fc7e2eae6e2f2cdb1585ccea7e337d3bff3846331bebe10939bf9a598cd6f6697f3dbe9e5a2330a4741e8d053e4fec1877410f08e5359c44c98b12ae3543d94aa8e1f8b2aaed2b58b61c89fcf4e1617dfe3cfb94713ff4a92d1d9c9e9e7a3d3339a7000cc4cdafa34c2dad043dfa18bad9a5c5ac42dbe8126ce4da6fd0ded6e8f5267e87e8871b8a0822dc14c567553521e4b30b4c7f7e6fd9bbeaf3d58cf4e4ebe8ae7979391d9e6672312f40f5a6d47347c7a72f6855fbef8fe667178c8473671f7c68dba96c8bb9c7c79fa653c0cc992e05aa8e289a976962e818341f74f01c0be088d69c18c4a2c0b2f907c24c5233126214353a9914075a1b384e74f50c23dab76bf7f1adaab84986105fca0607c51d0ed785c7b7143c9fe7974c2446e4be9f58a389a4cc4373fd287fee376d823f15bb0cfe12417af763166c7c3f6eca0ee49f04ac8b0b5255965f8d569b1a191df7ffb1708aef21ac1e2faebbc412a3c48c21c0d4b105462ea02131aee2dfc6c0b0537024612754cfb5855e847b0bf05f1d3774f2ffe32d654a15d745bae593eee40f2c0d4d1ed9edea6c92b65134cc87751a0bde00bb7495c97ab9a5f8468fd6bf267d2e475837b9f780fdc5de8fe7e0dbd55f85e63d583f1ddcc7918525350d705f9932e75dcf0bde8f36a2e9c49cf902ea0f896c378a8\",\"0ef93be3d90f25a14198170d3479460197151a0f6e42c4b309e18c96163a3a12030572df76c87072782228532a54456f05edc562ab5850e34ae6cf90f4e44f6c1d8284fc00373146e87d25bd1792a22114c28c2d9630b5bb26cbfcfdab0f19bf98219b1813fc66b5d150328dc0efb8a8a53a2428121f4e27fea5a7731abbd36170192222571926324cb457ad920dbfea6a52cbd008aeb1ed8b1d4fcd77ddaec250270ac23b35e1e6484f74d9418c2a7a2aae11a57f0319c46492651a0000\"]"
},
"cookies": [],
"headers": [
{
"name": "connection",
"value": "close"
},
{
"name": "content-length",
"value": "2946"
},
{
"name": "cache-control",
"value": "max-age=300"
},
{
"name": "content-security-policy",
"value": "default-src 'none'; style-src 'unsafe-inline'; sandbox"
},
{
"name": "content-type",
"value": "text/plain; charset=utf-8"
},
{
"name": "etag",
"value": "W/\"d75cf8b2a0f120946af50763c6103b05f7efc6c8c806aee9723b081f5a142127\""
},
{
"name": "strict-transport-security",
"value": "max-age=31536000"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "x-frame-options",
"value": "deny"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "x-github-request-id",
"value": "127A:8EAF:41F605:51F0DC:610EAC22"
},
{
"name": "content-encoding",
"value": "gzip"
},
{
"name": "accept-ranges",
"value": "bytes"
},
{
"name": "date",
"value": "Sat, 07 Aug 2021 15:52:02 GMT"
},
{
"name": "via",
"value": "1.1 varnish"
},
{
"name": "x-served-by",
"value": "cache-fra19156-FRA"
},
{
"name": "x-cache",
"value": "MISS"
},
{
"name": "x-cache-hits",
"value": "0"
},
{
"name": "x-timer",
"value": "S1628351522.386692,VS0,VE180"
},
{
"name": "vary",
"value": "Authorization,Accept-Encoding"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "x-fastly-request-id",
"value": "3453adff03eb98d3c8b914770a1c68556e793282"
},
{
"name": "expires",
"value": "Sat, 07 Aug 2021 15:57:02 GMT"
},
{
"name": "source-age",
"value": "0"
}
],
"headersSize": 850,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2021-08-07T15:52:02.434Z",
"time": 203,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 203
}
}
],
"pages": [],
"version": "1.2"
}
}
Loading

0 comments on commit 3a89f46

Please sign in to comment.