messere1 opened a new pull request, #7046:
URL: https://github.com/apache/rocketmq-dashboard/pull/7046

   ### Which Issue(s) This PR Fixes
   
   Fixes: none - no issue filed for this defect
   
   ### What This PR Does
   
   Deleting a single consumer group from the Group page failed silently. The 
row action's
   `Modal.confirm` `onOk` ran its body without any `catch`:
   
   ```ts
   onOk: async () => {
     await deleteConsumerGroup(record.name, selectedInstanceId || undefined);
     await reloadConsumerGroupPage();
     ...
   },
   ```
   
   antd's confirm wrapper only closes the dialog on the fulfilled path — a 
rejected `onOk`
   is silently dropped — so when the delete request failed (network error, 
ownership
   conflict, broker down) the dialog just stayed open with no outcome at all: 
no toast, no
   feedback, and a row that still existed on the server.
   
   The neighboring flows all report their failures: the topic page's delete 
shows
   `删除 Topic 失败,请稍后重试`, this page's create flow catches and surfaces
   `consumer.createFailed`, and the batch delete reports per-item failures. The 
single
   group delete was the only silent path.
   
   The fix wraps the body in `try/catch` and surfaces a new 
`consumer.deleteFailed` message
   (zh: `删除消费组失败,请稍后重试`, en: `Failed to delete consumer group. Please try again
   later.`), mirroring `consumer.createFailed` on the create path of the same 
page.
   
   ### Verification
   
   Red/green in `src/pages/instance/__tests__/ConsumerPage.test.tsx`:
   
   - new test "reports a failed consumer group deletion instead of staying 
silent" — rejects
     `deleteConsumerGroup`, clicks the row 删除 action, then asserts the toast 
and that the
     row is still listed. It **fails on unpatched trunk** with `Unable to find 
an element
     with the text: 删除消费组失败,请稍后重试` and passes with this patch.
   - `npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx` — **57 
passed + 1
     pre-existing failure** (58 total, 33 pre-existing + 1 new in this file's 
describe): the
     failing test is "highlights inconsistent subscriptions and refreshes the 
check result",
     which fails identically on unpatched trunk in this environment — the 
details modal's 2s
     auto-refresh races the two queued mock subscription responses on slow 
runners and is
     unrelated to this change.
   - `npx vitest run src/i18n/__tests__/translations.test.ts` — **2/2**.
   - `npx tsc -b` clean; lint-staged (eslint + prettier) clean on the staged 
files.
   
   Assisted-by: ZCode
   
   Signed-off-by: messere1 <[email protected]>
   


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