renderTop10() in src/popup/views/settingsAddToken.js, the "Top tokens:" buttons.
What happens
Found by the review of #728; read from the code, not run in a browser. A "Top tokens:" button has no already-tracked check and stays enabled until its save finishes, so a fast double click tracks the token twice in memory.
What should happen
A token is tracked once. A second click shows "Already tracked." and tracks nothing.
Severity: minor
Definition of done
The button's handler checks at its top that the token is not tracked, using the check the rest of the screen uses. The top 100 dropdown does the same, if it lacks that check.
tests/addTokenLateAnswer.test.js: a test that double-clicks a "Top tokens:" button and finds state.trackedTokens holds the token once, failing on next. The test "a second click on Add while the lookup waits tracks the token once" also checks state.trackedTokens, since a save now drops duplicates from the stored list.
Model: opus-5-5
## Where
`renderTop10()` in `src/popup/views/settingsAddToken.js`, the "Top tokens:" buttons.
## What happens
Found by the review of https://git.eeqj.de/sneak/AutistMask/pulls/728; read from the code, not run in a browser. A "Top tokens:" button has no already-tracked check and stays enabled until its save finishes, so a fast double click tracks the token twice in memory.
## What should happen
A token is tracked once. A second click shows "Already tracked." and tracks nothing.
Severity: minor
## Definition of done
- [ ] The button's handler checks at its top that the token is not tracked, using the check the rest of the screen uses. The top 100 dropdown does the same, if it lacks that check.
- [ ] `tests/addTokenLateAnswer.test.js`: a test that double-clicks a "Top tokens:" button and finds `state.trackedTokens` holds the token once, failing on `next`. The test "a second click on Add while the lookup waits tracks the token once" also checks `state.trackedTokens`, since a save now drops duplicates from the stored list.
Model: opus-5-5
clawbot
self-assigned this 2026-11-03 06:24:29 +01:00
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.
Where
renderTop10()insrc/popup/views/settingsAddToken.js, the "Top tokens:" buttons.What happens
Found by the review of #728; read from the code, not run in a browser. A "Top tokens:" button has no already-tracked check and stays enabled until its save finishes, so a fast double click tracks the token twice in memory.
What should happen
A token is tracked once. A second click shows "Already tracked." and tracks nothing.
Severity: minor
Definition of done
tests/addTokenLateAnswer.test.js: a test that double-clicks a "Top tokens:" button and findsstate.trackedTokensholds the token once, failing onnext. The test "a second click on Add while the lookup waits tracks the token once" also checksstate.trackedTokens, since a save now drops duplicates from the stored list.Model: opus-5-5