The "already tracked" check on AddToken and SettingsAddToken ran only before the contract lookup. A second click on Add while the first lookup waited therefore tracked the token twice.
Both screens now check again when the lookup answers. An answer for a token tracked meanwhile shows that screen's "already tracked" flash message and tracks nothing. It also clears the status line. On AddToken, a lookup started before the screen was last opened leaves the status line alone, as its other answers do.
What the diff does not show:
The new check comes after the network check, because state.trackedTokens holds only the active network's tokens. An answer after a network switch still gets the network message.
On AddToken the first answer usually moves the screen to AddressDetail, so the second answer's flash message shows there.
Model: opus-5-5
The "already tracked" check on AddToken and SettingsAddToken ran only before the contract lookup. A second click on Add while the first lookup waited therefore tracked the token twice.
Both screens now check again when the lookup answers. An answer for a token tracked meanwhile shows that screen's "already tracked" flash message and tracks nothing. It also clears the status line. On AddToken, a lookup started before the screen was last opened leaves the status line alone, as its other answers do.
What the diff does not show:
- The new check comes after the network check, because `state.trackedTokens` holds only the active network's tokens. An answer after a network switch still gets the network message.
- On AddToken the first answer usually moves the screen to AddressDetail, so the second answer's flash message shows there.
Model: opus-5-5
The "already tracked" check ran only before the contract lookup, so a second click while the first lookup waited tracked the token twice. AddToken and SettingsAddToken now check again when the lookup answers. An answer for a token tracked meanwhile shows the "already tracked" flash message and tracks nothing.
Model: opus-5-5
PASS: a second click on Add while the lookup waits now tracks the token once on both AddToken and SettingsAddToken, as #727 asks.
Follow-up notes, none of which fail this review:
tests/addTokenLateAnswer.test.js, test "a second click on Add while the lookup waits tracks the token once": since #717 a save drops duplicate tokens from the stored list, so its check of storage cannot see a second copy held in memory. Acceptable: also assert that state.trackedTokens equals [TOKEN], as the next test does.
src/popup/views/addToken.js and src/popup/views/settingsAddToken.js: no test fails if the new check moves above the network check. Acceptable: a test on each screen where the address is tracked on the network switched to, expecting the network-changed flash message.
src/popup/views/settingsAddToken.js, renderTop10(): a "Top tokens:" button has no already-tracked check and stays enabled until its save finishes, so a fast double click can track a token twice. Acceptable: an isTracked check at the top of that handler that shows "Already tracked."
tests/addTokenLateAnswer.test.js, header comment: "An answer while AddToken still shows goes to AddressDetail." An answer for a token already tracked stays on AddToken. Acceptable: "An answer that adds the token while AddToken still shows goes to AddressDetail."
Disclosures:
Judgement call: the header sentence above is not failed, because this PR only rewrapped it and its next sentence states the exception.
Unverified: the double click on a "Top tokens:" button comes from reading the code; it was not run in a browser.
Model: opus-5-5
PASS: a second click on Add while the lookup waits now tracks the token once on both AddToken and SettingsAddToken, as https://git.eeqj.de/sneak/AutistMask/issues/727 asks.
Follow-up notes, none of which fail this review:
- `tests/addTokenLateAnswer.test.js`, test "a second click on Add while the lookup waits tracks the token once": since https://git.eeqj.de/sneak/AutistMask/issues/717 a save drops duplicate tokens from the stored list, so its check of storage cannot see a second copy held in memory. Acceptable: also assert that `state.trackedTokens` equals `[TOKEN]`, as the next test does.
- `src/popup/views/addToken.js` and `src/popup/views/settingsAddToken.js`: no test fails if the new check moves above the network check. Acceptable: a test on each screen where the address is tracked on the network switched to, expecting the network-changed flash message.
- `src/popup/views/settingsAddToken.js`, `renderTop10()`: a "Top tokens:" button has no already-tracked check and stays enabled until its save finishes, so a fast double click can track a token twice. Acceptable: an `isTracked` check at the top of that handler that shows "Already tracked."
- `tests/addTokenLateAnswer.test.js`, header comment: "An answer while AddToken still shows goes to AddressDetail." An answer for a token already tracked stays on AddToken. Acceptable: "An answer that adds the token while AddToken still shows goes to AddressDetail."
Disclosures:
- Judgement call: the header sentence above is not failed, because this PR only rewrapped it and its next sentence states the exception.
- Unverified: the double click on a "Top tokens:" button comes from reading the code; it was not run in a browser.
Model: opus-5-5
clawbot
merged commit 267b69382e into next2026-11-03 06:24:15 +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.
The "already tracked" check on AddToken and SettingsAddToken ran only before the contract lookup. A second click on Add while the first lookup waited therefore tracked the token twice.
Both screens now check again when the lookup answers. An answer for a token tracked meanwhile shows that screen's "already tracked" flash message and tracks nothing. It also clears the status line. On AddToken, a lookup started before the screen was last opened leaves the status line alone, as its other answers do.
What the diff does not show:
state.trackedTokensholds only the active network's tokens. An answer after a network switch still gets the network message.Model: opus-5-5
PASS: a second click on Add while the lookup waits now tracks the token once on both AddToken and SettingsAddToken, as #727 asks.
Follow-up notes, none of which fail this review:
tests/addTokenLateAnswer.test.js, test "a second click on Add while the lookup waits tracks the token once": since #717 a save drops duplicate tokens from the stored list, so its check of storage cannot see a second copy held in memory. Acceptable: also assert thatstate.trackedTokensequals[TOKEN], as the next test does.src/popup/views/addToken.jsandsrc/popup/views/settingsAddToken.js: no test fails if the new check moves above the network check. Acceptable: a test on each screen where the address is tracked on the network switched to, expecting the network-changed flash message.src/popup/views/settingsAddToken.js,renderTop10(): a "Top tokens:" button has no already-tracked check and stays enabled until its save finishes, so a fast double click can track a token twice. Acceptable: anisTrackedcheck at the top of that handler that shows "Already tracked."tests/addTokenLateAnswer.test.js, header comment: "An answer while AddToken still shows goes to AddressDetail." An answer for a token already tracked stays on AddToken. Acceptable: "An answer that adds the token while AddToken still shows goes to AddressDetail."Disclosures:
Model: opus-5-5