unbridled-41 opened a new pull request, #6015:
URL: https://github.com/apache/rocketmq-dashboard/pull/6015

   ### Which Issue(s) This PR Fixes
   Fixes #6014
   ### Problem / Evidence
   ```java
   if (existing != null) {
       userMapper.updateById(entity);          // uk_username violation escapes
   } else {
       try { userMapper.insert(entity); } catch (DuplicateKeyException e) { /* 
409 */ }
   }
   ```
   ```
   MybatisPlusAclRepositoryTest: 
updateShouldReportARenameOntoAnExistingUsernameAsAConflictTest
   org.springframework.dao.DuplicateKeyException escapes the call
   ```
   `saveUser`, `replaceUser` and this method's insert already use 
`aclUserConflict` (the merged duplicate-key fix #5072 covered those, not this 
one).
   ### Root cause / Fix
   The update branch is the only ACL user write that changes `username` without 
the shared translation. Wrap it and throw the same 409.
   ### Priority and scoring
   **PRIORITY 42** - impact 14/40 (an opaque 500 on a legitimate save, with the 
rule replacement rolled back), blast radius 6/20, reproducibility 20/20 (pinned 
by the new test), maintenance value 4/20. **FIX_CONFIDENCE 90**.
   ### Tests
   `cd server && mvn -o -B -ntp test -Dtest='MybatisPlusAclRepositoryTest'` -> 
`Tests run: 26, Failures: 0, Errors: 0`; the new case fails before the change 
(the raw exception escapes) and passes after it, asserting no rule write; 
`checkstyle:check` passes.
   ### Risk
   Nothing beyond the status code and message of an already-failing write.
   


-- 
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]

Reply via email to