unbridled-41 opened a new pull request, #5443:
URL: https://github.com/apache/rocketmq-dashboard/pull/5443

   ## Problem / Evidence
   
   Deleting a topic through its own row action leaves the checkbox selection 
pointing at the deleted row, so the batch delete is permanently stuck failing.
   
   - `web/src/pages/instance/topic.tsx:668-676` (pre-fix) reloaded the page 
after a successful delete but never touched `selectedRowKeys`; the batch button 
renders from that state (`:1570-1608`) and its failure path re-seeds it 
(`setSelectedRowKeys(failed)`).
   - Reproduction: check a topic's checkbox → delete that topic from its row 
action (the row disappears) → the "删除 (1)" button is still there → click it → 
the server rejects the delete (the topic is gone) → "1 个 Topic 删除失败" and the 
selection is re-seeded, with no visible row left to uncheck.
   - The sibling page already prunes: `consumer.tsx:1054-1057` filters the 
deleted name out of the selection after a successful single delete.
   
   ## Root cause / Fix
   
   Missing selection reconciliation after a row-removing mutation. Prune the 
deleted name, mirroring the consumer page:
   
   ```ts
   setSelectedRowKeys((previous) => previous.filter((key) => key !== 
topic.name));
   ```
   
   ## Priority & scoring
   
   PRIORITY 50 = 影响 12 (a permanently armed batch action that can only fail, 
with nothing on screen to clear it) + 波及 8 (topic list selection) + 可复现 20 
(deterministic) + 维护价值 10 (matches the precedent in the sibling page).
   
   FIX_CONFIDENCE 85: one line in the delete handler plus a regression.
   
   ## Tests
   
   ```
   cd web && npx vitest run src/pages/instance/__tests__/TopicPage.test.tsx
   ```
   
   - Red before the fix: `drops a deleted topic from the selection so the batch 
delete cannot re-submit it` fails — the "删除 (1)" button survives the row's 
deletion.
   - Green after: `Tests 35 passed (35)`.
   - `npx tsc -b` and `npx eslint` on both files: clean.
   
   ## Risk
   
   Low. Only the selection array is touched after a successful single delete; 
the batch path already manages its own selection.


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

Reply via email to