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

[I] [Bug] The demo message detail reports the broker and queue offset as unavailable [rocketmq-dashboard]

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

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository and believe that this is not a duplicate.
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a defect in another Apache RocketMQ repository.
   - [x] I can reproduce this on the current `rocketmq-studio` branch, or I have stated the exact version I am running below.
   
   ### Studio Version
   
   branch: rocketmq-studio
   git commit id: a92c2314
   deployed as: reproduced by a unit test against that commit
   
   ### Runtime Environment
   
   OS: not applicable — the defect is in the frontend Mock data source and the view it feeds
   MySQL: not applicable — no backend is involved
   browser (for UI issues): not required to observe it; the defect is in the demo data the page renders
   
   ### Connected RocketMQ Cluster
   
   not applicable — reproduced with the frontend Mock data source in a unit test
   
   ### Describe the Bug
   
   The demo data source's messages do not satisfy the message contract, and the console's message detail renders the missing fields as placeholders.
   
   `web/src/mock/messages.ts` declares its own `MessageRecord` (line 18) instead of the contract type, and that copy omits `brokerName`, `queueId` and `queueOffset` — all three are **required** in `web/src/api/message.ts:9-11` (`string | null` / `number | null`). `web/src/services/messageService.ts:52` cast the fixtures over the mismatch (`mockMessages as unknown as MessageRecord[]`), so neither `tsc` nor the tests could see it.
   
   The detail panel renders those fields directly:
   
   ```tsx
   // web/src/pages/instance/message.tsx:1041 and :1047
   <span style={{ fontFamily: 'monospace' }}>{selectedMsg.brokerName ?? '-'}</span>
   <span style={{ fontFamily: 'monospace' }}>{selectedMsg.queueOffset ?? '-'}</span>
   ```
   
   So in Mock mode every message's **Broker** and **Queue Offset** read `-`, while every other field on the same panel is populated by the fixture. The endpoint fills both for a real message.
   
   The same change makes `messageService.ts:44` compile against the contract, which types `key` as `string | null`: the key filter was `m.key.includes(...)`, so a keyless message — which the contract explicitly allows — would throw instead of simply not matching. No current fixture message is keyless, so this is a type-safety fix rather than a second reproduction.
   
   ### Steps to Reproduce
   
   ```text
   1. Enable the frontend Mock data source.
   2. Open the message page, search the topic `order-create`, open any message.
   3. The Broker and Queue Offset rows read `-`.
   ```
   
   Or as a unit test against the service:
   
   ```ts
   const [first] = await queryMessages({ msgId: 'AC1E0A6400002A9F0000000001A3F2B1' });
   expect(first.brokerName).toBeTypeOf('string');   // fails: "undefined"
   expect(first.queueOffset).toBeTypeOf('number');  // fails: "undefined"
   ```
   
   ### What Did You Expect to See?
   
   The demo messages carry the three fields the contract requires, so the detail panel shows a Broker and a Queue Offset the way it does against a real backend.
   
   ### What Did You See Instead?
   
   Both rows render `-` for every message, because the fixtures never set the fields the panel reads.
   
   ### Additional Context
   
   A fix with a regression test follows in a pull request.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] The demo message detail reports the broker and queue offset as unavailable [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6790:
URL: https://github.com/apache/rocketmq-dashboard/issues/6790#issuecomment-6391325192

   This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.


-- 
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: [I] [Bug] The demo message detail reports the broker and queue offset as unavailable [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #6790: [Bug] The demo message detail reports the broker and queue offset as unavailable
URL: https://github.com/apache/rocketmq-dashboard/issues/6790


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