-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Description
PR #6982 introduced a breaking change to types that seems to not have been noticed by the PR author nor reviewer.
The type signature of AxiosError changed in a non-backwards compatible way:
Previously, you guaranteed that if cause is not-null, that it would be an Error, allowing users to do axiosError.cause?.message.
This change makes this code throw a type error when upgrading:
src/services/backendClient.ts:133:70 - error ts(2339): Property 'message' does not exist on type '{}'.
133 detail: `Failed to make request: ${axiosError.cause?.message}`,
~~~~~~~
(This happened to us in https://github.com/loculus-project/loculus/actions/runs/17924683778/job/50967768780?pr=5071#step:7:76)
It seems that the LLM-generated PR-review message didn't catch that at all and was misleading:
Types: Ensures
AxiosError.cause?: unknownandevent?: ProgressEventare present in type definitions.
Type declarations updated to include safe optional fields:cause?: unknownandevent?: ProgressEvent.🧵 Any breaking changes?
No breaking API changes. This preserves backwards-compatible optional behaviors; adapters will still function normally if no err.code or event is present.
This is in fact a non-backwards compatible change.
Originally posted by @corneliusroemer in #6982 (comment)