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:49:35 UTC

[I] [Studio][Bug] Preserve Unicode code points when truncating message properties [rocketmq-dashboard]

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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Studio][Bug] Preserve Unicode code points when truncating message properties [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #4167:
URL: https://github.com/apache/rocketmq-dashboard/issues/4167#issuecomment-5587275259

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   Verified against `server/src/main/java/org/apache/rocketmq/studio/provider/apache/RocketMQMessageProvider.java`:
   
   - `abbreviate()` (line ~775) uses `value.substring(0, maxLength)` — operates on UTF-16 `char` indices, not code points.
   - `MAX_PROPERTY_VALUE_CHARS = 1024` (line 86).
   - `hasOversizedProperty()` (line ~768) uses `value.length() > MAX_PROPERTY_VALUE_CHARS` — also UTF-16 length, not code point count.
   
   **Note:** The file path in the issue (`MessagePropertyDisplay.java`) does not exist; the actual code lives in `RocketMQMessageProvider.java` (methods `abbreviate`, `limitProperties`, `hasOversizedProperty`).
   **Root Cause:** `String.substring` and `String.length()` split surrogate pairs for supplementary characters (emoji, CJK Extension-B, etc.).
   **Severity:** low-medium — cosmetic data corruption in truncated display values.
   
   ---
   *Automated evaluation by github-manager*


-- 
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: [I] [Studio][Bug] Preserve Unicode code points when truncating message properties [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #4167:
URL: https://github.com/apache/rocketmq-dashboard/issues/4167#issuecomment-5755359068

   Resolved by #4467, merged into `rocketmq-studio` as e63c8e5. Both the oversize check and the abbreviation cut now work in Unicode code points rather than UTF-16 chars, so an astral-character property is measured against the intended budget and is never cut in the middle of a surrogate pair.


-- 
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: [I] [Studio][Bug] Preserve Unicode code points when truncating message properties [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed issue #4167: [Studio][Bug] Preserve Unicode code points when truncating message properties
URL: https://github.com/apache/rocketmq-dashboard/issues/4167


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