messere1 opened a new pull request, #6044:
URL: https://github.com/apache/rocketmq-dashboard/pull/6044

   ### Which Issue(s) This PR Fixes
   
   - Resubmission of #1572 (closed during the August branch-rebase sweep, with 
an invitation to resubmit against the current branch). Original report: #1570, 
closed as not planned — the defect is still present on the current 
`rocketmq-studio` tip.
   
   ### Brief Description
   
   The audit-log cleanup modal on `ops/audit` fires a **destructive** 
`cleanupAuditLogs()` request with no in-flight protection on the current tip:
   
   - `handleCleanup` has no re-entry guard, so double-clicking OK (or OK + 
Enter while the request is pending) submits the cleanup twice;
   - the modal has no `confirmLoading`, stays closable / mask-closable / 
keyboard-closable and its cancel button stays enabled while the request is in 
flight.
   
   Add a synchronous in-flight ref (double-submits before a re-render are 
invisible to state), a `cleaning` state driving `confirmLoading`, and lock the 
modal down while the cleanup is pending. Rebased onto the current tip; the 
surrounding page (summary cards, request-id guards) is untouched.
   
   ### How Did You Test This Change?
   
   ```text
   $ cd web && npx vitest run src/pages/ops/__tests__/AuditPage.test.tsx
    Test Files  1 passed (1)
         Tests  12 passed (12)
   $ npx eslint src/pages/ops/audit.tsx 
src/pages/ops/__tests__/AuditPage.test.tsx   # clean
   ```
   
   The regression test double-clicks the confirm button against a 
never-resolving promise and asserts the cleanup API is called exactly once.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits
   - [x] Tests added or updated for non-trivial changes
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no new UI text)
   - [x] Architecture constraints stay green (frontend-only change)
   - [x] New source files carry the ASF license header (no new files)
   - [x] Documentation touched where behaviour changed (bug fix only, no 
behaviour spec change)
   


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