Skip to content

fix(message-history): render queriedAt as UTC - #4222

Merged
lizhimins merged 1 commit into
apache:rocketmq-studiofrom
89799969:fix/query-history-utc-display
Sep 16, 2026
Merged

lizhimins merged 1 commit into
apache:rocketmq-studiofrom
89799969:fix/query-history-utc-display

Conversation

@89799969

Copy link
Copy Markdown
Contributor

Summary

  • Render query-history queriedAt / latestQueryAt with formatUtcDateTime so offset-less UTC values from the backend are not treated as browser-local time.
  • Add a regression test for an offset-less queriedAt value.

Issue

Fixes #4221

Testing

  • Added MessageQueryHistoryDrawer unit test treats offset-less queriedAt values as UTC.
  • Please run frontend vitest for MessageQueryHistoryDrawer (and full npm run test if convenient).

Related

Same UTC display class as #4174 / #4199 on the alert lastTriggered field.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants