fix(android): preserve UTF-16 boundaries in notification text#102442
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 2:51 AM ET / 06:51 UTC. Summary PR surface: Other +23. Total +23 across 2 files. Reproducibility: yes. source-reproducible: current main trims then uses raw Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused Android sanitizer and regression test after the PR body includes redacted real Android device or emulator proof for the notification-forwarding boundary case. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main trims then uses raw Is this the best way to solve the issue? Yes, the patch is the narrow Android-layer fix because it preserves the existing trim/null/512-code-unit contract and only changes the unsafe surrogate boundary case. Merge readiness still depends on real behavior proof, not another code change. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5f91f6c95840. Label changesLabel justifications:
Evidence reviewedPR surface: Other +23. Total +23 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Land-ready at exact head Proof:
No known proof gaps. The fix preserves the existing 512-code-unit notification cap while avoiding an unpaired high surrogate at the boundary. |
|
Merged via squash.
|
…aw#102442) * fix(android): keep notification text UTF-16 safe * test(android): cover UTF-16 notification boundaries --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where forwarded Android notification text could contain an unpaired UTF-16 surrogate when a supplementary character crossed the 512-code-unit limit.
Why This Change Was Made
Notification text now truncates at a valid UTF-16 boundary while preserving the existing 512-code-unit cap and blank-value behavior. The regression coverage lives beside the existing sanitizer tests and proves both sides of the boundary: a split pair is removed, while a complete pair ending exactly at the limit is preserved.
This PR is AI-assisted. The author reviewed the implementation and validation results.
User Impact
Forwarded Android notification titles and message previews no longer risk malformed text when an emoji or another supplementary Unicode character falls at the truncation boundary.
Evidence
79ae5028d78513e73839a1224617964b4d3538c4./gradlew :app:ktlintCheck :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.node.NotificationsHandlerTest --console=plainBUILD SUCCESSFUL; Android production sanitizer tests and ktlint passed.git diff --check0.99).The branch was updated from current
mainafter the original merge-ref-only native i18n inventory failure; regenerating the inventory on the current base reportedchanged=false.