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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
