A history fetch on AddressDetail that returns after a network switch shows the previous network's transactions #657

Closed
opened 2026-10-21 01:39:52 +02:00 by clawbot · 1 comment
Collaborator

Seen by the review of #654.

Where

AddressDetail, its transaction history fetch in src/popup/views/addressDetail.js. The fetch does not check, when it returns, that the network it was started for is still the active one.

What happens

The user opens AddressDetail on Ethereum Mainnet and switches to Sepolia in Settings (or the popup follows a switch saved elsewhere) while the history fetch is in flight. When the fetch returns, the previous network's transactions fill the list on the screen drawn for Sepolia, and that network's fraud contracts are added to Sepolia's list.

What should happen

applyChainSwitchFields() clears chain-specific data "so stale data from the previous chain is never displayed": a history fetch that returns after a network switch shows and stores nothing.

Severity: minor

Definition of done

  • A history fetch on AddressDetail that returns after a network switch adds nothing to the list or to the fraud contracts.
  • A test holding the fetch open across a switch, failing on next.

Model: opus-5-5

Seen by the review of https://git.eeqj.de/sneak/AutistMask/pulls/654. ## Where AddressDetail, its transaction history fetch in `src/popup/views/addressDetail.js`. The fetch does not check, when it returns, that the network it was started for is still the active one. ## What happens The user opens AddressDetail on Ethereum Mainnet and switches to Sepolia in Settings (or the popup follows a switch saved elsewhere) while the history fetch is in flight. When the fetch returns, the previous network's transactions fill the list on the screen drawn for Sepolia, and that network's fraud contracts are added to Sepolia's list. ## What should happen `applyChainSwitchFields()` clears chain-specific data "so stale data from the previous chain is never displayed": a history fetch that returns after a network switch shows and stores nothing. Severity: minor ## Definition of done - [ ] A history fetch on AddressDetail that returns after a network switch adds nothing to the list or to the fraud contracts. - [ ] A test holding the fetch open across a switch, failing on `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-21 01:39:52 +02:00
Author
Collaborator

Plan: one PR to next. AddressDetail's history fetch (src/popup/views/addressDetail.js) remembers the network it started on. When the answer lands, it is dropped unless that network is still the active one and the screen still shows the same address: no rows, no fraud contracts. It reuses the late-answer check that storedSettingIsOn() (src/shared/storedSettings.js) already makes when an answer lands, rather than adding a second mechanism. A Jest test holds the fetch open across a switch and fails on next.

Model: opus-5-5

Plan: one PR to `next`. AddressDetail's history fetch (`src/popup/views/addressDetail.js`) remembers the network it started on. When the answer lands, it is dropped unless that network is still the active one and the screen still shows the same address: no rows, no fraud contracts. It reuses the late-answer check that `storedSettingIsOn()` (`src/shared/storedSettings.js`) already makes when an answer lands, rather than adding a second mechanism. A Jest test holds the fetch open across a switch and fails on `next`. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#657