From d12bf295f943eb6940acfa4e63afa2380021f434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 17 Jan 2025 00:26:52 +0100 Subject: [PATCH] compose-fetcher: Update node-fetch to 2.7.0 and increase max retries to 10 The library update seems to replace the abrupt closing of the app with no error with actually raising an exception which we already handled. So now failures look like this: Requesting batch 10/17 of commit and pull request data. Failed with status 502, retrying (1/10)... Error fetching pull request data: FetchError: Invalid response body while trying to fetch https://api.github.com/graphql: Premature close Terminating with an exit code 1. --- build/utils/compose-fetcher.js | 2 +- package-lock.json | 42 ++++++++++++++++++++++++++++++---- package.json | 2 +- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/build/utils/compose-fetcher.js b/build/utils/compose-fetcher.js index bf3564c..c22725e 100644 --- a/build/utils/compose-fetcher.js +++ b/build/utils/compose-fetcher.js @@ -11,7 +11,7 @@ const LogFormat = { }; const API_DELAY_MSEC = 2500; -const API_MAX_RETRIES = 5; +const API_MAX_RETRIES = 10; const API_RATE_LIMIT = ` rateLimit { limit diff --git a/package-lock.json b/package-lock.json index d151690..be31871 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "dompurify": "^2.0.7", "lit-element": "^2.2.1", "marked": "^0.7.0", - "node-fetch": "^2.6.1", + "node-fetch": "^2.7.0", "posthtml": "^0.12.0", "rollup": "^1.24.0", "rollup-plugin-babel": "^4.3.3", @@ -863,11 +863,23 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/object-assign": { @@ -1139,6 +1151,12 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -1152,6 +1170,22 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index ef5cddb..7085aa0 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dompurify": "^2.0.7", "lit-element": "^2.2.1", "marked": "^0.7.0", - "node-fetch": "^2.6.1", + "node-fetch": "^2.7.0", "posthtml": "^0.12.0", "rollup": "^1.24.0", "rollup-plugin-babel": "^4.3.3",