Skip to content
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

Migrate to undici 7 #401

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/app/backend-http-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
"postversion": "biome check --write package.json"
},
"dependencies": {
"@lokalise/node-core": "^13.0.0",
"undici": "^6.19.8",
"undici-retry": "^5.0.3",
"@lokalise/node-core": "^13.1.0",
"undici": "^7.1.0",
"undici-retry": "^6.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@lokalise/biome-config": "^1.5.0",
"@types/node": "^22.7.6",
"@types/node": "^22.10.1",
"@vitest/coverage-v8": "^2.1.3",
"typescript": "^5.7.2",
"vitest": "^2.1.3"
Expand Down
14 changes: 7 additions & 7 deletions packages/app/backend-http-client/src/client/httpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function sendGet<
reset: options.disableKeepAlive ?? false,
bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
throwOnError: false,
throwOnError: undefined,
},
resolveRetryConfig(options),
resolveRequestConfig(options),
Expand Down Expand Up @@ -93,7 +93,7 @@ export async function sendDelete<
reset: options.disableKeepAlive ?? false,
bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
throwOnError: false,
throwOnError: undefined,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undici no longer supports this as a parameter and expects https://undici.nodejs.org/#/docs/api/Dispatcher?id=responseerror to be used instead.

Since we always consumed this parameter directly instead of relying on undici handling (in order to provide sufficient amount of error details), we just ensure that we no longer pass-through this parameter.

},
resolveRetryConfig(options),
resolveRequestConfig(options),
Expand Down Expand Up @@ -134,7 +134,7 @@ export async function sendPost<
reset: options.disableKeepAlive ?? false,
bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
throwOnError: false,
throwOnError: undefined,
},
resolveRetryConfig(options),
resolveRequestConfig(options),
Expand Down Expand Up @@ -175,7 +175,7 @@ export async function sendPostBinary<
reset: options.disableKeepAlive ?? false,
bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
throwOnError: false,
throwOnError: undefined,
},
resolveRetryConfig(options),
resolveRequestConfig(options),
Expand Down Expand Up @@ -216,7 +216,7 @@ export async function sendPut<
reset: options.disableKeepAlive ?? false,
bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
throwOnError: false,
throwOnError: undefined,
},
resolveRetryConfig(options),
resolveRequestConfig(options),
Expand Down Expand Up @@ -257,7 +257,7 @@ export async function sendPutBinary<
reset: options.disableKeepAlive ?? false,
bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
throwOnError: false,
throwOnError: undefined,
},
resolveRetryConfig(options),
resolveRequestConfig(options),
Expand Down Expand Up @@ -298,7 +298,7 @@ export async function sendPatch<
reset: options.disableKeepAlive ?? false,
bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
throwOnError: false,
throwOnError: undefined,
},
resolveRetryConfig(options),
resolveRequestConfig(options),
Expand Down
Loading