massucattoj commented on code in PR #41019:
URL: https://github.com/apache/superset/pull/41019#discussion_r3486407734
##########
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:
Yeah you'r right about that. there is a boundary edge but from what i get
it's inherent to mixing offset pagination with the infinite-scroll merge. I
mean delete from page 0, the backend offset shifts, and the boundary row stays
hidden until reload. So I kept the optimistic updateQueryData instead of
invalidateTags, since a refetch would double-append through the custom merge
(EnxDev's bot called that out too). So deletion reflects immediately and it's a
strict improvement over today, with that rare case fixing itself on reload.
--
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]