chennaji9 opened a new pull request, #5907:
URL: https://github.com/apache/rocketmq-dashboard/pull/5907

   ### Which Issue(s) This PR Fixes
   
   None — self-contained fix found by inspection (no issue tracked).
   
   ### Brief Description
   
   `MybatisPlusAlertStateRepository.toRuntime` projected `nextReminderAt = 
lastNotifiedAt + reminderInterval` for **every** state that had ever notified. 
But the state machine (`AlertStateMachine.advanceHit`/`advanceClear`) only 
emits REMINDER while **FIRING** with a **positive** interval:
   
   - ACKED states never remind again, yet got an upcoming-reminder timestamp;
   - RESOLVED states keep `lastNotifiedAt` purely as history, yet got one too;
   - a `0s` interval explicitly disables reminders, yet the runtime still 
showed `nextReminderAt == lastNotifiedAt` — a "next reminder" already in the 
past.
   
   The rule runtimes view therefore displayed fabricated upcoming-reminder 
times that no evaluation would ever act on.
   
   Fix: compute `nextReminderAt` only for FIRING states of a known rule with a 
strictly positive interval; every other state reports `null`.
   
   ### How Did You Test This Change?
   
   `cd server && mvn -B -ntp test 
-Dtest='MybatisPlusAlertStateRepositoryTest,AlertServiceTest,AlertRuleControllerTest'
 -DfailIfNoTests=false` → **Tests run: 112, Failures: 0, Errors: 0** (7 
repository + 83 service + 22 controller).
   
   Red-green on the new `runtimeReminderIsProjectedOnlyForRemindingStatesTest` 
(covers ACKED, RESOLVED, FIRING+`0s`, FIRING+`30m` in one pass):
   - on the unfixed code it fails — ACKED, RESOLVED and `0s` rows all receive 
fabricated timestamps;
   - with the fix it passes; only the FIRING+`30m` row projects `lastNotifiedAt 
+ 30m`.
   
   `AlertServiceTest` (83 tests), which consumes `findRuntimeByRuleIds`, stays 
green — no consumer depended on the fabricated values.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`fix:`)
   - [x] Tests added or updated for non-trivial changes (new red-green 
projection test)
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(n/a — no UI text change)
   - [x] Architecture constraints stay green (single class in the same package, 
no new dependency)
   - [x] New source files carry the ASF license header (n/a — no new source 
file)
   - [x] Documentation touched where behaviour changed (n/a — the VO field now 
matches the state machine's documented reminder semantics)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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