-
-
Notifications
You must be signed in to change notification settings - Fork 238
ref: Use undici to download binary #2993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b341615 to
99bef89
Compare
15cb52d to
0c9cd59
Compare
CHANGELOG.md
Outdated
|
|
||
| ### Internal changes | ||
|
|
||
| - Removed `node-fetch` dependency when using the NPM package ([#2993](https://github.com/getsentry/sentry-cli/pull/2993)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Removed `node-fetch` dependency when using the NPM package ([#2993](https://github.com/getsentry/sentry-cli/pull/2993)) | |
| - Removed `node-fetch` and `https-proxy-agent` dependencies when using the NPM package ([#2993](https://github.com/getsentry/sentry-cli/pull/2993)) |
CHANGELOG.md
Outdated
| ### Internal changes | ||
|
|
||
| - Removed `node-fetch` dependency when using the NPM package ([#2993](https://github.com/getsentry/sentry-cli/pull/2993)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an internal change, we should not include it in the changelog imo.
| ### Internal changes | |
| - Removed `node-fetch` dependency when using the NPM package ([#2993](https://github.com/getsentry/sentry-cli/pull/2993)) |
I would also update the PR title from feat: to ref:, as it is not really a new feature from the user perspective. And, that way, the DangerJS action will not complain about a missing changelog entry, since changelog entries are not required for ref: PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it and renamed the PR
f1119df to
36bbead
Compare
60bb5c0 to
c7f20b7
Compare
a69c17c to
fdc3cae
Compare
fdc3cae to
bc0a8dc
Compare
c7f20b7 to
d0453c4
Compare
bc0a8dc to
8d3aa8b
Compare
d0453c4 to
2c953fe
Compare
8d3aa8b to
d7fc80e
Compare
This removes `node-fetch` entirely. We could have upgrade to `node-fetch@3`, but this one requires ESM-only, which we can't support (we still need CJS support for our `@sentry/*` bundler packages). With this PR we use now `undici` which also has a `ProxyAgent` included, so we got rid of `https-proxy-agent` as well. Closes #1810 Closes [CLI-25](https://linear.app/getsentry/issue/CLI-25/upgrade-to-node-fetch-v3-to-avoid-punycode-deprecation-warning)
This removes `node-fetch` entirely. We could have upgrade to `node-fetch@3`, but this one requires ESM-only, which we can't support (we still need CJS support for our `@sentry/*` bundler packages). With this PR we use now `undici` which also has a `ProxyAgent` included, so we got rid of `https-proxy-agent` as well. Closes #1810 Closes [CLI-25](https://linear.app/getsentry/issue/CLI-25/upgrade-to-node-fetch-v3-to-avoid-punycode-deprecation-warning)
d7fc80e to
fbd68c2
Compare
2c953fe to
98e6185
Compare
98e6185 to
6b32ed2
Compare
fbd68c2 to
004923c
Compare
6b32ed2 to
3679dc2
Compare
5529ca5 to
7a09a4e
Compare
This removes `node-fetch` entirely. We could have upgrade to `node-fetch@3`, but this one requires ESM-only, which we can't support (we still need CJS support for our `@sentry/*` bundler packages). With this PR we use now `undici` which also has a `ProxyAgent` included, so we got rid of `https-proxy-agent` as well. Closes #1810 Closes [CLI-25](https://linear.app/getsentry/issue/CLI-25/upgrade-to-node-fetch-v3-to-avoid-punycode-deprecation-warning)
0f60c1c to
e06b170
Compare
7a09a4e to
aa1e54c
Compare
| } else { | ||
| resolve(); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Download integrity check unreliable with compressed responses
The connection interrupted check compares downloadedBytes against totalBytes to detect truncated downloads. However, with undici's transparent decompression, downloadedBytes counts decompressed bytes while totalBytes may still be the compressed content-length (undici preserves this header). If a connection interrupts mid-transfer but enough compressed data was already received to decompress to more bytes than the compressed size, the check downloadedBytes < totalBytes evaluates to false, causing the download to be incorrectly accepted as complete. The old code avoided this by setting compress: false and tracking compressed bytes. While checksum validation provides a safety net, users who set SENTRYCLI_SKIP_CHECKSUM_VALIDATION=1 lose protection against corrupted downloads in this scenario.
This removes
node-fetchentirely. We could have upgrade tonode-fetch@3, but this one requires ESM-only, which we can't support (we still need CJS support for our@sentry/*bundler packages).With this PR we use now
undiciwhich also has aProxyAgentincluded, so we got rid ofhttps-proxy-agentas well.Closes #1810
Closes CLI-25