You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "89799969 (via GitHub)" <gi...@apache.org> on 2026/09/11 13:06:02 UTC

[PR] fix(studio): render user-management timestamps as UTC [rocketmq-dashboard]

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

   Fixes #4234.
   
   ## Problem / Evidence
   
   Studio user management renders session and account timestamps with \
   ew Date(value).toLocaleString()\. AuthService stores those fields as offset-less \LocalDateTime\ values from \Clock.systemUTC()\ (\AuthService.now()\ → \ZoneOffset.UTC\ for \last_seen_at\, \expires_at\, \password_changed_at\). JavaScript therefore treats them as browser-local wall-clock times.
   
   Local reproduction (TZ \Asia/Shanghai\, UTC+8):
   
   \\\
   new Date('2026-08-22T09:30:00').toLocaleString()  →  2026/8/22 09:30:00   (wrong)
   new Date('2026-08-22T09:30:00Z').toLocaleString() →  2026/8/22 17:30:00   (correct local)
   \\\
   
   Affected UI: user table columns 最近活跃 / 最近过期 / 创建时间, and the CSV export columns (Last Session Seen At, Nearest Session Expires At, Password Changed At, Created At, Modified At).
   
   ## Fix
   
   Reuse the shared \ormatUtcDateTime\ helper (same approach as alert \lastTriggered\ #4174/#4199 and query-history \queriedAt\ #4221/#4222), which appends \Z\ for offset-less values before formatting into the viewer's timezone.
   
   ## Tests
   
   \
   px vitest run src/pages/studio/__tests__/UserManagement.test.tsx\ — **7 passed** (6 pre-existing + 1 new named regression \	reats offset-less session timestamps as UTC\; existing session-metadata assertion updated to the UTC helper).
   
   Red light before the fix: the new/updated assertions expect \ormatUtcDateTime('2026-08-22T09:30:00')\ (17:30 CST here); the old helper rendered 09:30.
   
   ESLint and Prettier clean on both changed files. Diff: 2 files, +14/−2.
   
   ## Risk
   
   Low. Normal browsers already receive offset-less UTC wall-clock strings; only the display/export conversion changes. Response shapes and backend fields are unchanged.


-- 
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(studio): render user-management timestamps as UTC [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #4235: fix(studio): render user-management timestamps as UTC
URL: https://github.com/apache/rocketmq-dashboard/pull/4235


-- 
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(studio): render user-management timestamps as UTC [rocketmq-dashboard]

Posted by "89799969 (via GitHub)" <gi...@apache.org>.
89799969 commented on PR #4235:
URL: https://github.com/apache/rocketmq-dashboard/pull/4235#issuecomment-5695187325

   Holding this PR per the review: `gmtCreate`/`gmtModified` are still MySQL `CURRENT_TIMESTAMP` under `TZ=Asia/Shanghai`, so rendering them as UTC would regress. Will rework once the "all API timestamps are UTC" contract (and backend write path) is settled.


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