This is an automated email from the ASF dual-hosted git repository.
lizhimins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new a6d36abeb fix(message): report a failed trace request on the verify
tab too (#5954)
a6d36abeb is described below
commit a6d36abeb74f70aafd30f286b960699c5f8e25b4
Author: 烤化の初雪 <[email protected]>
AuthorDate: Fri Nov 27 12:16:12 2026 +0800
fix(message): report a failed trace request on the verify tab too (#5954)
---
.../__tests__/MessagePageAsyncState.test.tsx | 22 +++++++++++++++++++
web/src/pages/instance/message.tsx | 25 ++++++++++++++++------
2 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/web/src/pages/instance/__tests__/MessagePageAsyncState.test.tsx
b/web/src/pages/instance/__tests__/MessagePageAsyncState.test.tsx
index 50c993dfb..feaac2024 100644
--- a/web/src/pages/instance/__tests__/MessagePageAsyncState.test.tsx
+++ b/web/src/pages/instance/__tests__/MessagePageAsyncState.test.tsx
@@ -349,6 +349,28 @@ describe('MessagePage async request ownership', () => {
).toBeInTheDocument();
});
+ it('reports a failed trace request on the verify tab instead of an empty
consumer table', async () => {
+ serviceMocks.queryMessages.mockResolvedValue([createMessage('message-a')]);
+ serviceMocks.getMessageTrace.mockRejectedValue(
+ new Error('Message query provider is not configured'),
+ );
+ const user = userEvent.setup({ pointerEventsCheck: 0 });
+ renderPage();
+ await selectTopic(user);
+
+ await user.click(screen.getByRole('button', { name: /^search查询$/ }));
+ const row = await screen.findByRole('row', { name: /message-a/ });
+ await user.click(within(row).getByRole('button', { name: /详情/ }));
+ const dialog = await screen.findByRole('dialog', { name: '消息详情' });
+
+ // Both tabs read the same payload, so the verify tab must not present the
failure as
+ // "no consumer groups consumed this message".
+ await user.click(within(dialog).getByText('验证'));
+ expect(
+ await within(dialog).findByText('Message query provider is not
configured'),
+ ).toBeInTheDocument();
+ });
+
it('loads a message trace lazily and reuses it for the same message', async
() => {
serviceMocks.queryMessages.mockResolvedValue([createMessage('message-a')]);
serviceMocks.getMessageTrace.mockResolvedValue(createTrace('cached-trace'));
diff --git a/web/src/pages/instance/message.tsx
b/web/src/pages/instance/message.tsx
index 7210060aa..92179f3ab 100644
--- a/web/src/pages/instance/message.tsx
+++ b/web/src/pages/instance/message.tsx
@@ -1221,13 +1221,24 @@ const MessagePageContent = ({
key: 'consumer',
label: t('messagePage.verify'),
children: (
- <Table
- columns={consumerStatusColumns}
- dataSource={traceData?.consumerStatus?.map((c, i) => ({ ...c, _key:
i })) || []}
- rowKey="_key"
- pagination={false}
- size="small"
- />
+ <>
+ {/* Both tabs read the same trace payload, so this one has to report
that request's
+ state too: an empty table for a failed or pending load reads as
"no consumer groups
+ consumed this message", which is exactly the wrong conclusion.
*/}
+ {traceLoading ? (
+ <Typography.Text
type="secondary">{t('messagePage.loadingTrace')}</Typography.Text>
+ ) : traceError ? (
+ <Alert showIcon type="warning" message={traceError} />
+ ) : (
+ <Table
+ columns={consumerStatusColumns}
+ dataSource={traceData?.consumerStatus?.map((c, i) => ({ ...c,
_key: i })) || []}
+ rowKey="_key"
+ pagination={false}
+ size="small"
+ />
+ )}
+ </>
),
},
];