You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yyqdbngt (via GitHub)" <gi...@apache.org> on 2026/08/31 16:07:00 UTC

[PR] fix(ops): ignore unparseable alert times in filters and trigger count [rocketmq-dashboard]

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

   ## Summary
   - Extract an exported `wasTriggeredWithin()` helper in the alert rules page: a rule only counts toward the "triggered in last 24h" badge when `lastTriggered` parses to a timestamp after the cutoff
   - Guard the mock-mode time filter in `listSystemAlertsPage()`: alerts whose `time` cannot be parsed are excluded when a `from`/`to` range is active, and unparseable range bounds are treated as absent
   - Add regression tests for both (helper unit tests plus a service-level filter test)
   
   ## Why
   `new Date(r.lastTriggered).getTime()` yields `NaN` for unparseable values, and `NaN > dayAgo` is always `false` — a rule with a malformed `lastTriggered` was silently dropped from the 24h trigger badge with no way to tell that its value was bad. The same pattern in `listSystemAlertsPage()` made time-range comparisons against `NaN` always evaluate to `false`, so alerts with unparseable `time` values slipped through `from`/`to` filters (the mock data's time-of-day-only `time` values are exactly such values), returning rows that do not match the requested window.
   
   ## Testing
   - `./node_modules/.bin/vitest run src/pages/ops/__tests__/AlertsPage.test.tsx src/services/opsService.test.ts` → 34 passed
   - `./node_modules/.bin/tsc --noEmit` → clean
   - `./node_modules/.bin/eslint src/pages/ops/alerts.tsx src/services/opsService.ts src/pages/ops/__tests__/AlertsPage.test.tsx src/services/opsService.test.ts` → 0 errors (pre-existing-style warnings only)
   


-- 
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(ops): ignore unparseable alert times in filters and trigger count [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2859:
URL: https://github.com/apache/rocketmq-dashboard/pull/2859#issuecomment-5611298631

   This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated 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(ops): ignore unparseable alert times in filters and trigger count [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #2859: fix(ops): ignore unparseable alert times in filters and trigger count
URL: https://github.com/apache/rocketmq-dashboard/pull/2859


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