RockteMQ-AI commented on issue #2604:
URL: 
https://github.com/apache/rocketmq-dashboard/issues/2604#issuecomment-5418122388

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase.
   
   **Root Cause:** `AlertRuleRequestDTO` uses a repeating-group regex 
`(?:[0-9]+(?:ms|s|m|h|d|w|y))+` that accepts composite durations like `1h30m`, 
but `AlertService.DURATION_PATTERN` is anchored to a single segment 
`^\d+(ms|s|m|h|d|w|y)$`. The `duration()` method (line ~369) falls back to 
`"5m"` for any input that does not match the narrower pattern — silently 
discarding a valid persisted value.
   
   **Affected Files:**
   - `AlertRuleRequestDTO.java` (line 35) — validation regex
   - `AlertService.java` (lines 42, 367–370) — export regex + fallback
   
   **Severity:** medium
   
   **Suggested Fix:** Align `DURATION_PATTERN` in `AlertService` to 
`^(?:[0-9]+(?:ms|s|m|h|d|w|y))+$` so it accepts the same grammar as the DTO.
   
   An automated fix proposal will be generated. Reply `/approve` to proceed 
with PR generation.
   
   ---
   *Automated evaluation by @*


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