fix(qa-matrix): keep shared reply previews UTF-16 safe#102656
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 8:21 AM ET / 12:21 UTC. Summary PR surface: Source +1, Tests +17. Total +18 across 2 files. Reproducibility: yes. Source inspection shows current main can split a surrogate pair when Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 narrow SDK-helper substitution after the contributor adds redacted Matrix QA runtime proof showing the boundary-emoji reply preview remains valid Unicode. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main can split a surrogate pair when Is this the best way to solve the issue? Yes. The existing plugin SDK AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f786efddcd88. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +17. Total +18 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
Review history (1 earlier review cycle)
|
Replace `.slice(0, 200)` with `truncateUtf16Safe(replyBody, 200)` in buildMatrixReplyArtifact to prevent surrogate pair corruption. Ref. lsr911 pattern — mechanical substitution, no behavior change.
05c363b to
38655d5
Compare
|
Maintainer proof on exact head
Only redacted derived results were retained; homeserver state, registration data, account/event IDs, and captured content were excluded. Native exact-head prepare remains the merge gate. @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Merged via squash.
|
* fix(qa-matrix): keep reply body preview truncation UTF-16 safe Replace `.slice(0, 200)` with `truncateUtf16Safe(replyBody, 200)` in buildMatrixReplyArtifact to prevent surrogate pair corruption. Ref. lsr911 pattern — mechanical substitution, no behavior change. * test(qa-matrix): preserve reply preview semantics --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The shared Matrix QA reply artifact bounded its trimmed body preview with raw UTF-16 code-unit slicing. A preview boundary through an emoji or another supplementary character could store malformed evidence.
Why This Change Was Made
buildMatrixReplyArtifact, used across room, media, restart, and E2EE scenarios, now calls the public plugin SDKtruncateUtf16Safehelper. The reviewed branch is rebased onto current main and retains the existing distinction between a missing body (undefined) and a present whitespace-only body ("").User Impact
Matrix QA evidence remains valid Unicode at the 200-unit preview cap. Scenario matching, full observed events, token checks, and empty-body artifact semantics are unchanged.
Evidence
git diff --checkpassed.