rusackas commented on code in PR #41019:
URL: https://github.com/apache/superset/pull/41019#discussion_r3524026920
##########
superset-frontend/src/SqlLab/actions/sqlLab.ts:
##########
@@ -996,7 +998,22 @@ export function removeQuery(query: Query):
SqlLabThunkAction<Promise<unknown>> {
: Promise.resolve();
return sync
- .then(() => dispatch({ type: REMOVE_QUERY, query }))
+ .then(() => {
+ dispatch({ type: REMOVE_QUERY, query });
+ dispatch(
+ queryHistoryApi.util.updateQueryData(
+ 'editorQueries',
+ { editorId: queryEditorId },
+ draft => {
+ const index = draft.result.findIndex(({ id }) => id ===
query.id);
+ if (index !== -1) {
+ draft.result.splice(index, 1);
+ draft.count = Math.max(0, draft.count - 1);
Review Comment:
This one's real... the `editorQueries` merge is a blind append with no
dedup, so offset shifts between page fetches can put the same id in the cache
twice, and the splice only removed one copy. Fixed in 2928539 with a filter
over all matches (count still drops by 1 since only one server row is deleted),
plus a test seeding a duplicated cache entry.
--
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]