Repository navigation
fix(message-history): render queriedAt as UTC - #4222
Conversation
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Fixes the display of queriedAt timestamps in the message query history drawer. The backend stores Clock.systemUTC() LocalDateTime values without a timezone offset, which were previously interpreted as browser-local time by new Date(value). This PR switches to the shared formatUtcDateTime utility which correctly appends Z before converting to the viewer's local timezone.
Clean refactor — replaces a custom inline formatter with the existing shared utility. The regression test properly verifies the fix with an offset-less timestamp.
LGTM.
Automated review by "github-manager-bot"
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Same UTC timestamp fix pattern as #4228, applied to the message query history drawer. Replaces local toLocaleString() with shared formatUtcDateTime. Test correctly verifies offset-less datetime values are treated as UTC.
LGTM.
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Same UTC timestamp fix pattern as #4228, applied to the message query history drawer. Replaces local toLocaleString() with shared formatUtcDateTime. Test correctly verifies offset-less datetime values are treated as UTC.
LGTM.
Backend stamps queriedAt/latestQueryAt with Clock.systemUTC() into LocalDateTime values that serialize without an offset. The drawer parsed them with new Date(...).toLocaleString(), so browsers treated them as local time and shifted the displayed timestamps. Use formatUtcDateTime, which already handles offset-less UTC strings the same way as the alert lastTriggered fix. Fixes apache#4221
2e3ff27 to
a089403
Compare
Summary
queriedAt/latestQueryAtwithformatUtcDateTimeso offset-less UTC values from the backend are not treated as browser-local time.queriedAtvalue.Issue
Fixes #4221
Testing
MessageQueryHistoryDrawerunit testtreats offset-less queriedAt values as UTC.MessageQueryHistoryDrawer(and fullnpm run testif convenient).Related
Same UTC display class as #4174 / #4199 on the alert
lastTriggeredfield.