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 10475aa1d fix(dlq): fall back to the last page when a resend empties
the current detail page (#7345)
10475aa1d is described below
commit 10475aa1d363b0796bad2ac2d1488d53c604a525
Author: bob <[email protected]>
AuthorDate: Fri Nov 27 11:59:19 2026 +0800
fix(dlq): fall back to the last page when a resend empties the current
detail page (#7345)
---
web/src/pages/instance/dlq.tsx | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/web/src/pages/instance/dlq.tsx b/web/src/pages/instance/dlq.tsx
index 69b69e227..d89c199ff 100644
--- a/web/src/pages/instance/dlq.tsx
+++ b/web/src/pages/instance/dlq.tsx
@@ -417,6 +417,15 @@ const DLQPage = () => {
pageSize,
});
if (detailRequestIdRef.current !== requestId) return;
+ // A resend removes messages from the DLQ topic, so the reloaded page
can end up past the
+ // last page; fall back to the last page instead of showing an emptied
one.
+ if (result.items.length === 0 && result.total > 0 && page > 1) {
+ const lastPage = Math.max(1, Math.ceil(result.total / pageSize));
+ if (page > lastPage) {
+ await loadDetailMessages(group, lastPage, pageSize);
+ return;
+ }
+ }
setDetailMessages(result.items);
setDetailTotal(result.total);
setDetailPage(page);