RockteMQ-AI commented on code in PR #3290:
URL:
https://github.com/apache/rocketmq-dashboard/pull/3290#discussion_r3939611035
##########
web/src/api/message.ts:
##########
@@ -14,6 +14,7 @@ export interface MessageRecord {
bornHost: string;
storeHost: string;
properties: Record<string, string>;
+ propertiesTruncated?: boolean;
Review Comment:
None of the changed paths exist in this repository or its git history (git
log --all -- web/ is empty). The actual frontend is frontend-new/, a React JSX
app (frontend-new/src/pages/Message/message.jsx,
frontend-new/src/components/MessageDetailViewDialog.jsx), with no QueueBrowser
component or queue-browser feature at all. This diff cannot be applied to
apache/rocketmq-dashboard master and appears to target a different repository
or fork; please rebase onto the real frontend layout.
##########
web/src/api/message.ts:
##########
@@ -14,6 +14,7 @@ export interface MessageRecord {
bornHost: string;
storeHost: string;
properties: Record<string, string>;
+ propertiesTruncated?: boolean;
Review Comment:
propertiesTruncated is not part of the backend contract. Message query
endpoints return MessageView
(src/main/java/org/apache/rocketmq/dashboard/model/MessageView.java:51), which
exposes properties (Map<String,String>) but has no propertiesTruncated field,
and no code anywhere in the repo bounds properties to 64 entries / 1,024 chars
per value (grep for 'truncat' returns nothing). The truncation-warning UI and
the regression test that sets propertiesTruncated: true exercise a field the
server never sends, so that path is dead code in production and the PR
description's backend claims are inaccurate.
##########
web/src/pages/instance/message.tsx:
##########
@@ -917,6 +920,37 @@ const MessagePageContent = ({
<Typography.Title level={5} style={{ marginBottom: 8 }}>
消息体
</Typography.Title>
+ {messageProperties(selectedMsg).length > 0 && (
Review Comment:
The PR premise ('the frontend never showed properties') is false for this
repo: the message detail dialog already renders every property with copyable
values in frontend-new/src/components/MessageDetailViewDialog.jsx:129-137, and
the Message/Trace/Dlq pages already surface TAGS/KEYS from properties. If
landed on the real frontend, this change would duplicate existing functionality
rather than fix a gap.
##########
web/src/pages/instance/message.tsx:
##########
@@ -917,6 +920,37 @@ const MessagePageContent = ({
<Typography.Title level={5} style={{ marginBottom: 8 }}>
消息体
</Typography.Title>
+ {messageProperties(selectedMsg).length > 0 && (
+ <>
+ <Typography.Title level={5} style={{ marginBottom: 8, marginTop:
24 }}>
+ 消息属性
+ </Typography.Title>
+ {selectedMsg.propertiesTruncated && (
+ <Alert
Review Comment:
Hardcoded Chinese strings ('消息属性', '服务端已截断消息属性') bypass the project's i18n
layer (frontend-new/src/i18n/index.js already defines MESSAGE_PROPERTIES for
zh/en). New UI copy should go through translations so the English locale is not
broken.
##########
web/src/components/QueueBrowser.tsx:
##########
@@ -364,6 +368,34 @@ export const QueueBrowserResults = ({ state }: { state:
QueueBrowserState }) =>
{entry.message.bornHost || '-'}
</Descriptions.Item>
</Descriptions>
+ {messageProperties(entry.message).length > 0 && (
+ <Card size="small" title="Properties" style={{
marginTop: 12 }}>
+ {entry.message.propertiesTruncated && (
Review Comment:
Minor code-quality nits if the target codebase existed: the
messageProperties() helper is duplicated in QueueBrowser.tsx and message.tsx,
and the QueueBrowser truncation Alert omits the explanatory description used in
the modal, so the two truncation warnings are inconsistent.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]