yyqdbngt opened a new pull request, #5809:
URL: https://github.com/apache/rocketmq-dashboard/pull/5809
## Why
The Proxy tab restart action confirms via `Modal.confirm`, but its `onOk`
handler awaited `restartProxy()` without any error handling. When the restart
request is rejected, the confirm dialog just closes: no toast, no error state —
the operator learns nothing about the failed restart. Every sibling operation
on this page (`handleNsDelete`, config submit, connection test) reports
failures with `message.error`; this one diverged.
## What changed
`web/src/pages/cluster/index.tsx`: wrap the restart `onOk` body in try/catch
and show `t("common.operationFailed")` when `restartProxy` (or the follow-up
refresh) rejects.
## Validation
- Added a regression test in
`web/src/pages/cluster/__tests__/ClusterPage.test.tsx`: mock `restartProxy` to
reject, click 重启 → 确认, assert `message.error` is called. Fails on the old code
(0 calls), passes after the fix.
- Full ClusterPage test file passes (31 tests).
--
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]