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/20 06:46:32 UTC
[I] [Studio][Bug] Alert rule editor shows the previously tested rule's samples [rocketmq-dashboard]
unbridled-41 opened a new issue, #4583:
URL: https://github.com/apache/rocketmq-dashboard/issues/4583
## Problem
On the alerts page (both `/ops/alerts` and `/ops/business-alerts`) the rule editor keeps its dry-run result ("规则试运行结果") in page state. Every entry point into the editor clears that state except **编辑** (`openEditModal`): 新建 (`openCreateModal`), 复制 (`openDuplicateModal`), the modal `onCancel` and the footer cancel button all call `setTestResult(null)`.
Steps to reproduce:
1. Open `/ops/alerts`.
2. Click 编辑 on rule A and then 试运行 — the sample table appears.
3. Click 确定 to save; the dialog closes.
4. Click 编辑 on rule B — B's editor renders A's sample table (A's labels and current values) under the 规则试运行结果 title.
The samples look like fresh evidence for the rule being edited, but they were produced for a different rule that was never reopened.
## Studio Version
branch: master
git commit id: d50ffecc9d7e8f8f46da64198831bd7952e6974e
deployed as: built from source (frontend only)
## Evidence
- `web/src/pages/ops/alerts.tsx:486` (`openEditModal`) restores the form values, the instance scope and the modal visibility, but never resets `testResult`, unlike its siblings at lines 417 (`openCreateModal`), 504 (`openDuplicateModal`), 1041 (modal `onCancel`) and 1059 (footer cancel).
- The dry-run panel is rendered from that state at `web/src/pages/ops/alerts.tsx:1275` (`testResult && testResult.samples.length > 0`), so nothing distinguishes samples that belong to the rule currently in the editor.
- Regression test `web/src/pages/ops/__tests__/AlertsTestResultResidue.test.tsx` fails on `master` (`npx vitest run src/pages/ops/__tests__/AlertsTestResultResidue.test.tsx`):
```
FAIL src/pages/ops/__tests__/AlertsTestResultResidue.test.tsx > AlertsPage rule test results > shows no test samples for a rule the user never tested
AssertionError: expected <div class="ant-table-title"></div> to be null
- Expected:
null
+ Received:
<div class="ant-table-title">
规则试运行结果
</div>
❯ src/pages/ops/__tests__/AlertsTestResultResidue.test.tsx:172:53
```
## Impact
An operator who edits several rules after testing one of them reads another rule's dry-run evidence as if it belonged to the rule being edited, and can conclude that the rule currently matches production data when it has never been tested.
## Expected behavior
Opening the editor — by 编辑, 新建 or 复制 — starts with no dry-run samples. Samples produced in a previous editor session are never shown again.
## Related work
- #4254 (merged) — same class of stale editor state: the silence form kept values from a dismissed dialog.
- #4004 (merged) — resets the alerts list state when the alerts domain route switches, i.e. view state must not leak across page sessions.
## PR
Fix: #PR_PLACEHOLDER.
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] Alert rule editor shows the previously tested rule's samples [rocketmq-dashboard]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #4583:
URL: https://github.com/apache/rocketmq-dashboard/issues/4583#issuecomment-5748307310
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
The reported issue has been verified against the current codebase (commit d50ffecc).
**Root Cause:** `openEditModal` (line 486 in `web/src/pages/ops/alerts.tsx`) restores form values and modal visibility but does not call `setTestResult(null)`, unlike its siblings:
- `openCreateModal` (line 417) ✓
- `openDuplicateModal` (line 504) ✓
- Modal `onCancel` (line 1041) ✓
- Footer cancel (line 1059) ✓
**Impact:** Operators editing multiple rules after testing one will see stale dry-run samples from a previously tested rule, potentially misleading them about the current rule's match status.
**Severity:** Medium — UX issue that can cause operator confusion but does not affect data integrity or system stability.
**Fix:** Add `setTestResult(null);` to `openEditModal` before `setModalVisible(true);`.
A fix PR (#4584) has already been linked by the reporter.
---
*Automated evaluation by @RockteMQ-AI*
--
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: [I] [Studio][Bug] Alert rule editor shows the previously tested rule's samples [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #4583:
URL: https://github.com/apache/rocketmq-dashboard/issues/4583#issuecomment-5811754855
Fixed in e07fcd40e (#4584) on the `rocketmq-studio` branch.
Closing manually: GitHub only auto-closes an issue when the pull request is merged into the repository's default branch, and `rocketmq-studio` is not it.
--
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: [I] [Studio][Bug] Alert rule editor shows the previously tested rule's samples [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed issue #4583: [Studio][Bug] Alert rule editor shows the previously tested rule's samples
URL: https://github.com/apache/rocketmq-dashboard/issues/4583
--
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