unbridled-41 opened a new issue, #5935:
URL: https://github.com/apache/rocketmq-dashboard/issues/5935
### Studio Version
branch: `rocketmq-studio` @ `7e7aa344` (the revision verified; the branch is
based on it)
deployed as: not required to reproduce
### Runtime Environment
Reproduced with the backend and frontend tests (`cd server && mvn -o -B -ntp
test -Dtest='RocketMQDLQProviderTest'`, `cd web && npx vitest run
src/pages/instance/__tests__/DLQPage.test.tsx`).
### Connected RocketMQ Cluster
Any cluster with dead-letter messages; the divergence needs a selected
message that is no longer in the exported window.
### Describe the Bug
`GET /dlq/export-excel` applies the `msgIds` selection as a **filter over
the freshly scanned window**:
```java
List<DLQMessageVO> messages = scanResult.messages().stream()
.filter(message -> selected.isEmpty() ||
selected.contains(message.getMsgId()))
.map(this::toExportVO).toList();
```
and the response only describes scan completeness (`truncated`,
`failedQueueCount`, `limit`). The page then reports the *request* as the result:
```ts
message.success(`已导出 ${detailSelectedMsgIds.length > 0 ? `选中的
${detailSelectedMsgIds.length} 条` : '全部'}死信消息(${blob.size} 字节)`);
```
So a selected message that is not in the window - the operator changed
导出时间范围 after ticking rows (the selection is not reset by the range change), or
another operator resent it in between - is missing from the .xlsx while the
toast claims it was exported. Nothing in the sheet, the response or the audit
trail records the shortfall.
### Steps to Reproduce
1. Open a DLQ group's 消息明细 drawer and tick a message.
2. Change the export time range so that message falls outside it.
3. 导出选中: the .xlsx holds only the header row (or other messages), and the
toast says the selected message was exported.
### What Did You Expect to See?
The export reports how many rows it actually wrote, and says so when part of
the selection was not found.
### What Did You See Instead?
A success claim for a file that does not contain the selected message.
### Evidence
- `server/.../provider/apache/RocketMQDLQProvider.java` (`exportExcel`),
`server/.../instance/dlq/DLQController.java`,
`server/.../common/util/DlqExportHeaders.java`, `web/src/api/message.ts`,
`web/src/pages/instance/dlq.tsx` (`exportDetailExcel`).
- `cd web && npx vitest run src/pages/instance/__tests__/DLQPage.test.tsx -t
'selected messages'` - the new case fails before the fix.
### Impact
An operator keeps an evidence file believing it contains the selected
messages when it contains none of them, and cannot tell from the UI or the
response.
### Acceptance Criteria
- The export reports the rows it wrote and the selection size, and the page
warns when the selection was only partially written, with regression tests on
both sides.
**Corresponding PR:** #ISSUEPR#
--
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]