fix: Blockscout and Etherscan lookups are off until the user turns them on (closes #668)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

Out of the box the wallet sent the user's addresses to Blockscout for history
and token lookups. It sent each recipient to Etherscan for its label. Two
settings, "Use Blockscout" and "Check recipients on Etherscan", now gate those
requests where they are made. Both are off in a new install and offered
unticked on Welcome and in Settings. While one is off, the screens that relied
on it say so in a plain line naming the setting. Unticking "Use Blockscout"
drops every untracked token from every address. After either changes in
Settings, Back draws again any screen a reopened popup can draw. ENS lookups
ask only the RPC endpoint.

Model: opus-5-5
This commit is contained in:
2026-10-26 01:39:30 +00:00
parent c316d9ee78
commit ceb6a3195b
54 changed files with 1944 additions and 161 deletions
+6
View File
@@ -1386,6 +1386,10 @@ const RECENT_BALANCE_REFRESH_MS = Math.floor(BALANCE_REFRESH_PERIOD_MS / 2);
// back over them (https://git.eeqj.de/sneak/AutistMask/issues/577).
// lastBalanceRefresh is left as the switch set it, so the next tick refreshes
// the new network.
//
// Nothing is applied either when "Use Blockscout" stored NOW is not the one the
// refresh ran with. Turning it off dropped the tokens the user has not tracked
// (src/popup/views/settings.js), and this refresh must not bring them back.
async function backgroundRefresh() {
const s = await getState();
const now = Date.now();
@@ -1397,6 +1401,7 @@ async function backgroundRefresh() {
wallets,
s.rpcUrl,
s.blockscoutUrl,
s.useBlockscout,
s.trackedTokens,
s.networkId,
);
@@ -1410,6 +1415,7 @@ async function backgroundRefresh() {
await updateState((fresh) => {
if (fresh.networkId !== s.networkId) return;
if (fresh.useBlockscout !== s.useBlockscout) return;
for (const wallet of fresh.wallets) {
for (const addr of wallet.addresses || []) {
const got = refreshed.get(String(addr.address).toLowerCase());