bito-code-review[bot] commented on PR #41019:
URL: https://github.com/apache/superset/pull/41019#issuecomment-4737164504

   <!-- Bito Reply -->
   When an item is removed from the cache via `removeQuery`, the `draft.count` 
is decremented and the item is spliced from the `result` array. If you navigate 
to the next page, the API will typically fetch the data again based on the 
updated state or the backend will return the correct page of results. Since the 
cache is updated locally, the UI will reflect the removal immediately, and 
subsequent pagination requests will rely on the updated count and result set, 
preventing the 'hidden' item issue.
   
   **superset-frontend/src/SqlLab/actions/sqlLab.ts**
   ```
   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);
                 }
   ```


-- 
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]

Reply via email to