You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "iloveeyjafjalla (via GitHub)" <gi...@apache.org> on 2026/10/16 08:52:47 UTC

[PR] fix(web): stop rendering a missing consumption time as 1970 [rocketmq-dashboard]

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

   Fixes #6868
   
   ## The regression
   
   The 验证 tab rendered `1970-01-01 08:00:00.000` for a consumption that never happened, and the trace step line the same for a node without a timestamp. Both endpoints use `0` for "no time" — `docs/api-spec.md:1610` defines `consumeTime` that way, and `RocketMQMessageProvider.buildConsumerStatus` parses the optional 8th SubAfter column, so a record without it yields `0`.
   
   The page used to handle that: the formatter it owned began with `if (!value) return '-'`, the guard #2094 added for #2081. #4829 replaced it with the shared `formatTimeMs`, which renders `0` as the epoch on purpose (pinned by `format.test.ts`), and the call site's own check only knows the string `'-'` that the demo fixture sends. Nothing pinned the call site, so the fix was lost silently.
   
   ## The fix
   
   `formatOptionalEpoch` in `message.tsx` — used by the consumer-status cell and the trace step line — treats `0` (and an unparsable value) as absent and delegates everything else to `formatTimeMs`. The shared formatter is untouched, so a stored timestamp at epoch 0 still renders as an epoch.
   
   ## Tests
   
   Red before the change:
   
   ```
   FAIL > renders a consumption with no recorded time as the placeholder instead of the Unix epoch
   expect(within(statusRow).getAllByRole('cell')[2]).toHaveTextContent('-')
     1970-01-01 08:00:00.000
   ```
   
   Green after:
   
   ```
   Test Files  2 passed (2)     Tests  53 passed (53)    (MessagePage.test.tsx + MessagePageAsyncState.test.tsx)
   tsc -b            exit 0
   eslint            exit 0
   prettier --check  All matched files use Prettier code style!
   ```
   


-- 
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(web): stop rendering a missing consumption time as 1970 [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #6869: fix(web): stop rendering a missing consumption time as 1970
URL: https://github.com/apache/rocketmq-dashboard/pull/6869


-- 
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(web): stop rendering a missing consumption time as 1970 [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6869:
URL: https://github.com/apache/rocketmq-dashboard/pull/6869#issuecomment-6377389742

   This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.


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