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

   ### Which Issue(s) This PR Fixes
   
   - Resubmission of #1574 (closed during the August branch-rebase sweep, with 
an invitation to resubmit against the current branch). Original report: #1573, 
closed as not planned — the defect is still present on the current 
`rocketmq-studio` tip.
   
   ### Brief Description
   
   `handleAck` on the system-alerts page guards duplicate acknowledgements only 
through the `acknowledgingIds` **state** set. State updates are asynchronous: a 
rapid double-click on the confirm button (or button + keyboard activation) 
before React re-renders passes the guard twice and sends two 
`acknowledgeAlert()` requests for the same alert.
   
   Add a synchronous ref-based in-flight guard alongside the state set (the ref 
is checked/set immediately, before any re-render can happen), mirroring the 
request-id guards the page already uses for its list loads. Rebased onto the 
current tip; the newer delivery/silence state on the page is untouched.
   
   ### How Did You Test This Change?
   
   ```text
   $ cd web && npx vitest run src/pages/ops/__tests__/SystemAlertsPage.test.tsx
    Test Files  1 passed (1)
         Tests  22 passed (22)
   $ npx eslint src/pages/ops/systemAlerts.tsx 
src/pages/ops/__tests__/SystemAlertsPage.test.tsx   # clean
   ```
   
   The regression test double-clicks the acknowledge button against a pending 
promise and asserts the API is called exactly once; the 20 pre-existing 
silence/delivery tests stay green.
   
   ### 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