zmuxuny opened a new pull request, #7157: URL: https://github.com/apache/rocketmq-dashboard/pull/7157
## Summary Fixes #7156. An ACL user's admin toggle already owns a per-user in-flight guard, but the same row's Edit button could still copy the old admin flag into its form. If a revocation completed while that editor was open, subsequently saving only a cluster change sent the obsolete `admin: true` back to the server. The inverse sequence could also undo a completed grant. - Reuse the existing synchronous per-user guard before opening the editor. - Disable only the affected row's Edit button until its admin update settles. - Keep unrelated users editable and release the editor after either success or failure. This prevents capture of the obsolete form snapshot. A submit-only guard would be too late because the first update has already finished by the time the stale editor is saved. There is no new state, request, dependency, API, or translation. ## Regression coverage The new five-case suite renders the real ACL page, Ant Design controls, router, and instance-filter hook. Only local service calls are mocked; it never connects to a broker or changes real permissions. The two failing baseline cases delay the admin response after the mock server has accepted the change, attempt to edit the same row, then save a cluster-only edit after the original request completes. They assert the exact outgoing payload and final stored admin flag for both revocation and grant. Controls cover editing another user during the update, recovery after failure, and ordinary editing. On the unchanged base (`127c47b06a268cc74224d5f34c56ec7c36ac0d55`), the final test file produced **2 failed / 3 passed** in 14.79 seconds. Both failures were the obsolete admin flag in the second request, not an interaction or timeout error. ## Validation - Final fixed regression plus complete ACL page, service, API, risk-diagnostic and instance-filter tests: **6 files / 78 tests passed** (63.81 seconds), single Vitest worker. - `tsc -b --force`: passed. - Full ESLint: passed, 0 errors and 10 existing warnings in unchanged files. - New test file Prettier and `git diff --check`: passed. `acl.tsx` has two pre-existing formatting differences around lines 322–335; formatting the base and fixed versions produces exactly the same differences, with none in this patch. Those unrelated lines are left unchanged. - `npm run build`: passed, including Vite production output (11.13 seconds) and license check (132 components / 139 license files). ## Related-work check Searched all states of issues and PRs and inspected nearby patches. #1632 guards repeated admin-switch requests; #6383 guards repeated form submissions; neither prevents a pending switch update from opening a stale editor. #4527, #6715, #1725, and #1381 address list/read or instance lifecycle behavior. #7139 is a separate backend plain-access update contract. This change covers the missing boundary between the row toggle and editor entry. ## Review and AI assistance Developed with AI assistance. The production change and all five regression cases received an independent review. The final tests use the same file as the failing baseline run; the full selected regression suite and production build were then verified locally. ## Checklist - [x] One coherent change; issue #7156 filed before implementation - [x] Conventional commit subject and ASF header on the new source file - [x] Regression test names end in `Test`; independently reviewed - [x] No new UI text, API, dependencies, or persisted-data changes - [x] Existing user-facing edit behavior is preserved after the pending update settles Backend/ArchUnit checks are not claimed for this frontend-only patch. -- 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]
