You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "unbridled-41 (via GitHub)" <gi...@apache.org> on 2026/09/12 17:55:14 UTC
[PR] fix(studio): reset the create-user form when the dialog is dismissed [rocketmq-dashboard]
unbridled-41 opened a new pull request, #4253:
URL: https://github.com/apache/rocketmq-dashboard/pull/4253
Fixes #4252.
## Problem / Evidence
The create-user dialog on the Studio user management page keeps its form mounted across open/close cycles and the cancel path only calls `setCreateOpen(false)`. A dismissed attempt therefore keeps the typed username, the typed initial password and the toggled admin switch, and the next open pre-fills all of them. An operator who changes only the username then creates the account with the previous attempt's password and admin flag (`createStudioUser` receives stale `admin: true`).
Repro: open dialog → fill username / initial password / enable admin → cancel → reopen → all three fields are still filled; submit after changing only the username sends the stale password and `admin: true`.
## Root cause / Fix
`onCancel` (web/src/pages/studio/UserManagement.tsx:513) closes the dialog without resetting the form, while the create-success path (`createUser`) and the reset-password dialog of the same file already call `createForm.resetFields()`. The fix adds `createForm.resetFields()` to the cancel path, mirroring those in-file precedents.
## Priority & scoring
PRIORITY 70 = impact 28 (a dismissed attempt silently produces an admin account with a credential the operator did not choose for it) + scope 11 (single dialog, core account-creation flow of the page) + reproducibility 18 (deterministic UI repro, covered by a regression test) + maintenance value 13 (aligns with the reset-on-cancel convention already used in this file and sibling create dialogs). FIX_CONFIDENCE 95: one-line handler change mirroring in-file precedents, red→green verified.
## Tests
- New regression `clears the create-user form after the dialog is dismissed` fills all three fields, cancels, reopens and asserts empty username/password and unchecked admin.
- Red on the unfixed code: `src/pages/studio/__tests__/UserManagement.test.tsx` → `Tests 1 failed | 6 passed (7)` with `× clears the create-user form after the dialog is dismissed`.
- Green with the fix: `Tests 7 passed (7)`.
- Full web suite `npx vitest run`: 982 tests, 1 failed — `ConsumerPage.test.tsx` ("shows group health diagnostics…"), a file this branch does not touch and a known load-fragile case under the parallel run; re-run in isolation: `Tests 31 passed (31)`.
- `npx tsc -b` clean; `npx eslint .` 0 errors (10 warnings, all in files this branch does not touch); `npx vite build` succeeds.
## Risk
Cancel now discards typed input by design, consistent with the create-success path and the reset-password dialog in the same file. No API, routing or state-manager changes; diff is one handler plus one test.
Head: 2343a152 (fix/studio-user-create-form-reset, 1 commit).
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(studio): reset the create-user form when the dialog is dismissed [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #4253: fix(studio): reset the create-user form when the dialog is dismissed
URL: https://github.com/apache/rocketmq-dashboard/pull/4253
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(studio): reset the create-user form when the dialog is dismissed [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #4253:
URL: https://github.com/apache/rocketmq-dashboard/pull/4253#issuecomment-5647666897
## Verification evidence
- **CI**: branch head `2343a1525546cadbbcd4abed4d4f43612b3ad358` (PR #4253) has exactly one workflow run for this head: "CI" (pull_request event), run 34709645518, conclusion=startup_failure — the upstream workflow fails at startup for every branch in this repository (including recent upstream merges), so no check-runs are produced (`check-runs total_count = 0`). This is unrelated to the change; all local verification below was run on this head.
- **Red light (unfixed code)**: with the regression test kept and the baseline `UserManagement.tsx` restored, `npx vitest run src/pages/studio/__tests__/UserManagement.test.tsx` → `Test Files 1 failed (1)`, `Tests 1 failed | 6 passed (7)`, failing item `× clears the create-user form after the dialog is dismissed` (username/password still filled after cancel+reopen).
- **Module tests (fixed)**: `npx vitest run src/pages/studio/__tests__/UserManagement.test.tsx` → `Tests 7 passed (7)`.
- **Full suite + baseline**: `npx vitest run` on this head → 120 files, `Tests 1 failed | 981 passed (982)`; the single failure is `ConsumerPage.test.tsx > shows group health diagnostics…`, a file untouched by this branch and a recurring load-fragile case under the parallel suite; re-run in isolation → `Tests 31 passed (31)`. Zero failures in files touched by this change.
- **Build**: `npx tsc -b` clean; `npx vite build` succeeds. `npx eslint .` → 0 errors, 10 warnings, all in files this branch does not touch (QueueBrowser.tsx, dlq.tsx, alerts.tsx, systemAlerts.tsx, LiteTopic.tsx).
- **Diff self-check** (`git show --numstat`): `web/src/pages/studio/UserManagement.tsx +4/−1`, `web/src/pages/studio/__tests__/UserManagement.test.tsx +18/−0` — no unrelated changes.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org