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


##########
superset-frontend/src/components/Chart/chartAction.js:
##########
@@ -422,6 +424,14 @@ export function exploreJSON(
       dispatch(updateDataMask(formData.slice_id, dataMask));
     };
     dispatch(chartUpdateStarted(controller, formData, key));
+    /**
+     * Abort in-flight requests after the new controller has been stored in
+     * state. Delaying ensures we do not mutate the Redux state between
+     * dispatches while still cancelling the previous request promptly.
+     */
+    if (prevController) {
+      setTimeout(() => prevController.abort(), 0);
+    }

Review Comment:
   I think that works fine for now, but as a long term solution, Claude 
suggests not storing abort controllers in Redux at all, since they're 
inherently mutable. Let's keep this solution for now to push this fix forward



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