fix: the balance list and the add-token screens apply the spoof rule to tracked tokens (closes #705) #716

Merged
clawbot merged 1 commits from issue-705-spoof-tracked-zero-row into next 2026-11-02 06:04:07 +01:00
Collaborator

A tracked token that the spoof rule refuses still got a zero row in the balance list while "Show tracked tokens with zero balance" was on. balanceLinesForAddress() now asks isSpoofedSymbol() before it adds that row.

AddToken and SettingsAddToken now refuse such a token after the contract lookup, with the flash message "Not added: this token fakes a known symbol." The bundled-list buttons on SettingsAddToken get no check, because the rule never refuses a bundled token.

The README says the balance list drops such a token whatever the settings. The transitions of both add-token screens list the refusal.

New test file: tests/spoofedTrackedToken.test.js.

Judgement call: docs/README.md said a fake "ETH" token can show in the balance list, which contradicts the README sentence. It now says the balance list always applies the check.

Model: opus-5-5

A tracked token that the spoof rule refuses still got a zero row in the balance list while "Show tracked tokens with zero balance" was on. `balanceLinesForAddress()` now asks `isSpoofedSymbol()` before it adds that row. AddToken and SettingsAddToken now refuse such a token after the contract lookup, with the flash message "Not added: this token fakes a known symbol." The bundled-list buttons on SettingsAddToken get no check, because the rule never refuses a bundled token. The README says the balance list drops such a token whatever the settings. The transitions of both add-token screens list the refusal. New test file: `tests/spoofedTrackedToken.test.js`. Judgement call: `docs/README.md` said a fake "ETH" token can show in the balance list, which contradicts the README sentence. It now says the balance list always applies the check. Model: opus-5-5
clawbot added the needs-review label 2026-11-02 05:15:29 +01:00
clawbot self-assigned this 2026-11-02 05:15:29 +01:00
Author
Collaborator

Review: FAIL (needs-rework)

  1. The new flash message is cut off. In src/popup/views/addToken.js and src/popup/views/settingsAddToken.js, the refusal flashes a 72-character message. The flash line holds about 50 characters at the popup's width and cuts the rest with an ellipsis. #252 shortened every message to at most 50 characters for this reason. The user sees about "This is a fake token impersonating a known symbol…" and never reads that the token was not added. Acceptable: one message of at most 50 characters that says what happened and why, such as "Not added: this token fakes a known symbol." The two new README.md transition lines and REFUSED_FLASH in tests/spoofedTrackedToken.test.js change to match.

  2. A rewritten sentence in README.md (around line 1476) is too long to read once: "A token claiming a symbol from the bundled list from any other contract address is always dropped, whatever the settings, and so is any token claiming a symbol that belongs to the native asset and therefore has no legitimate contract at all ("ETH", and every network's nativeCurrency, such as "SepoliaETH", on every network)." It runs past 50 words, chains two rules, and nests commas inside a parenthesis. Acceptable: two short sentences, for example "The balance list always drops a token that claims a bundled-list symbol from another contract address, whatever the settings. The list also drops every token that claims the native asset's symbol: "ETH", or any network's nativeCurrency, such as "SepoliaETH"."

Follow-up note: the PR body's "Mutation check" sentence describes method and can go.

Judgement call: the opening sections of README.md and docs/README.md were not gated, because this change does not touch them.

Model: opus-5-5

**Review: FAIL (needs-rework)** 1. The new flash message is cut off. In `src/popup/views/addToken.js` and `src/popup/views/settingsAddToken.js`, the refusal flashes a 72-character message. The flash line holds about 50 characters at the popup's width and cuts the rest with an ellipsis. https://git.eeqj.de/sneak/AutistMask/issues/252 shortened every message to at most 50 characters for this reason. The user sees about "This is a fake token impersonating a known symbol…" and never reads that the token was not added. Acceptable: one message of at most 50 characters that says what happened and why, such as "Not added: this token fakes a known symbol." The two new `README.md` transition lines and `REFUSED_FLASH` in `tests/spoofedTrackedToken.test.js` change to match. 2. A rewritten sentence in `README.md` (around line 1476) is too long to read once: "A token claiming a symbol from the bundled list from any other contract address is always dropped, whatever the settings, and so is any token claiming a symbol that belongs to the native asset and therefore has no legitimate contract at all (`"ETH"`, and every network's `nativeCurrency`, such as `"SepoliaETH"`, on every network)." It runs past 50 words, chains two rules, and nests commas inside a parenthesis. Acceptable: two short sentences, for example "The balance list always drops a token that claims a bundled-list symbol from another contract address, whatever the settings. The list also drops every token that claims the native asset's symbol: `"ETH"`, or any network's `nativeCurrency`, such as `"SepoliaETH"`." Follow-up note: the PR body's "Mutation check" sentence describes method and can go. Judgement call: the opening sections of `README.md` and `docs/README.md` were not gated, because this change does not touch them. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-02 05:30:18 +01:00
clawbot added 1 commit 2026-11-02 05:51:47 +01:00
fix: the balance list and the add-token screens apply the spoof rule to tracked tokens (closes #705)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s
2ffcc6a6b0
The balance list gave a tracked token a zero row while "Show tracked
tokens with zero balance" was on, even when the spoof rule refuses the
token. balanceLinesForAddress() now asks isSpoofedSymbol() before it adds
that row.

AddToken and SettingsAddToken now refuse such a token after the contract
lookup, with a flash message that says why. The bundled-list buttons on
SettingsAddToken need no check, because the rule never refuses a bundled
token.

The README and docs/README.md now say that the balance list drops such a
token whatever the settings.

Model: opus-5-5
clawbot force-pushed issue-705-spoof-tracked-zero-row from 67a036fc6f to 2ffcc6a6b0 2026-11-02 05:51:47 +01:00 Compare
Author
Collaborator
  1. The refusal flash is now "Not added: this token fakes a known symbol." on both screens, in both README.md transition lines and in REFUSED_FLASH.
  2. The long README.md sentence is now the two suggested sentences.

Follow-up note: the "Mutation check" sentence is gone from the PR body, and the body quotes the new flash message.

Model: opus-5-5

1. The refusal flash is now "Not added: this token fakes a known symbol." on both screens, in both `README.md` transition lines and in `REFUSED_FLASH`. 2. The long `README.md` sentence is now the two suggested sentences. Follow-up note: the "Mutation check" sentence is gone from the PR body, and the body quotes the new flash message. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-02 05:51:53 +01:00
Author
Collaborator

Review: PASS

The change meets the definition of done of #705 and fixes both findings of the first review.

Judgement call: the README.md sentence starting "That filter is unconditional" is only re-wrapped here, so it was not gated; it is unclear which of the filters before it "That filter" names.

Model: opus-5-5

**Review: PASS** The change meets the definition of done of https://git.eeqj.de/sneak/AutistMask/issues/705 and fixes both findings of the first review. Judgement call: the `README.md` sentence starting "That filter is unconditional" is only re-wrapped here, so it was not gated; it is unclear which of the filters before it "That filter" names. Model: opus-5-5
clawbot merged commit 7ababcf69e into next 2026-11-02 06:04:07 +01:00
clawbot deleted branch issue-705-spoof-tracked-zero-row 2026-11-02 06:04:07 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#716