Wang1rrr opened a new pull request, #4777:
URL: https://github.com/apache/rocketmq-dashboard/pull/4777
### Which Issue(s) This PR Fixes
Fixes #4774
### Brief Description
The message page's display formatter parses and re-serializes JSON. Using
that
formatted string for download or copy changes unsafe integers and original
whitespace, even though the received message body is already a string.
This preserves `record.body` directly in the download Blob and supplies the
original body as Ant Design's explicit copy text. It retains the existing
pretty-printed display and changes no backend API, dependencies, MIME type,
or
filename behavior.
The display itself can still round numbers: this narrowly scoped fix makes
download/copy lossless relative to the received body string, not the
presentation
formatter. It does not recover backend-truncated or encoded data. A different
display policy or lossless JSON parser would be a separate design discussion.
### How Did You Test This Change?
Node.js 22.23.2 on Windows; dependencies installed from the existing
lockfile with
`npm ci --ignore-scripts --no-audit --no-fund`.
Seven component regressions exercise real message-page buttons:
- Six download cases: unsafe integer, int64 maximum, safe integer, quoted ID,
original JSON whitespace/Unicode, and plain text. The actual Blob content,
filename and MIME type are checked at the `downloadBlob` boundary.
- One details-copy case exercises Ant Design's copy path and inspects the
selected
original text at the `document.execCommand('copy')` boundary.
Red/green evidence:
```text
Existing MessagePage tests before changes: 14 passed
New regressions on the original component: 4 failed, 17 passed
After the two production-line changes: 21 passed
```
Commands run from `web/`:
```text
npm test -- src/pages/instance/__tests__/MessagePage.test.tsx --maxWorkers=2
1 file, 21 tests passed
npm test -- --maxWorkers=2
139 files, 1287 tests passed (604.26s)
npm run lint
0 errors, 11 pre-existing warnings in unmodified files
npm run build
tsc -b and Vite production build passed
npx --no-install prettier --check src/pages/instance/message.tsx
src/pages/instance/__tests__/MessagePage.test.tsx
passed
git diff --check
passed
```
The initial uncapped full-suite attempt was interrupted because of slow
concurrent
execution; the complete capped run above is the verification result. jsdom
emits
existing unsupported pseudo-element/navigation warnings, but the suite exits
0.
Browser scope: the existing mock UI was queried and its message details
opened.
Clipboard readback was empty and the download-event wait timed out in the
test
browser, so browser export E2E is **not** claimed. No backend/Broker E2E was
run.
This change was prepared with AI assistance, independently reviewed, and
verified
with the actual commands above.
### Checklist
- [x] One coherent change; no unrelated modifications
- [x] Conventional Commit subject
- [x] Regression tests added and observed failing before the fix
- [x] No new dependencies or lockfile changes
- [x] No new UI strings or source files requiring translation/license updates
- [x] Existing formatted presentation and response contracts remain unchanged
- [ ] Backend architecture tests and Broker E2E (not run; frontend-only
change)
--
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]