tju-yxq opened a new issue, #5496: URL: https://github.com/apache/rocketmq-dashboard/issues/5496
## Problem Six mutation handlers across five pages remain unguarded against double submission — the same pattern the codebase already fixed everywhere else. Each has a sibling in the same file (or a clearly established codebase idiom) that IS guarded, making the gap unambiguous: 1. **Proxy config reload** (`Proxy.tsx` `handleReloadConfig`): the per-row reload button has no guard, no loading state, nothing — the only unguarded handler on a page whose three other mutations all use `addressMutationInFlight`. Double-clicking fires two server-side config reloads; overlapping reloads on different rows clobber each other. 2. **Create user** (`UserManagement.tsx` `createUser`): the Modal's OK has no `confirmLoading`, no guard — double-click creates the user twice (or surfaces a noisy duplicate-name error). 3. **Reset/change password** (`UserManagement.tsx` `updatePassword`): same — no `confirmLoading`, no guard. Also, `validateFields()` is outside the try/catch, so validation rejections surface as unhandled promise rejections. 4. **Data source delete** (`DataSourceTab.tsx` `handleDelete`): the Popconfirm wraps `void handleDelete(record)` (antd gets no promise, no OK-button loading); the button has no per-row loading/disabled — the same shape `certs.tsx` had before its fix. No feedback during the delete; nothing disables the row while in flight. 5. **Cloud credential delete** (`CloudCredentialTab.tsx` `handleDelete`): identical shape — while the same file's `handleSubmit` is the best-guarded handler in the codebase (ref + confirmLoading + modal lock). 6. **Alert silence end** (`systemAlerts.tsx` `deleteSilence`): a single `deletingSilenceId` slot with no entry guard — a second end-click on another silence row overwrites the slot, the first row's spinner vanishes mid-request, and its `finally` clears the second row's spinner, re-enabling a button whose request is still pending. ## What did you do (steps to reproduce)? 1. Open any affected page and trigger the mutation twice before the first completes (double-click, or two rows' actions overlapping). 2. The API call fires twice; in the settings tabs there is no loading feedback at all. ## What did you expect to see? One mutation per intent, with the acting control showing its in-flight state — the discipline every sibling handler already follows. ## What did you see instead? Duplicate requests, no feedback, or (silence end) a spinner that belongs to a different row. ## Root cause Each handler was written without the codebase's established in-flight patterns: the ref guard (`if (ref.current) return;`) + loading state, or per-key Sets for concurrent row actions, or `confirmLoading` on modal OK buttons. The full evidence for each (with sibling contrast) is in the PR description. ## Expected behavior - Proxy reload: one at a time; the acting button shows loading; other rows' buttons are disabled while one runs. - Create user / reset password: `confirmLoading` on the Modal OK; a repeated click is a no-op; validation failures are handled (no unhandled rejections). - Data source / credential delete: per-key Set loading (the `testingKeys` idiom); the acting row's Popconfirm OK shows loading; other rows' delete buttons are disabled. - Silence end: single-flight (one at a time); the guard prevents a second click while any end is pending. - All flows' success/error feedback is unchanged. ## Acceptance criteria - [ ] Each mutation fires exactly once per intent. - [ ] The acting control renders its in-flight state; competing controls are disabled. - [ ] Validation failures in the user/password modals no longer produce unhandled rejections. - [ ] All existing page behaviors are unchanged (the 68 tests across the five suites stay green). ## Environment Branch `rocketmq-studio` at `6a68042f`; files: Proxy.tsx, UserManagement.tsx, DataSourceTab.tsx, CloudCredentialTab.tsx, systemAlerts.tsx. ## Duplicate check Searched open and closed issues for `double submit`, `in-flight guard`, and `delete loading`: the existing PRs fix the same pattern on other pages (DLQ export, certificate delete, instance import, AI conversation delete); nothing covers these six remaining handlers. -- 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]
