enkilee opened a new pull request, #6337:
URL: https://github.com/apache/rocketmq-dashboard/pull/6337

   <!-- Make sure the base branch is `master`: that is the RocketMQ Studio 
trunk. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Link the issue with a keyword so it closes on merge. Trivial fixes need 
no issue.
        
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
 -->
   
   - Fixes #<issue-id>
   
   ### Brief Description
   
   <!-- What changes and why. Keep it short — the diff already shows how. -->
   ## Body
   
   ```
   PR #5448 capped the Body column of the dead-letter Excel export at POI's
   32767-char cell limit, but the Body Base64 column — which carries the raw
   bytes of a binary message — was left uncapped. A binary body over ~24 KB
   encodes to more than 32767 Base64 characters, so POI throws
   IllegalArgumentException and the whole export fails with a 502, not a
   single truncated cell.
   
   Fix: apply the same cell-length cap to Body Base64. The existing
   abbreviateBody helper is renamed to abbreviateForExcelCell (it now serves
   both columns) and reused. Base64 is pure ASCII, so the code-point-boundary
   guard never fires for it — the method is just a length cap there, while
   the Body column still gets the surrogate-pair-safe cut it already had.
   
   Test: two new cases in DLQMessageExcelRowTest —
   shouldClampAnOversizedBodyBase64Test asserts a 40000-char Base64 value is
   capped to 32767 ending with the truncation suffix, and
   shouldLeaveAShortBodyBase64UntouchedTest asserts a short value is unchanged.
   Mutation-checked: removing the cap reddens the clamp case. All 5 tests green,
   0 checkstyle violations.
   ```
   
   ## Changed files
   
   - 
`server/src/main/java/org/apache/rocketmq/studio/instance/dlq/DLQMessageExcelRow.java`
 (rename `abbreviateBody` → `abbreviateForExcelCell`, apply it to `bodyBase64`)
   - 
`server/src/test/java/org/apache/rocketmq/studio/instance/dlq/DLQMessageExcelRowTest.java`
 (+2 tests)
   
   ### How Did You Test This Change?
   
   <!-- Paste the commands you ran and what they printed. Typical verification:
        backend  `cd server && mvn -B -ntp test`   (integration tests need 
MySQL 8, see CONTRIBUTING.md)
        frontend `cd web && npm test && npm run lint && npm run build`
        A pull request with no verification will not be merged. -->
   
   ### Checklist
   
   - [ ] One coherent change; unrelated modifications are not bundled in
   - [ ] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [ ] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [ ] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   


-- 
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]

Reply via email to