Commit 1039cf9
committed
fix(clients): build URL after request interceptors + thread finalError through error chain
`client-next`: `beforeRequest()` computed the final URL before any request
interceptor ran, so request interceptors that mutated `opts.baseUrl`,
`opts.url`, `opts.path`, or `opts.query` had no effect — the pre-interceptor
URL was already closed over by the fetch call. Move `buildUrl(opts)` to
after the request interceptor loop in both the `request` and `makeSseFn`
paths so interceptor mutations are honored.
`client-next`, `client-ky`, `client-fetch`: error interceptor chains passed
`error` (the raw initial error) into every interceptor invocation instead
of `finalError` (the running accumulator). This broke composition: each
interceptor saw the original error rather than the previous interceptor's
output, so transformations from earlier interceptors were silently
discarded. Thread `finalError` through instead, matching how `client-angular`
and `client-ofetch` already work.
Fixes #3803.1 parent 6cf6b1a commit 1039cf9
187 files changed
Lines changed: 495 additions & 399 deletions
File tree
- .changeset
- packages
- openapi-ts-tests
- __snapshots__/plugins/@tanstack/meta/client
- main/test/__snapshots__
- 2.0.x
- body-response-text-plain/client
- form-data/client
- plugins
- @hey-api
- client-fetch
- sdk-nested-classes-instance/client
- sdk-nested-classes/client
- sdk
- default/client
- instance/client
- throwOnError/client
- typescript
- transforms-read-write-custom-name/client
- transforms-read-write-ignore/client
- @pinia/colada
- asClass/client
- fetch/client
- @tanstack
- angular-query-experimental
- asClass/client
- fetch/client
- name-builder/client
- preact-query
- asClass/client
- fetch/client
- name-builder/client
- react-query
- asClass/client
- fetch/client
- name-builder/client
- useMutation/client
- solid-query
- asClass/client
- fetch/client
- name-builder/client
- svelte-query
- asClass/client
- fetch/client
- name-builder/client
- vue-query
- asClass/client
- fetch/client
- name-builder/client
- schema-unknown/client
- security-api-key/client
- security-basic/client
- security-false/client
- security-oauth2/client
- servers-base-path/client
- servers-host/client
- servers/client
- transforms-read-write/client
- 3.0.x
- body-binary-format/client
- body-response-text-plain/client
- internal-name-conflict/client
- parameter-explode-false/client
- plugins
- @hey-api
- client-fetch
- sdk-nested-classes-instance/client
- sdk-nested-classes/client
- sdk
- default/client
- instance/client
- throwOnError/client
- typescript
- transforms-read-write-custom-name/client
- transforms-read-write-ignore/client
- @pinia/colada
- asClass/client
- fetch/client
- @tanstack
- angular-query-experimental
- asClass/client
- fetch/client
- name-builder/client
- preact-query
- asClass/client
- fetch/client
- name-builder/client
- react-query
- asClass/client
- fetch/client
- name-builder/client
- useMutation/client
- solid-query
- asClass/client
- fetch/client
- name-builder/client
- svelte-query
- asClass/client
- fetch/client
- name-builder/client
- vue-query
- asClass/client
- fetch/client
- name-builder/client
- security-api-key/client
- security-false/client
- security-http-bearer/client
- security-oauth2/client
- security-open-id-connect/client
- servers/client
- transformers-all-of/client
- transformers-allof-response-wrapper/client
- transformers-any-of-null/client
- transformers-array/client
- transformers-recursive/client
- transforms-read-write/client
- 3.1.x
- body-response-text-plain/client
- clients/@hey-api
- client-fetch
- base-url-false/client
- base-url-number/client
- base-url-strict/client
- base-url-string/client
- clean-false/client
- default/client
- import-file-extension-ts/client
- sdk-client-optional/client
- sdk-client-required/client
- tsconfig-node16-sdk/client
- tsconfig-nodenext-sdk/client
- client-ky
- base-url-false/client
- base-url-number/client
- base-url-strict/client
- base-url-string/client
- clean-false/client
- default/client
- import-file-extension-ts/client
- sdk-client-optional/client
- sdk-client-required/client
- tsconfig-node16-sdk/client
- tsconfig-nodenext-sdk/client
- client-next
- base-url-false/client
- base-url-number/client
- base-url-strict/client
- base-url-string/client
- clean-false/client
- default/client
- import-file-extension-ts/client
- sdk-client-optional/client
- sdk-client-required/client
- tsconfig-node16-sdk/client
- tsconfig-nodenext-sdk/client
- headers/client
- internal-name-conflict/client
- pagination-ref/client
- parameter-explode-false/client
- plugins
- @hey-api
- client-fetch
- sdk-nested-classes-instance/client
- sdk-nested-classes/client
- sdk
- default/client
- instance/client
- throwOnError/client
- typescript
- transforms-read-write-custom-name/client
- transforms-read-write-ignore/client
- @pinia/colada
- asClass/client
- fetch/client
- @tanstack
- angular-query-experimental
- asClass/client
- fetch/client
- name-builder/client
- preact-query
- asClass/client
- fetch/client
- name-builder/client
- react-query
- asClass/client
- fetch/client
- name-builder/client
- useMutation/client
- solid-query
- asClass/client
- fetch/client
- name-builder/client
- svelte-query
- asClass/client
- fetch/client
- name-builder/client
- vue-query
- asClass/client
- fetch/client
- name-builder/client
- security-api-key/client
- security-false/client
- security-http-bearer/client
- security-oauth2/client
- security-open-id-connect/client
- servers/client
- sse-fetch/client
- sse-next/client
- sse-tanstack-react-query/client
- transformers-additional-properties/client
- transformers-all-of/client
- transformers-allof-response-wrapper/client
- transformers-any-of-null/client
- transformers-array/client
- transformers-one-of-discriminated/client
- transformers-recursive/client
- transforms-read-write/client
- sdks/__snapshots__
- method-class-conflict
- class/client
- flat/client
- instance/client
- opencode
- export-all/client
- flat/client
- grouped/client
- valibot/v1/__snapshots__/3.1.x/type-format/client
- zod/v4/__snapshots__
- 2.0.x
- mini/type-format/client
- v3/type-format/client
- v4/type-format/client
- 3.0.x
- mini/type-format/client
- v3/type-format/client
- v4/type-format/client
- 3.1.x
- mini/type-format/client
- v3/type-format/client
- v4/type-format/client
- openapi-ts/src/plugins/@hey-api
- client-fetch/bundle
- client-ky/bundle
- client-next/bundle
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
0 commit comments