btlqql opened a new issue, #4295:
URL: https://github.com/apache/rocketmq-dashboard/issues/4295

   ## 1. Symptom
   
   The maintenance-window (alert silence) panel on the system alerts page 
prints the raw timestamp the
   API returns, so a window the operator just created appears at the wrong time.
   
   On a browser at UTC+8, creating a window from `2026-09-10 10:00` to `12:00` 
lists it as
   
   ```
   CLUSTER · local · 2026-09-10T02:00 - 2026-09-10T04:00 · Asia/Shanghai · 重复至 
2026-10-01T00:00
   ```
   
   i.e. eight hours earlier, with a bare `T`, and with the recurring window's 
`timeZone` shown next to a
   value that is not expressed in it.
   
   ## 2. Root cause
   
   `web/src/pages/ops/systemAlerts.tsx:961-963` and `:969-973`
   
   ```tsx
   {silence.instanceId ?? t('sysAlerts.allInstances')} · {silence.startsAt} -{' 
'}
   {silence.endsAt}
   ...
   time: silence.recurrenceUntil ?? '',
   ```
   
   `startsAt`, `endsAt` and `recurrenceUntil` are interpolated verbatim. The 
alert APIs serialise those
   values as offset-less UTC `LocalDateTime`s (`AlertSilenceService` builds 
them with `ZoneOffset.UTC`,
   `AlertSilenceVO` declares `LocalDateTime`), and the form itself proves the 
written value is UTC rather
   than local wall clock (`localDateTimeToUtc` / `zonedLocalDateTimeToUtc` at
   `systemAlerts.tsx:104-106` and `:404-407`, fed by `datetime-local` inputs).
   
   The same file already handles this class correctly for its other timestamps
   (`formatUtcDateTime(alert.acknowledgedAt)`, `alert.time`, `related.time`), 
and the helper
   (`web/src/utils/format.ts:40-74`) exists precisely because "Alert APIs 
serialize UTC LocalDateTime
   values without an offset, so normal Date parsing would incorrectly treat 
them as browser-local
   timestamps". It is already imported in this file.
   
   ## 3. Impact
   
   - The operator cannot recognise the window they just created and is likely 
to recreate it or to widen
     it, which silences real alerts at the wrong hours.
   - The recurring-window sentence is internally inconsistent: it shows the 
IANA `timeZone` the schedule
     is anchored to next to a value rendered in UTC.
   
   ## 4. Reproduction
   
   1. Open `/ops/system-alerts`, open 维护窗口, create a window (browser time zone 
not UTC).
   2. Read the row that appears in the list: it shows the UTC instant instead 
of the entered local time.
   
   ## 5. Expected behaviour
   
   - Window boundaries render like every other instant on the page, through 
`formatUtcDateTime`, i.e.
     with the viewer's time zone and offset.
   - `recurrenceUntil` behaves the same and, for a blank value, keeps rendering 
as empty.


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