aminghadersohi commented on code in PR #39535:
URL: https://github.com/apache/superset/pull/39535#discussion_r3437373068
##########
superset-frontend/packages/superset-ui-core/src/connection/types.ts:
##########
@@ -26,10 +26,18 @@ export type FetchRetryOptions = {
retries?: number;
retryDelay?:
| number
- | ((attempt: number, error: Error, response: Response) => number);
+ | ((
+ attempt: number,
+ error: Error | null,
+ response: Response | null,
Review Comment:
This widening (`error: Error | null`, `response: Response | null`) correctly
matches `fetch-retry`'s actual call-site signature, but it is a
TypeScript-breaking change for downstream consumers. Parameter types are
contravariant: a consumer who wrote `(attempt: number, error: Error, response:
Response) => number` and assigned it to `FetchRetryOptions['retryDelay']` will
now get a TS compile error because `(error: Error) => ...` is not assignable to
`(error: Error | null) => ...`.
Since `FetchRetryOptions` is a public export of `superset-ui-core`, this
should be noted in `UPDATING.md` so consumers know to widen their callback
signatures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]