Repository navigation
Conversation
…hinkFlowLab#2438) Fixes ThinkFlowLab#2438 Written-by: Delivery-2 cleanFaceName, cleanFaceRole, sanitizePlatformText and the two join-error details clipped with a bare String#slice, so a cap that landed between the halves of a surrogate pair stored a lone high surrogate: a peer's display name of 59 characters plus an emoji came back as 60 units ending in \ud83d, drawn as a replacement character in the member list and carried into the untrusted-message fence. The caps also counted UTF-16 units, so an emoji-heavy name reached half the room of an ASCII one. One local cut() helper now serves the five sites; no cap value, wording, wire shape or endpoint changes. Docs-not-needed: no ownership, contract or module boundary changed; five text caps in face-rooms.js now cut on code points.
|
Written-by: Delivery-2 @Birfy review request for this exact tip: Red-first on a clean base plus the gates are in the PR body; Please review |
|
Closing: our account has no write access to Owner: Delivery-2 |
Written-by: Delivery-2
Fixes #2438
Owner: Delivery-2
Tip SHA: 331b9ca — the fork commit for tree
ccaa42f155; the same tree was checked locally at22511136, whose message and base5e71a07eare identicalBranch:
delivery2/social-face-text-codepoints(forkHugoXK/FlyBot, basedelivery/ai-centric-development-service@5e71a07e)Reproduce
A remote member chooses its own display name, role and avatar, and the social plugin caps those strings with a bare
String#slice. A cap that lands between the halves of a surrogate pair stores the lone high surrogate; the room list, the room header, the transcript and the<untrusted-message from="…">fence then carry�:Actual on base:
name 60 d83d false/role 80 d83d false— both end in\ud83d. Expected: the cap lands after the whole emoji and the stored label is well formed, and the 60 / 80 / 200 caps count code points, so a name of 60 emoji is not cut in half at 30. The same class was fixed for the host under #1993/#2000 and for the workflow node avatar under #2017.What changed
plugins/social/src/face-rooms.js(+11/−12) — one localcut(text, max)helper and five call sites:cleanFaceName(60) — the member and room label, also thefromof an<untrusted-message>fence;cleanFaceRole(80) — the member's role label;sanitizePlatformText(200) — a platform line kept in the transcript;No cap value, wording, wire shape or endpoint changes.
plugins/social/test/face-text-bounds.test.js(new, 27 lines): three cases — a name cap and a role cap that land inside an emoji, plus the code-point count a name of whole emoji keeps.changelog.d/2438-social-face-text-code-points.fixed.md(new, 1 line): a person sees this label.Red without the source change
plugins/social/test/face-text-bounds.test.json base5e71a07ewith the source untouched — 3 fail / 0 pass:With the fix at the tip:
# pass 3 / # fail 0.What I ran (at the tree
2251113)The 7 core failures are the same environment group on the base tree, unrelated to this diff:
test/project-runtime-setup.test.js(no Codex login cache on this box) andtest/workbench-client.test.js(six scoped-routing/composer cases). Base full run:# tests 3159 / # pass 3152 / # fail 7— same names, same count.Not run
npm run verifyas one command stops before the suites on this box: core lint'sarch-docsstep callsgit diff origin/main…, and this clone has noorigin/mainref (its remote is the fork; the lane's base is the delivery branch). Each gate above was run individually, withARCH_DOCS_BASEpointing at the lane's base.node core/scripts/build-workbench.mjs --checkfails here onERR_MODULE_NOT_FOUND: Cannot find package 'react'— a dependency of this box, not of this diff.core/index.jsandcore/src/host/are untouched.Docs-not-needed: no ownership, contract or module boundary changed; five text caps in
face-rooms.jsnow cut on code points. This line is also in the branch commit.Checkpoint
{ "pr": 2439, "claim": "Delivery-2", "issue": 2438, "summary": "cleanFaceName, cleanFaceRole, sanitizePlatformText and the two join-error details capped peer-supplied face-room text with a bare String#slice, so a cap inside a surrogate pair stored a lone high surrogate that the room list, the transcript and the untrusted-message fence drew as a replacement character. The caps also counted UTF-16 units, so an emoji-heavy name reached half the room of an ASCII one. One local cut() helper now serves the five sites, and three cases prove the name and role caps on code points; no cap value, wording or wire shape changed.", "files": ["plugins/social/src/face-rooms.js", "plugins/social/test/face-text-bounds.test.js", "changelog.d/2438-social-face-text-code-points.fixed.md"], "checks": { "ran": "cd plugins/social && node --import ./test/resolve.mjs --test \"test/*.test.js\" && ARCH_DOCS_BASE=upstream/delivery/ai-centric-development-service npm --prefix core run lint && node scripts/ds-bot-patches.mjs check && node .github/scripts/changelog.mjs check", "result": "green", "at": "22511136c8465f0e8360071dfaf3c3f799dc8cbf" }, "next": "none — ready for review" }