X-LightYear opened a new issue, #7078:
URL: https://github.com/apache/rocketmq-dashboard/issues/7078

   ## Description
   
   Frontend Mock mode allows two alert rules with identical evaluation 
semantics to be created, even though the REST service rejects the second rule 
as a duplicate semantic rule.
   
   ## Reproduction
   
   With Mock mode enabled, create the following rule and then create a second 
rule with a different name but the same evaluation fields:
   
   ```text
   metric: __probe_duplicate_metric__
   operator: >
   threshold: 17
   thresholdUnit: count
   duration: 5m
   enabled: true
   ```
   
   The two names used by the probe were `__probe_duplicate_one__` and 
`__probe_duplicate_two__`.
   
   ## Actual behavior
   
   Both `createAlertRule` calls resolve successfully and two rules are stored.
   
   ## Expected behavior
   
   The second create should reject as a duplicate semantic rule, matching the 
REST service's existing duplicate-fingerprint validation. A different display 
name does not make an identical evaluation rule distinct.
   
   ## Root cause
   
   `web/src/services/opsService.ts:createAlertRule` constructs a rule and 
pushes it into `alertRulesState` without checking the semantic fields used by 
`AlertRuleSemanticFingerprint` on the backend.
   
   ## Impact
   
   Operators using the supported Mock/demo data source can create duplicate 
alert evaluations and receive success feedback. This makes Mock mode diverge 
from the real control-plane behavior and can hide duplicate-rule conflicts 
during local validation.
   
   ## Scope
   
   Frontend Mock alert-rule creation only. This is not a security issue and 
does not affect provider runtime behavior.
   
   ## Regression evidence
   
   On `rocketmq-studio` commit `97f668006bb0b8d6bb8e1f6a6fc661b961ad28b2`, a 
temporary Vitest probe asserted that the second create rejects. It failed 
deterministically:
   
   ```text
   AssertionError: promise resolved "{ id: ..., ... }" instead of rejecting
   Test Files  1 failed (1)
   Tests       1 failed (1)
   ```
   
   The probe cleaned up the first created rule and verified the original rule 
names were unchanged.
   
   ## Duplicate review
   
   - #1937 addresses collision-safe Mock IDs, not duplicate evaluation 
semantics.
   - #4178/#4334 address import conflict reporting, not direct Mock creation.
   - #6454 addresses repeated submissions, not two distinct rules with the same 
semantic fingerprint.
   - No open or merged Issue/PR found for Mock semantic duplicate alert-rule 
creation.
   


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