lookupTokenInfo() in src/shared/balances.js caps the symbol it reads off a contract at 12 and the name at 64, and counted both in UTF-16 units. An emoji outside the Basic Multilingual Plane is two units, so the cut could fall between its halves, and the half left over was stored with the token and shown as U+FFFD wherever the token is listed. Both caps now count code points, with the same Array.from(...) idiom displaySymbol() has used since #329. The limits are unchanged.
The token name was cut the same unsafe way, so it gets the same fix.
tests/tokenLookupTruncation.test.js looks up a token whose contract answers with a symbol and a name made of such emoji, each starting with one ASCII letter so that a cut by UTF-16 units lands inside an emoji. Both tests fail against current next.
Not done, per the issue: no repair of a symbol or name already stored broken (pre-1.0, no upgrade paths).
Judgement call: the stored value is still cut with no ellipsis, as before; displaySymbol() adds one only on display.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/AutistMask/issues/458.
`lookupTokenInfo()` in `src/shared/balances.js` caps the symbol it reads off a contract at 12 and the name at 64, and counted both in UTF-16 units. An emoji outside the Basic Multilingual Plane is two units, so the cut could fall between its halves, and the half left over was stored with the token and shown as U+FFFD wherever the token is listed. Both caps now count code points, with the same `Array.from(...)` idiom `displaySymbol()` has used since https://git.eeqj.de/sneak/AutistMask/issues/329. The limits are unchanged.
The token name was cut the same unsafe way, so it gets the same fix.
`tests/tokenLookupTruncation.test.js` looks up a token whose contract answers with a symbol and a name made of such emoji, each starting with one ASCII letter so that a cut by UTF-16 units lands inside an emoji. Both tests fail against current `next`.
- Not done, per the issue: no repair of a symbol or name already stored broken (pre-1.0, no upgrade paths).
- Judgement call: the stored value is still cut with no ellipsis, as before; `displaySymbol()` adds one only on display.
Model: opus-5-5
clawbot
self-assigned this 2026-10-06 23:11:23 +02:00
lookupTokenInfo() cut the symbol at 12 and the name at 64 UTF-16 units,
so an emoji outside the Basic Multilingual Plane could be cut between its
two halves and the half left over stored and shown as U+FFFD. Both are
now cut on code points, as displaySymbol() does. A symbol already stored
broken is not repaired.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #458.
lookupTokenInfo()insrc/shared/balances.jscaps the symbol it reads off a contract at 12 and the name at 64, and counted both in UTF-16 units. An emoji outside the Basic Multilingual Plane is two units, so the cut could fall between its halves, and the half left over was stored with the token and shown as U+FFFD wherever the token is listed. Both caps now count code points, with the sameArray.from(...)idiomdisplaySymbol()has used since #329. The limits are unchanged.The token name was cut the same unsafe way, so it gets the same fix.
tests/tokenLookupTruncation.test.jslooks up a token whose contract answers with a symbol and a name made of such emoji, each starting with one ASCII letter so that a cut by UTF-16 units lands inside an emoji. Both tests fail against currentnext.displaySymbol()adds one only on display.Model: opus-5-5
PASS
Model: opus-5-5