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

   ## What is the purpose of the change
   
   Fixes #4295.
   
   The maintenance-window list on the system alerts page interpolated 
`silence.startsAt`, `endsAt` and
   `recurrenceUntil` verbatim. Those are offset-less UTC `LocalDateTime`s, so a 
window entered as
   `10:00-12:00` local (UTC+8) was listed as `2026-09-10T02:00 - 
2026-09-10T04:00`: an eight-hour shift,
   a bare `T`, and a `timeZone` label that contradicts the printed instant.
   
   ## Brief changelog
   
   - `web/src/pages/ops/systemAlerts.tsx`
     - The silence row renders both boundaries with `formatUtcDateTime`, the 
helper the same file already
       uses for `alert.time`, `alert.acknowledgedAt` and `related.time`.
     - `recurrenceUntil` is rendered through the same helper, and a blank value 
keeps rendering empty.
   - `web/src/pages/ops/__tests__/SystemAlertsPage.test.tsx`
     - New `renders maintenance window boundaries as UTC instants instead of 
raw API strings`.
   
   ## Verification
   
   Red, before the fix (`npx vitest run 
src/pages/ops/__tests__/SystemAlertsPage.test.tsx`):
   
   ```
    FAIL  src/pages/ops/__tests__/SystemAlertsPage.test.tsx > SystemAlertsPage 
> renders maintenance window boundaries as UTC instants instead of raw API 
strings
   Error: expect(element).toHaveTextContent()
   Expected element to have text content:
     2026-08-10 09:00:00 GMT+8
   Received:
     每周CLUSTER · local · 2026-08-10T01:00 - 2026-08-10T02:00 · Asia/Shanghai · 
重复至 2026-10-01T00:00
    ❯ src/pages/ops/__tests__/SystemAlertsPage.test.tsx:526:17
    Test Files  1 failed (1)
         Tests  1 failed | 14 skipped (15)
   ```
   
   Green, after the fix (`npx vitest run 
src/pages/ops/__tests__/SystemAlertsPage.test.tsx`):
   
   ```
    Test Files  1 passed (1)
         Tests  15 passed (15)
   ```
   
   The expected string in the test is produced by `formatUtcDateTime` itself, 
so the assertion is
   time-zone agnostic and passes on any CI machine.
   
   ## AI disclosure
   
   Drafted with AI assistance (analysis, patch and test authoring); the red and 
green vitest output above
   was executed and observed locally on Windows, Node v24.13.1.


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