robdiciuccio commented on a change in pull request #13696:
URL: https://github.com/apache/superset/pull/13696#discussion_r598980966



##########
File path: superset-frontend/src/middleware/asyncEvent.ts
##########
@@ -25,178 +24,240 @@ import {
   parseErrorJson,
 } from '../utils/getClientErrorObject';
 
-export type AsyncEvent = {
-  id: string;
+type AsyncEvent = {
+  id?: string | null;
   channel_id: string;
   job_id: string;
-  user_id: string;
+  user_id?: string;
   status: string;
-  errors: SupersetError[];
-  result_url: string;
-};
-
-type AsyncEventOptions = {
-  config: {
-    GLOBAL_ASYNC_QUERIES_TRANSPORT: string;
-    GLOBAL_ASYNC_QUERIES_POLLING_DELAY: number;
-  };
-  getPendingComponents: (state: any) => any[];
-  successAction: (componentId: number, componentData: any) => { type: string };
-  errorAction: (componentId: number, response: any) => { type: string };
-  processEventsCallback?: (events: AsyncEvent[]) => void; // this is currently 
used only for tests
+  errors?: SupersetError[];
+  result_url: string | null;
 };
 
 type CachedDataResponse = {
-  componentId: number;
   status: string;
   data: any;
 };
+type AppConfig = Record<string, any>;
+type ListenerFn = (asyncEvent: AsyncEvent) => Promise<any>;

Review comment:
       This could be a response payload for SQL Lab as well (in the future), 
which is the reason why it's generic. Well, that and laziness.




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to