Frun1na opened a new pull request, #5086:
URL: https://github.com/apache/rocketmq-dashboard/pull/5086
### Which Issue(s) This PR Fixes
- Fixes #<issue-id>
### Brief Description
Cloud vendors do not always report a message body size, and both providers
fabricated a measurement instead of reporting the gap:
- `TencentInstanceProvider.toRecordVO` (both the `DescribeMessage` and
`MessageItem` paths) hardcoded `.size(0)`;
- `AliyunConverters.toMessageRecord` mapped a missing `BodySize` to `0`.
The console's message detail then showed **`0 B`** for every Tencent message
(and Aliyun messages without `BodySize`) — indistinguishable from a real "empty
message" reading.
Following the existing unknown-sentinel convention
(`GroupListItem.onlineInstances = -1`, `QueueProgressVO.UNKNOWN_OFFSET`), the
fix introduces `MessageRecordVO.UNKNOWN_SIZE = -1`, uses it in both cloud
providers, and renders `-` on the web when the size is unknown. The AI tool
contract (`MessageItem.size`) stays a plain integer and passes the sentinel
through, so the tool output schemas are unchanged.
### How Did You Test This Change?
```
cd server && mvn -B -ntp test
-Dtest='AliyunConvertersBodyEncodingTest,TencentInstanceProviderTest'
AliyunConvertersBodyEncodingTest: Tests run: 5, Failures: 0, Errors: 0
TencentInstanceProviderTest: Tests run: 53, Failures: 0, Errors: 0
cd web && npx vitest run src/pages/instance/__tests__/MessagePage.test.tsx
Tests 24 passed (24)
```
The new assertions fail on the unpatched providers (they observe the
fabricated `0`):
```
TencentInstanceProviderTest.queryMessagesByMsgIdShouldReportUnknownSizeTest:
Failure (size expected -1, was 0)
AliyunConvertersBodyEncodingTest: 1 failure
MessagePage.test.tsx "renders an unknown message size as unavailable instead
of 0 B": failed ("−1 B" was rendered)
```
`npx eslint` on the touched web files reports no issues; `tsc -b` passes.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [x] 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]