msyavuz commented on code in PR #35998:
URL: https://github.com/apache/superset/pull/35998#discussion_r2533208729
##########
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 guess the only other way is to write a custom middleware to do what you do
here but i think this is fine and should cause no race conditions. Tagging
@kgabryje for on opinion just in case
--
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]