Frun1na opened a new issue, #6111: URL: https://github.com/apache/rocketmq-dashboard/issues/6111
### Before Creating the Bug Report - [x] I have searched the [open issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository and believe that this is not a duplicate. - [x] This is a defect in RocketMQ Studio, not a usage question and not a defect in another Apache RocketMQ repository. - [x] I can reproduce this on the current `rocketmq-studio` branch, or I have stated the exact version I am running below. ### Studio Version branch: `rocketmq-studio` git commit id: `5e4c39b0` deployed as: reproduced by a unit test against that commit (the affected code is the web client) ### Runtime Environment OS: Ubuntu on WSL2 MySQL: not applicable — the defect is in the web client browser: not applicable — reproduced in a jsdom unit test (vitest + Testing Library) ### Connected RocketMQ Cluster RocketMQ version: not applicable — reproduced with a stubbed session endpoint in a unit test access mode: not applicable deployment: not applicable ### Describe the Bug The Studio-user session drawer reports a failed session read as an account without sessions. `web/src/pages/studio/UserManagement.tsx` (base `5e4c39b0`): - `loadSessionDetails` (`:214-233`) only toasts and clears the rows on failure (`setSessionDetails([])`, `userMgmt.loadSessionsFailed`), and collects no failure state; - the drawer's "active sessions" item renders `sessionDetailsLoading ? '-' : sessionDetails.length` (`:716-720`), which is `0` after a failed read; - the session table falls back to `locale={{ emptyText: t('userMgmt.noActiveSessions') }}` (`:743-745`), so the drawer says "暂无活跃会话" / "No active sessions". Both are claims the failed request cannot support, and it is a security-relevant view: an administrator opens this drawer to check whether an account still has live sessions. The only other hint is a toast that fades, and there is no retry inside the drawer. The same drawer already treats the genuinely empty case (all sessions revoked) as "no active sessions", which is why the two states have to be told apart. ### Steps to Reproduce Reproduced by a unit test rather than against a cluster; the endpoint stub is the only setup needed: 1. Render `UserManagementPage` with `listStudioUserSessions` rejecting (equivalently: open the drawer while `GET /studio/users/{id}/sessions` fails, e.g. a transient error). 2. Open the sessions drawer of a user with active sessions. 3. The drawer shows "活跃会话 0" and "暂无活跃会话" instead of the failure. ### What Did You Expect to See? The drawer should say the sessions could not be loaded and offer a retry, the way other list failures in the console do, instead of presenting the account as having no sessions. ### What Did You See Instead? "活跃会话 0" and an empty table reading "暂无活跃会话" after a transient toast. ### Additional Context - A fix with a regression test follows in a pull request. - The case is pinned by a unit test that fails on `5e4c39b0` (`expected document not to contain element, found <td …> 暂无活跃会话 </td>`), and the retry path is asserted by re-reading the sessions and showing a row. ### Are You Willing to Submit a Pull Request? - [x] Yes, I am willing to submit a pull request. -- 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]
