Compare commits

...

1 Commits

Author SHA1 Message Date
Maxime Beauchemin
b02e96cf12 fix(sqllab): query deletion not updating UI in query history
The delete API call succeeded but the RTK Query cache wasn't invalidated, causing deleted queries to remain visible until page refresh. Added cache invalidation to immediately update the UI.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 00:47:45 -07:00

View File

@@ -38,6 +38,7 @@ import {
import { LOG_ACTIONS_SQLLAB_FETCH_FAILED_QUERY } from 'src/logger/LogUtils';
import getBootstrapData from 'src/utils/getBootstrapData';
import { logEvent } from 'src/logger/actions';
import { api } from 'src/hooks/apiResources/queryApi';
import { newQueryTabName } from '../utils/newQueryTabName';
import getInitialState from '../reducers/getInitialState';
import { rehydratePersistedState } from '../utils/reduxStateToLocalStorageHelper';
@@ -765,7 +766,11 @@ export function removeQuery(query) {
: Promise.resolve();
return sync
.then(() => dispatch({ type: REMOVE_QUERY, query }))
.then(() => {
dispatch({ type: REMOVE_QUERY, query });
// Invalidate RTK Query cache to update the UI
dispatch(api.util.invalidateTags(['EditorQueries']));
})
.catch(() =>
dispatch(
addDangerToast(