From cdfb4e5443e2884563cea43c0a779f6dd0cacaec Mon Sep 17 00:00:00 2001 From: richardfn Date: Wed, 12 Nov 2025 21:13:56 -0300 Subject: [PATCH 1/2] fix(dashboard): abort previous chart queries when filters change to prevent stale data rendering --- superset-frontend/src/components/Chart/chartReducer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/superset-frontend/src/components/Chart/chartReducer.ts b/superset-frontend/src/components/Chart/chartReducer.ts index 081bd4154724..f82ef3b1e903 100644 --- a/superset-frontend/src/components/Chart/chartReducer.ts +++ b/superset-frontend/src/components/Chart/chartReducer.ts @@ -67,6 +67,10 @@ export default function chartReducer( }; }, [actions.CHART_UPDATE_STARTED](state) { + if (state.queryController) { + state.queryController.abort(); + } + return { ...state, chartStatus: 'loading', From 39689cd2c4ebe6af631a6858a9a2aca137a5bc63 Mon Sep 17 00:00:00 2001 From: richardfn Date: Wed, 12 Nov 2025 21:30:54 -0300 Subject: [PATCH 2/2] fix(dashboard): abort previous chart queries when filters change to prevent stale data rendering --- superset-frontend/src/components/Chart/chartAction.js | 7 +++++++ superset-frontend/src/components/Chart/chartReducer.ts | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/components/Chart/chartAction.js b/superset-frontend/src/components/Chart/chartAction.js index ff1d6744bf17..82e65f9bd2c6 100644 --- a/superset-frontend/src/components/Chart/chartAction.js +++ b/superset-frontend/src/components/Chart/chartAction.js @@ -408,6 +408,13 @@ export function exploreJSON( ) { return async (dispatch, getState) => { const logStart = Logger.getTimestamp(); + + // Abort previous query if one exists + const { charts } = getState(); + if (charts[key]?.queryController) { + charts[key].queryController.abort(); + } + const controller = new AbortController(); const queryTimeout = timeout || getState().common.conf.SUPERSET_WEBSERVER_TIMEOUT; diff --git a/superset-frontend/src/components/Chart/chartReducer.ts b/superset-frontend/src/components/Chart/chartReducer.ts index f82ef3b1e903..081bd4154724 100644 --- a/superset-frontend/src/components/Chart/chartReducer.ts +++ b/superset-frontend/src/components/Chart/chartReducer.ts @@ -67,10 +67,6 @@ export default function chartReducer( }; }, [actions.CHART_UPDATE_STARTED](state) { - if (state.queryController) { - state.queryController.abort(); - } - return { ...state, chartStatus: 'loading',