You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zmuxuny (via GitHub)" <gi...@apache.org> on 2026/10/19 17:33:55 UTC

[I] [Bug] Editing an ACL user while an admin toggle is pending can restore revoked privileges [rocketmq-dashboard]

zmuxuny opened a new issue, #7156:
URL: https://github.com/apache/rocketmq-dashboard/issues/7156

   ### 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 `master` branch, or I have stated the exact version I am running below.
   
   
   ### Studio Version
   
   rocketmq-studio at 127c47b06a268cc74224d5f34c56ec7c36ac0d55.
   
   ### Runtime Environment
   
   Node.js 24.19.0, Vitest 4.1.10, jsdom, real React Router and Ant Design components. Only service boundaries are mocked. No live accounts, credentials or permissions were changed.
   
   ### Connected RocketMQ Cluster
   
   No live broker is needed to reproduce the frontend request payload. The test models one Apache ACL user in instance-a and retains the API's accepted user record in a local fixture.
   
   ### Build Toolchain
   
   _No response_
   
   ### Describe the Bug
   
   The ACL user table serializes repeated admin-switch requests for one user using adminUpdateInFlightRef and adminUpdatingIds. While that request is pending, however, the same row's Edit action is still enabled and openEditUserModal copies the old row's admin flag into the form.
   
   When the switch request subsequently succeeds, the table receives the new admin value, but the already-open form keeps its old snapshot. An operator who changes only the user's associated clusters and saves then sends the obsolete admin flag back through updateAclUser. In the revocation case, this restores admin=true after the earlier revocation completed successfully.
   
   This is not two rapid clicks on one control: it uses the row switch and the editor, and the stale save occurs after the first update has finished.
   
   ### Steps to Reproduce
   
   1. Open ACL user management for an Apache instance and locate a user with admin=true.
   2. Toggle Admin off while its API response is delayed.
   3. Before that response returns, click Edit on the same row.
   4. Allow the admin update to complete. The underlying row now shows admin=false.
   5. In the open editor, change only Associated Clusters and save.
   
   ### What Did You Expect to See?
   
   An editor must not capture a user snapshot while that user's admin update owns the row. Once the operation settles, editing should use the updated row. Unrelated users should remain editable.
   
   ### What Did You See Instead?
   
   The actual second service call contains admin=true with the new clusters, undoing the completed admin revocation. Starting with admin=false also reproduces the inverse defect: a successful grant is silently reverted by the stale form.
   
   ### Additional Context
   
   A diagnostic file uses the real page and dialogs with a deferred update response. After confirming that the table displays the completed admin change, it changes only the clusters and inspects the next request.
   
   On unchanged production source: five tests, two failed and three passed, one worker, 14.79 seconds.
   - Revocation then stale edit: expected admin=false; actual admin=true.
   - Grant then stale edit: expected admin=true; actual admin=false.
   - Another user's editor remains usable during the pending update: passes.
   - Ordinary user editing remains functional: passes.
   - Editing is restored after a failed admin update: passes.
   
   Patch-level duplicate checks:
   - #1632 / #1622 guard repeated admin-switch requests only; they do not gate opening the user editor.
   - Open #6383 locks repeated form submissions, not opening a stale editor during a row update.
   - #4527/#4511 concern stale rows during filtered reads; #6715 clears failed read results and refreshes the user directory.
   - #1725 introduces instance-keyed state and credential/examine request generations.
   - #7139 concerns the backend partial plain-access admin flag, a different endpoint and failure mechanism.
   
   ### 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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org