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


##########
superset-frontend/src/components/Chart/chartReducer.ts:
##########
@@ -67,6 +67,9 @@ export default function chartReducer(
       };
     },
     [actions.CHART_UPDATE_STARTED](state) {
+      if (state.queryController) {
+        state.queryController.abort();

Review Comment:
   Direct mutation of `state` violates Redux reducer principles. The `abort()` 
call should be made on the controller before returning the new state object, 
but the state parameter should not be mutated. While the abort side effect is 
intentional and necessary, this pattern is inconsistent with Redux best 
practices. Consider extracting the controller to a local variable first: `const 
controller = state.queryController; if (controller) { controller.abort(); }`
   ```suggestion
         const controller = state.queryController;
         if (controller) {
           controller.abort();
   ```



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