unbridled-41 opened a new issue, #4251:
URL: https://github.com/apache/rocketmq-dashboard/issues/4251

   ## Problem
   
   The maintenance windows dialog on `/ops/system-alerts` 
(`web/src/pages/ops/systemAlerts.tsx`) keeps its create form mounted across 
open/close cycles. The cancel path (`onCancel`, line ~828) only closes the 
dialog: there is no `resetFields()` and no `destroyOnHidden`. The form is only 
reset on the create-success path (line ~424).
   
   `openSilences` (lines 376-380) also does not reset the form when reopening.
   
   ## Evidence
   
   1. Open the dialog, type a rule ID (`42`), a label scope 
(`brokerName=broker-a`) and window times.
   2. Cancel (or press Esc / click the mask).
   3. Reopen the dialog: the rule ID, label scope, recurrence and times are 
still filled.
   4. Change only the times and click create: `createAlertSilence` is called 
with the stale `ruleId: 42` and `labels: {brokerName: 'broker-a'}` from the 
cancelled attempt.
   
   A regression test demonstrating the residue and the mis-scoped payload on 
the unfixed code lives in the linked PR.
   
   ## Impact
   
   The silence is created on the wrong scope: the operator believes they 
silenced all instance-wide alerts for the window, but only the previous 
attempt's rule/labels are silenced, so the alert notifications the window was 
meant to suppress keep firing. Residual DAILY/WEEKLY recurrence values can also 
create an unintended recurring silence.
   
   ## Expected behavior
   
   Dismissing the dialog without creating resets the form to its initial 
values, so the next attempt starts from a clean scope.
   
   ## Related work
   
   The create-success path already resets the form, and the other dialogs in 
the codebase reset on cancel (`cluster/index.tsx` NameServer create, 
`instance/index.tsx` create/edit, the reset-password dialog in 
`studio/UserManagement.tsx`) or use `destroyOnHidden`; this dialog is the only 
create form that keeps values across a cancel.
   
   ## PR
   
   Fix incoming.


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