unbridled-41 commented on PR #4752:
URL:
https://github.com/apache/rocketmq-dashboard/pull/4752#issuecomment-5759530613
### Evidence for this PR
**Head / diff (verified against the pushed branch)**
- head `40e43943feaf3625a7988e44bed78db2ad9832da`, base `rocketmq-studio`
(tip `cd448e17`), 1 commit, `mergeStateStatus: CLEAN`.
- `git show --stat 40e43943` → `web/src/pages/instance/dlq.tsx +4/-0`,
`DLQPage.test.tsx +44/-0`.
**Red → green**
```
$ cd web && npx vitest run src/pages/instance/__tests__/DLQPage.test.tsx
--maxWorkers=2
FAIL ... > drops the previous group messages when the next detail load
fails
❯ src/pages/instance/__tests__/DLQPage.test.tsx:304:59
expect(screen.queryByText('order-dead-letter-1')).not.toBeInTheDocument()
Tests 1 failed | 21 passed (22) # red
$ npx vitest run src/pages/instance/__tests__/DLQPage.test.tsx --maxWorkers=2
Tests 22 passed (22) # green
$ npx vitest run src/pages/instance --maxWorkers=2
Test Files 8 passed (8) Tests 170 passed (170)
$ npx tsc -b # clean, exit 0
$ npx eslint src/pages/instance/dlq.tsx
src/pages/instance/__tests__/DLQPage.test.tsx
✖ 1 problem (0 errors, 1 warning) #
react-refresh/only-export-components on dlq.tsx:82, pre-existing
```
**Teeth**
The new test drives the real drawer: it loads group A's detail
(`order-dead-letter-1` visible), then opens 消息明细 for a second group whose
request rejects, and asserts the error, the absence of A's row, and `导出全部`
disabled. Reverting only the two added `setDetail…` lines makes it red again at
the row assertion quoted above.
**Consistency with the file's own convention**
`#4487` (`8457a929`, "isolate detail resend state across instance switches")
already added `setDetailMessages([]); setDetailTotal(0);` to the
instance/refresh block (`dlq.tsx:176-177`) and to the drawer's close handler
(`:838`). This PR adds the same pair to the third scope change, the group
switch (`:346-347`), so all three now behave alike.
**Duplicate check (re-run against the current indexes)**
- Open PRs (205 titles) / open issues (214 titles), keywords `dlq`,
`detailMessages`, `消息明细`, `drawer`, `stale detail`, `switch group`, `previous
group` → #4407, #4577/#4579, #4592, #4677, #4702, #4718; none covers the drawer
payload.
- `git log -S setDetailMessages -- web/src/pages/instance/dlq.tsx` →
`f1d4a17f` (feature), `8457a929` (#4487, instance switch + close), and this
commit.
**Scoring**
PRIORITY = 66 (impact 24 + blast radius 12 + reproducibility 18 +
maintenance value 12); FIX_CONFIDENCE = 90.
--
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]