You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/09/08 14:58:02 UTC
[PR] fix(message): preserve Unicode property characters [rocketmq-dashboard]
Aias00 opened a new pull request, #4170:
URL: https://github.com/apache/rocketmq-dashboard/pull/4170
Fixes #4167.
## Problem
`MessagePropertyDisplay` capped property values with UTF-16 `String.length()` and `substring(0, 1024)`. A supplementary Unicode character uses a surrogate pair, so a truncation boundary between the two code units produced an unpaired surrogate. The same utility feeds both regular message details and DLQ property output.
The UTF-16 length check also treated each supplementary character as two displayed characters: a value containing exactly 1024 emoji was incorrectly marked oversized and truncated.
## Changes
- Count the property value limit in Unicode code points.
- Compute the truncation index with `offsetByCodePoints`, preserving complete surrogate pairs.
- Use the same code-point rule in `hasOversizedProperty` so the value and truncation metadata cannot disagree.
- Keep the existing 1024-character limit and `...` suffix unchanged for ASCII/BMP text.
## TDD evidence
Before implementation, the new regressions showed both failures:
- 1023 ASCII characters followed by an emoji were cut into an isolated high surrogate;
- exactly 1024 emoji were incorrectly reported as oversized.
After the fix:
```text
mvn -B test -Dtest='MessagePropertyDisplayTest,RocketMQMessageProviderTest,RocketMQDLQProviderTest'
Tests run: 82, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS
Checkstyle violations: 0
```
Tests were run with Java 21.
## Compatibility
No REST contract, persistence, dependency, or frontend changes. ASCII and BMP property values retain their existing behavior; supplementary Unicode values now use user-visible code-point counting and remain well formed after truncation.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(message): preserve Unicode property characters [rocketmq-dashboard]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on PR #4170:
URL: https://github.com/apache/rocketmq-dashboard/pull/4170#issuecomment-5681792549
Closing as a duplicate of #4226, which implements the same code-point-safe message-property truncation fix and remains open for review.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(message): preserve Unicode property characters [rocketmq-dashboard]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed pull request #4170: fix(message): preserve Unicode property characters
URL: https://github.com/apache/rocketmq-dashboard/pull/4170
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org