fix(sqllab): flaky json explore modal due to shallow equality checks for extra data (#29978)

This commit is contained in:
JUST.in DO IT
2024-08-22 07:28:08 +09:00
committed by GitHub
parent 7650c47e72
commit 1ca5947a7d
2 changed files with 42 additions and 1 deletions

View File

@@ -17,6 +17,8 @@
* under the License.
*/
import { normalizeTimestamp, QueryState, t } from '@superset-ui/core';
import { isEqual, omit } from 'lodash';
import { shallowEqual } from 'react-redux';
import * as actions from '../actions/sqlLab';
import { now } from '../../utils/dates';
import {
@@ -696,7 +698,17 @@ export default function sqlLabReducer(state = {}, action) {
? prevState
: currentState,
};
change = true;
if (
shallowEqual(
omit(newQueries[id], ['extra']),
omit(state.queries[id], ['extra']),
) &&
isEqual(newQueries[id].extra, state.queries[id].extra)
) {
newQueries[id] = state.queries[id];
} else {
change = true;
}
}
});
if (!change) {