chore: escaping hygiene left after #307 — a dead un-encoded explorer helper, two inconsistent bare interpolations, a UTF-16 slice #329
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the review of #327 (#327 (comment)). Each was traced and is safe today; all four are traps for the next change rather than defects.
explorerLink(network, type, value)atsrc/shared/networks.js:47is an exported, un-encoded twin of the newexplorerUrl()helper. Dead before and after #307, so not a regression — but it undercuts the "one helper that percent-encodes" invariant #307 established, and the next caller who finds it by name gets the unsafe one. Delete it, or make it delegate.src/popup/views/addressToken.js:202—${tokenDecimals}is the only value-shaped bare interpolation left, against the rule #307 writes at the top ofhelpers.js. Every writer was traced (parseInt/Number, no dApp-writable path intotrackedTokens), so it is safe; it is also the one exception a reader will cite as precedent.src/popup/views/home.js:267leavesaddrTotalbare whilesrc/popup/views/deleteAddress.js:96escapes the identicalformatAddressTotal()output. Both safe, mutually inconsistent — one of them is teaching the wrong lesson.displaySymbol()slices at a UTF-16 boundary — a 20-emoji symbol truncates onto a lone\ud83dand renders U+FFFD. Cosmetic, but the cap is right next to a security control and should not look sloppy.Definition of done
explorerLink()is deleted or delegates toexplorerUrl(); no un-encoded URL builder remains exported.src/popup/views/has no bare interpolation into aninnerHTMLstring — making the grep in #307's DoD a clean invariant with no exceptions to remember.displaySymbol()truncates on grapheme or code-point boundaries, never mid-surrogate. Test with an astral-plane symbol.make checkgreen.