ashb commented on code in PR #51735:
URL: https://github.com/apache/airflow/pull/51735#discussion_r2147474245


##########
airflow-core/src/airflow/ui/openapi-gen/requests/core/CancelablePromise.ts:
##########
@@ -1,34 +1,42 @@
 export class CancelError extends Error {
+  public get isCancelled(): boolean {
+    return true;
+  }
+
   constructor(message: string) {
     super(message);
     this.name = "CancelError";
   }
-
-  public get isCancelled(): boolean {
-    return true;
-  }
 }
 
-export interface OnCancel {
-  readonly isResolved: boolean;
-  readonly isRejected: boolean;
+export type OnCancel = {
   readonly isCancelled: boolean;
+  readonly isRejected: boolean;
+  readonly isResolved: boolean;
 
   (cancelHandler: () => void): void;
 }
 
 export class CancelablePromise<T> implements Promise<T> {
-  private _isResolved: boolean;
-  private _isRejected: boolean;
-  private _isCancelled: boolean;
-  readonly cancelHandlers: (() => void)[];
+  readonly cancelHandlers: Array<() => void>;
   readonly promise: Promise<T>;
-  private _resolve?: (value: T | PromiseLike<T>) => void;
+  public get isCancelled(): boolean {
+    return this._isCancelled;
+  }
+  get [Symbol.toStringTag]() {
+    return "Cancellable Promise";
+  }
+  private _isCancelled: boolean;
+  private _isRejected: boolean;
+  private _isResolved: boolean;
+
   private _reject?: (reason?: unknown) => void;
 
+  private _resolve?: (value: PromiseLike<T> | T) => void;
+
   constructor(
     executor: (
-      resolve: (value: T | PromiseLike<T>) => void,
+      resolve: (value: PromiseLike<T> | T) => void,

Review Comment:
   Like this - feels unrelated 



##########
airflow-core/src/airflow/ui/openapi-gen/requests/core/OpenAPI.ts:
##########
@@ -3,18 +3,19 @@ import type { AxiosRequestConfig, AxiosResponse } from 
"axios";
 import type { ApiRequestOptions } from "./ApiRequestOptions";
 
 type Headers = Record<string, string>;
-type Middleware<T> = (value: T) => T | Promise<T>;
+type Middleware<T> = (value: T) => Promise<T> | T;
 type Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T>;
 
 export class Interceptors<T> {
-  _fns: Middleware<T>[];
+  _fns: Array<Middleware<T>>;

Review Comment:
   And here etc



-- 
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]

Reply via email to