Aias00 opened a new issue, #4167:
URL: https://github.com/apache/rocketmq-dashboard/issues/4167

   ## Description
   
   Studio limits displayed message property values to 1024 characters through 
`MessagePropertyDisplay`. The current implementation uses UTF-16 
`String.length()` and `substring(0, 1024)`. If the boundary falls between the 
high and low surrogate of a supplementary Unicode character such as an emoji, 
the returned value contains an unpaired surrogate.
   
   The shared utility is used by both regular message details and DLQ message 
properties, so the malformed truncated value can surface in both APIs and 
render as a replacement character or invalid Unicode data downstream.
   
   ## Steps to reproduce
   
   1. Create a property value containing 1023 ASCII characters, followed by an 
emoji and more text.
   2. Pass it through `MessagePropertyDisplay.limitProperties`.
   3. Inspect the final character before the `...` suffix.
   
   ## Actual behavior
   
   The output ends with the emoji's isolated high surrogate because the UTF-16 
index 1024 splits its surrogate pair.
   
   ## Expected behavior
   
   The 1024-character limit should count Unicode code points and truncate only 
at code-point boundaries. Values containing 1024 code points should remain 
unchanged; larger values should retain the first 1024 complete code points plus 
the existing ellipsis suffix.
   
   ## Code location
   
   - 
`server/src/main/java/org/apache/rocketmq/studio/common/util/MessagePropertyDisplay.java`
   
   ## Proposed scope
   
   - Make value abbreviation code-point aware.
   - Apply the same counting rule in `hasOversizedProperty`.
   - Add regression tests for ASCII compatibility, exact emoji boundaries, and 
oversized mixed text.
   


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