LevisNgigi commented on code in PR #35998:
URL: https://github.com/apache/superset/pull/35998#discussion_r2518919394


##########
superset-frontend/src/components/Chart/chartReducer.ts:
##########
@@ -67,6 +67,15 @@ export default function chartReducer(
       };
     },
     [actions.CHART_UPDATE_STARTED](state) {
+      const controller = state.queryController;
+      /**
+       * Race condition fix for cross-filters:
+       * When a filter is removed while charts are loading, abort the
+       * in-flight request to prevent stale filtered data from rendering.
+       */
+      if (controller) {
+        setTimeout(() => controller.abort(), 0);

Review Comment:
   Yes, we require setTimeout in this context to defer state update to the next 
event loop. This prevents the warning about updating state on an unmounted 
component as the cleanup runs during the components removal.



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

Reply via email to