Repository navigation
fix(slack): keep prototype-named emoji shortcodes intact - #136374
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 9:38 PM ET / September 6, 2026, 01:38 UTC. ClawSweeper reviewWhat this changesThe Slack plugin preserves custom emoji names that match JavaScript prototype properties by replacing its glyph lookup object with a Map and adding regression cases. Merge readiness✅ Ready for maintainer review This fix remains necessary on current main and v2026.9.2. No blocking findings remain; the maintainer’s verification and direct SDK inspection resolve the previous dependency blocker. Priority: P2 Review scores
Verification
How this fits togetherSlack reaction actions and acknowledgement or typing reactions share one emoji normalizer. It converts known glyphs into Slack shortcodes before the Slack client sends add or remove requests. flowchart LR
A[Message reaction action] --> C[Shared emoji normalization]
B[Acknowledgement and typing reactions] --> C
C --> D{Known glyph?}
D -->|Yes| E[Mapped shortcode and skin tone]
D -->|No| F[Preserved custom name]
E --> G[Slack client add or remove request]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +4. Total +4 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one prototype-safe Map lookup in Slack’s shared normalizer, preserving custom names and existing glyph mappings without new configuration or caller-specific guards. Do we have a high-confidence way to reproduce the issue? Yes: current-main source deterministically returns inherited values for prototype-named inputs, and the supplied before/after HTTP trace demonstrates the resulting serialization failure. This reviewer did not execute a current-main reproduction. Is this the best way to solve the issue? Yes: replacing the private dictionary with Map fixes both mutations at their shared owner and matches the adjacent skin-tone representation; caller guards would duplicate the repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e10007407d7c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
dfcef5e to
f0df1df
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
97f2136 to
c1c1dc5
Compare
c1c1dc5 to
c8ce4ad
Compare
normalizeSlackEmojiName indexed the glyph-to-shortcode object literal with the caller-supplied emoji name, so a custom emoji named `constructor`, `__proto__` or `toString` resolved to an inherited Object.prototype value. That value is truthy, so the `shortname ?? withoutColons` pass-through never ran and reactions.add/remove got a function or Object.prototype as `name` instead of the string. Reachable from the reaction actions and from an `ackReaction` / typing-reaction config value, both free-form strings. The skin-tone sibling in the same file is a Map and never had the problem, so make this table a Map too. A prototype-named key misses instead of resolving.
c8ce4ad to
db97c8a
Compare
|
@clawsweeper re-review Maintainer dependency verification completed for the exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* commit '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) test(text): consolidate literal sanitizer cases (#139579) test(gateway): observe native drain without a lint exception (#139576) test(memory): consolidate visibility fixtures without policy defaults (#139569) fix(ui): show shimmer skeletons while loading Control UI (#139525) ...
* origin/main: fix(cli): keep note text with Windows and Unicode line endings (#139512) fix(agents): keep isolated completion context on its admitted generation (#139607) fix: avoid declaration builds during source-server updates (#139392) fix(models): keep discovered models after catalog refresh failures (#139357) fix(gateway): record a transcript notice when a run fails before replying (#139439) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479)
* commit 'refs/openclaw/tasks/pr-135167-main': (2467 commits) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) ...
…6374) normalizeSlackEmojiName indexed the glyph-to-shortcode object literal with the caller-supplied emoji name, so a custom emoji named `constructor`, `__proto__` or `toString` resolved to an inherited Object.prototype value. That value is truthy, so the `shortname ?? withoutColons` pass-through never ran and reactions.add/remove got a function or Object.prototype as `name` instead of the string. Reachable from the reaction actions and from an `ackReaction` / typing-reaction config value, both free-form strings. The skin-tone sibling in the same file is a Map and never had the problem, so make this table a Map too. A prototype-named key misses instead of resolving.
What Problem This Solves
Fixes an issue where reacting with a Slack custom emoji whose name collides with an
Object.prototypekey sent a brokenreactions.addrequest.constructor,__proto__andtoStringare legal custom emoji names. Reacting withconstructorortoStringput the inherited function in thenamefield, which the WebClient's form encoder drops, so the request reached Slack with nonameat all.__proto__went out asname={}.Why This Change Was Made
normalizeSlackEmojiNameindexed the glyph-to-shortcode object literal with the caller-supplied name, so an inherited value came back instead ofundefined. Inherited values are truthy, so theshortname ?? withoutColonspass-through never ran. The table is now aMap, matchingSLACK_EMOJI_SKIN_TONE_BY_MODIFIERtwelve lines above it, which never had the problem. It is module-private with one reader.User Impact
Custom emoji named
constructor,toStringand the rest react like any other name. Known glyphs and skin-tone variants are unchanged.Evidence
Rebased onto
b6a4d0dad43. The two red checks on the previous head weresecurity-fastand theci-gatethat mirrors it, both the "Audit production dependencies" advisory timeout.Real behavior through
reactSlackMessageandremoveSlackReactioninextensions/slack/src/actions.ts, with the real@slack/web-api8.0.0WebClientfrom the extension's owngetSlackWriteClientfactory. The only stand-in is the Slack host:slackApiUrlpoints at a localhttp.createServerthat records each raw request and answers{"ok":true}. Nothing in the reaction path is mocked. Same script, same inputs, run once withactions.tsfromb6a4d0dad43and once on this branch.Before,
actions.tsfrom main:After, this branch (
git checkout HEAD -- extensions/slack/src/actions.tsfirst):The three prototype-named rows are the only lines that differ.
thumbsup, the👍glyph and the👍🏽skin-tone variant encode the same way before and after.The script, unchanged between the two runs:
The three rows added to
actions.reactions.test.tspin the same thing at the client boundary. On the old lookup:toString:reached the client asname: [Function toString]and all three fail; they pass on the Map.actions.reactions-limit.test.tsnext to it also passes, 16 of 16.No live Slack workspace behind this. I don't have one where I can add a custom emoji named
constructor, so the Slack host above is a local stand-in and the request it recorded is the proof, not a workspace response. The mock-gateway harness goes through qa-channel and never reaches the Slack reaction path.AI-assisted. Fully tested.