You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "unbridled-41 (via GitHub)" <gi...@apache.org> on 2026/09/12 17:55:36 UTC
[PR] fix(alerts): reset the silence form when the maintenance dialog is dismissed [rocketmq-dashboard]
unbridled-41 opened a new pull request, #4254:
URL: https://github.com/apache/rocketmq-dashboard/pull/4254
Fixes #4251.
## Problem / Evidence
The maintenance windows dialog on `/ops/system-alerts` keeps its create form mounted across open/close cycles and the cancel path only calls `setSilencesVisible(false)`. Values typed into a dismissed attempt (rule ID, label scope, recurrence, times) survive the cancel and pre-fill the next open. Creating a silence after a cancelled attempt then sends the stale scope: the request carries the previous attempt's `ruleId` and `labels` even though the operator only changed the window times.
Repro: open dialog → rule ID `42`, labels `brokerName=broker-a`, times → cancel → reopen → fields still filled → change only the times → create → `createAlertSilence` is called with the stale `ruleId: 42` and `labels` from the cancelled attempt.
## Root cause / Fix
`onCancel` (web/src/pages/ops/systemAlerts.tsx:831) closes the dialog without resetting the form, while the create-success path (`createSilence`) already calls `silenceForm.resetFields()`. The fix adds `silenceForm.resetFields()` to the cancel path, mirroring the create-success path and the reset-on-cancel convention used by the other create dialogs in the codebase.
## Priority & scoring
PRIORITY 70 = impact 27 (the silence is created on the wrong scope, so the alert notifications the window was meant to suppress keep firing; a residual DAILY/WEEKLY recurrence also creates an unintended recurring silence) + scope 11 (single create dialog) + reproducibility 18 (deterministic UI repro, covered by a regression test) + maintenance value 14 (same reset-on-cancel convention as the sibling dialogs; fixes the residue class recorded in #4251). FIX_CONFIDENCE 95: one-line handler change mirroring in-file precedents, red→green verified.
## Tests
- New regression `resets the silence form after the dialog is dismissed without creating` fills rule ID / label scope / times, cancels, reopens, asserts empty fields and asserts `createAlertSilence` is called without the stale `ruleId`/`labels`.
- Red on the unfixed code: `src/pages/ops/__tests__/SystemAlertsPage.test.tsx` → `Tests 1 failed | 14 passed (15)` with `× resets the silence form after the dialog is dismissed without creating`.
- Green with the fix: `Tests 15 passed (15)`.
- Full web suite `npx vitest run`: 982 tests, 1 failed — `ConsumerPage.test.tsx`, a file this branch does not touch and a known load-fragile case under the parallel run; re-run in isolation: `Tests 31 passed (31)`.
- `npx tsc -b` clean; `npx eslint .` 0 errors (the `systemAlerts.tsx` warning at line 227 is a pre-existing `react-hooks/exhaustive-deps` notice, untouched by this change); `npx vite build` succeeds.
## Risk
Cancel now discards typed input by design, consistent with the create-success path. No API or state changes; diff is one handler plus one test.
Head: 33771da6 (fix/alert-silence-form-residue, 1 commit).
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(alerts): reset the silence form when the maintenance dialog is dismissed [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #4254:
URL: https://github.com/apache/rocketmq-dashboard/pull/4254#issuecomment-5647667001
## Verification evidence
- **CI**: branch head `33771da6d04cc15a1cd450bb6c9ce71a0427bea5` (PR #4254) has exactly one workflow run for this head: "CI" (pull_request event), run 34709664270, conclusion=startup_failure — the upstream workflow fails at startup for every branch in this repository, producing no check-runs (`check-runs total_count = 0`). Unrelated to this change; all local verification below was run on this head.
- **Red light (unfixed code)**: with the regression test kept and the baseline `systemAlerts.tsx` restored, `npx vitest run src/pages/ops/__tests__/SystemAlertsPage.test.tsx` → `Tests 1 failed | 14 passed (15)`, failing item `× resets the silence form after the dialog is dismissed without creating` (rule ID / label scope survived cancel+reopen).
- **Module tests (fixed)**: `npx vitest run src/pages/ops/__tests__/SystemAlertsPage.test.tsx` → `Tests 15 passed (15)`.
- **Full suite + baseline**: `npx vitest run` on this head → 120 files, `Tests 1 failed | 981 passed (982)`; the single failure is `ConsumerPage.test.tsx`, untouched by this branch and a recurring load-fragile case; re-run in isolation → `Tests 31 passed (31)`. Zero failures in files touched by this change.
- **Build**: `npx tsc -b` clean; `npx vite build` succeeds. `npx eslint .` → 0 errors; the `systemAlerts.tsx` warning (line 227, react-hooks/exhaustive-deps) is pre-existing and outside this change's hunks.
- **Diff self-check** (`git show --numstat`): `web/src/pages/ops/systemAlerts.tsx +4/−1`, `web/src/pages/ops/__tests__/SystemAlertsPage.test.tsx +43/−0` — no unrelated changes.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(alerts): reset the silence form when the maintenance dialog is dismissed [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #4254: fix(alerts): reset the silence form when the maintenance dialog is dismissed
URL: https://github.com/apache/rocketmq-dashboard/pull/4254
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(alerts): reset the silence form when the maintenance dialog is dismissed [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #4254:
URL: https://github.com/apache/rocketmq-dashboard/pull/4254#issuecomment-5694555902
Merged as part of #4331 — squashed into `rocketmq-studio` as `6334f9238`.
Your change here (resetting the silence form when the maintenance dialog is dismissed) is included.
We grouped 11 of your related front-end fixes into a single commit so the history stays reviewable; the other PRs in the group are closed with the same note. Everything was cherry-picked onto the current baseline with you kept as the author, and your tests came along with the change.
Thanks for the consistently well-tested patches.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org