This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ff24e2f27d fix: fix error with dashboard filters when global async 
queries is enabled and user navigates quickly (#36639)
ff24e2f27d is described below

commit ff24e2f27d615c57ba599f196d1b31b000fd35d1
Author: Levis Mbote <[email protected]>
AuthorDate: Tue Dec 23 17:53:01 2025 +0300

    fix: fix error with dashboard filters when global async queries is enabled 
and user navigates quickly (#36639)
---
 .../src/components/Chart/chartAction.js            | 14 ++++++++++----
 .../src/components/Chart/chartActions.test.js      | 22 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/src/components/Chart/chartAction.js 
b/superset-frontend/src/components/Chart/chartAction.js
index bd9bd94a56..d8ad30d793 100644
--- a/superset-frontend/src/components/Chart/chartAction.js
+++ b/superset-frontend/src/components/Chart/chartAction.js
@@ -476,7 +476,16 @@ export function exploreJSON(
         return dispatch(chartUpdateSucceeded(queriesResponse, key));
       })
       .catch(response => {
+        // Ignore abort errors - they're expected when filters change quickly
+        const isAbort =
+          response?.name === 'AbortError' || response?.statusText === 'abort';
+        if (isAbort) {
+          // Abort is expected: filters changed, chart unmounted, etc.
+          return dispatch(chartUpdateStopped(key));
+        }
+
         if (isFeatureEnabled(FeatureFlag.GlobalAsyncQueries)) {
+          // In async mode we just pass the raw error response through
           return dispatch(chartUpdateFailed([response], key));
         }
 
@@ -494,10 +503,7 @@ export function exploreJSON(
             }),
           );
         };
-        if (response.name === 'AbortError') {
-          appendErrorLog('abort');
-          return dispatch(chartUpdateStopped(key));
-        }
+
         return getClientErrorObject(response).then(parsedResponse => {
           if (response.statusText === 'timeout') {
             appendErrorLog('timeout');
diff --git a/superset-frontend/src/components/Chart/chartActions.test.js 
b/superset-frontend/src/components/Chart/chartActions.test.js
index 4d57f53c2c..18c28de4ab 100644
--- a/superset-frontend/src/components/Chart/chartActions.test.js
+++ b/superset-frontend/src/components/Chart/chartActions.test.js
@@ -357,6 +357,28 @@ describe('chart actions', () => {
       });
     });
 
+    test('should dispatch CHART_UPDATE_STOPPED action upon abort', () => {
+      fetchMock.post(
+        MOCK_URL,
+        { throws: { name: 'AbortError' } },
+        { overwriteRoutes: true },
+      );
+
+      const timeoutInSec = 100;
+      const actionThunk = actions.postChartFormData({}, false, timeoutInSec);
+
+      return actionThunk(dispatch, mockGetState).then(() => {
+        const types = dispatch.args
+          .map(call => call[0] && call[0].type)
+          .filter(Boolean);
+
+        expect(types).toContain(actions.CHART_UPDATE_STOPPED);
+        expect(types).not.toContain(actions.CHART_UPDATE_FAILED);
+
+        setupDefaultFetchMock();
+      });
+    });
+
     test('should handle the bigint without regression', async () => {
       getExploreUrlStub.restore();
       const mockBigIntUrl = '/mock/chart/data/bigint';

Reply via email to