messere1 commented on PR #6383:
URL:
https://github.com/apache/rocketmq-dashboard/pull/6383#issuecomment-6195760826
Thanks @lizhimins for the exceptionally precise review — the conflict
anatomy (insertion anchor `useState('rules')` → `:171` `useState('users')`) and
the new-UI inventory made the rework mechanical. Pushed as 7eb51d22 (rebased
onto the current tip a92c2314, past 8bbe7947), point by point:
1. **Rebase + conflict**: `web/src/pages/instance/acl.tsx` resolved keeping
the tip's `useState('users')` and tab order; the ref declarations now sit
between the submitting states and `activeTab`. Before touching anything I ran
`mvn test-compile` and `tsc -b` on a fresh tip fetch — both green after #6735,
so this time the base is healthy.
2. **Tests rewritten for the post-#6693 UI**:
- Rule test: switches to `ACL 规则` first, then drives the single
page-level add button (`:1210-1212` — label follows `activeTab`).
- User test: opens on the default `users` tab and drives the same
page-level button (the in-tabpanel button lookups are gone).
- `instanceId: undefined` **re-verified and kept**: rendering at `/` with
the empty instance list, `useInstanceFilter` still resolves
`selectedInstanceId` to `instances[0]?.name` = `undefined`, so `createAclUser`
receives `instanceId: undefined` exactly as before — the selector move changed
where the id comes from, not its value with no instance selected.
3. **Third same-shape spot locked**: `handlePlainSubmit` now takes
`plainSubmittingRef` with the same synchronous acquire-before-await /
release-in-finally shape as the rule and user dialogs, and
`setPlainSubmitting(true)` moved out of the post-validate position. Covered by
a new third test driving the `集群 ACL 配置` tab → `新增 Plain Access 账号` dialog.
4. **Duplicated `toHaveBeenCalledTimes(1)`** after each `waitFor` dropped.
5. Lock-release coverage (the gap you flagged on #6454, applied here too):
all three tests now resolve the first request, assert the dialog actually
closed, and then **save a second, different rule/user** — so deleting any
`xxxRef.current = false` from a `finally` block turns the suite red (verified
by mutation: commenting out `ruleSubmittingRef.current = false` fails the rule
test's second-save phase). The closure assertions use a `ConfigProvider
motion={false}` render variant, the same approach as `InstancePage.test.tsx` —
jsdom never completes antd's zoom-leave animation, so without it a
logically-closed modal stays mounted forever.
Evidence: full `AclPage.test.tsx` **32/32** green on the rebased head; the
three new tests are RED on the unpatched tip (each fails at the synchronous
`ant-btn-loading` lock assertion, before the duplicate-call assertions); eslint
0 errors, Prettier clean, `tsc -b` clean. Well inside the 2026-10-19 window.
--
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]