A network switch left the previous network's rows or failure message in Home's list until the new network's answer landed. loadHomeTxs() now replaces them with "Loading..." when it starts on a network other than the one the list holds. A redraw on the same network keeps its rows, so the ten-second refresh does not blink.
Home, AddressDetail and AddressToken compared the page's network before reading storage. A switch made in Settings can change the page during that read, and the answer was still drawn. They now compare after the read, for an answer and for a failure.
What the diff does not show:
The list is emptied when Home is next drawn, not at the switch. Every way onto Home draws Home first.
When the popup takes a switch saved elsewhere while Home is showing, the old rows stay up for the length of that save's write, as the balances do.
Disclosures:
Judgement call: the plan says to compare the page's network again after the read. I moved the compare there instead of repeating it, because a compare before the read only skips that read.
Deviation: two tests are in tests/popupFollowsNetworkSwitch.test.js, not the plan's file, because only that file drives the real popup.
Unverified: not run in a browser.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/AutistMask/issues/718.
A network switch left the previous network's rows or failure message in Home's list until the new network's answer landed. `loadHomeTxs()` now replaces them with "Loading..." when it starts on a network other than the one the list holds. A redraw on the same network keeps its rows, so the ten-second refresh does not blink.
Home, AddressDetail and AddressToken compared the page's network before reading storage. A switch made in Settings can change the page during that read, and the answer was still drawn. They now compare after the read, for an answer and for a failure.
What the diff does not show:
- The list is emptied when Home is next drawn, not at the switch. Every way onto Home draws Home first.
- When the popup takes a switch saved elsewhere while Home is showing, the old rows stay up for the length of that save's write, as the balances do.
Disclosures:
- Judgement call: the plan says to compare the page's network again after the read. I moved the compare there instead of repeating it, because a compare before the read only skips that read.
- Deviation: two tests are in `tests/popupFollowsNetworkSwitch.test.js`, not the plan's file, because only that file drives the real popup.
- Unverified: not run in a browser.
Model: opus-5-5
FAIL: needs rework. One defect: Home can still show the previous network's rows or failure message after a network switch, which #718 rules out.
src/popup/views/home.js, loadHomeTxs(): listNetworkId can name a network the list does not hold.
It is set when a load starts, not when an answer or failure message is written to the list. An older request can therefore fill the list while listNetworkId names another network. The next draw on that network then keeps what it finds.
A user meets this with a slow Blockscout answer:
Home on Ethereum Mainnet is waiting for an answer.
Pick Sepolia in Settings and go Back to Home.
Open Settings and pick Ethereum Mainnet. The old request lands now and writes Mainnet's rows or failure message to the list.
Pick Sepolia and go Back to Home.
Home on Sepolia then shows Mainnet's rows or failure message, not "Loading...", until Sepolia's answer lands. The comment above let listNetworkId ("The network that home-tx-list holds rows or a message for") is false in this case.
Acceptable:
Add listNetworkId = networkId; immediately before renderHomeTxList(ctx); in the answer path, and immediately before the "Failed to load transactions." write in the failure path.
Add a Jest test under "Home's list" in tests/historyAfterNetworkSwitch.test.js, one case for rows and one for the failure message:
hold the first Mainnet request and call HOME.open();
call onChainSwitch("sepolia"), hold a request and call HOME.open();
call onChainSwitch("mainnet") and let the first request land or fail;
call onChainSwitch("sepolia"), hold a request and call HOME.open();
expect "Loading..." in the list, and neither tx-row nor "Failed to load transactions."
Unverified: this was not run in a browser.
Model: opus-5-5
**FAIL: needs rework.** One defect: Home can still show the previous network's rows or failure message after a network switch, which https://git.eeqj.de/sneak/AutistMask/issues/718 rules out.
**`src/popup/views/home.js`, `loadHomeTxs()`: `listNetworkId` can name a network the list does not hold.**
It is set when a load starts, not when an answer or failure message is written to the list. An older request can therefore fill the list while `listNetworkId` names another network. The next draw on that network then keeps what it finds.
A user meets this with a slow Blockscout answer:
1. Home on Ethereum Mainnet is waiting for an answer.
2. Pick Sepolia in Settings and go Back to Home.
3. Open Settings and pick Ethereum Mainnet. The old request lands now and writes Mainnet's rows or failure message to the list.
4. Pick Sepolia and go Back to Home.
Home on Sepolia then shows Mainnet's rows or failure message, not "Loading...", until Sepolia's answer lands. The comment above `let listNetworkId` ("The network that `home-tx-list` holds rows or a message for") is false in this case.
Acceptable:
- Add `listNetworkId = networkId;` immediately before `renderHomeTxList(ctx);` in the answer path, and immediately before the "Failed to load transactions." write in the failure path.
- Add a Jest test under "Home's list" in `tests/historyAfterNetworkSwitch.test.js`, one case for rows and one for the failure message:
- hold the first Mainnet request and call `HOME.open()`;
- call `onChainSwitch("sepolia")`, hold a request and call `HOME.open()`;
- call `onChainSwitch("mainnet")` and let the first request land or fail;
- call `onChainSwitch("sepolia")`, hold a request and call `HOME.open()`;
- expect "Loading..." in the list, and neither `tx-row` nor "Failed to load transactions."
Unverified: this was not run in a browser.
Model: opus-5-5
A network switch left the previous network's rows or failure message in Home's
list until the new network's answer landed. Home now replaces them with
"Loading..." when it first draws on a new network. A redraw on the same network
keeps its rows.
Home, AddressDetail and AddressToken compared the page's network before reading
storage. A switch made in Settings could change the page during that read, and
the answer was still drawn. They now compare after the read, for an answer and
for a failure.
Model: opus-5-5
src/popup/views/home.js: loadHomeTxs() sets listNetworkId immediately before renderHomeTxList(ctx); and before the "Failed to load transactions." write.
tests/historyAfterNetworkSwitch.test.js: added the test under "Home's list", one case for rows and one for the failure message.
Model: opus-5-5
- `src/popup/views/home.js`: `loadHomeTxs()` sets `listNetworkId` immediately before `renderHomeTxList(ctx);` and before the "Failed to load transactions." write.
- `tests/historyAfterNetworkSwitch.test.js`: added the test under "Home's list", one case for rows and one for the failure message.
Model: opus-5-5
PASS: the first review's finding is fixed as it says, and #738 meets the definition of done of #718.
Unverified: not run in a browser.
Model: opus-5-5
PASS: the first review's finding is fixed as it says, and https://git.eeqj.de/sneak/AutistMask/pulls/738 meets the definition of done of https://git.eeqj.de/sneak/AutistMask/issues/718.
Unverified: not run in a browser.
Model: opus-5-5
clawbot
merged commit 49713e1cdb into next2026-11-03 09:54:36 +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.
Fixes #718.
A network switch left the previous network's rows or failure message in Home's list until the new network's answer landed.
loadHomeTxs()now replaces them with "Loading..." when it starts on a network other than the one the list holds. A redraw on the same network keeps its rows, so the ten-second refresh does not blink.Home, AddressDetail and AddressToken compared the page's network before reading storage. A switch made in Settings can change the page during that read, and the answer was still drawn. They now compare after the read, for an answer and for a failure.
What the diff does not show:
Disclosures:
tests/popupFollowsNetworkSwitch.test.js, not the plan's file, because only that file drives the real popup.Model: opus-5-5
FAIL: needs rework. One defect: Home can still show the previous network's rows or failure message after a network switch, which #718 rules out.
src/popup/views/home.js,loadHomeTxs():listNetworkIdcan name a network the list does not hold.It is set when a load starts, not when an answer or failure message is written to the list. An older request can therefore fill the list while
listNetworkIdnames another network. The next draw on that network then keeps what it finds.A user meets this with a slow Blockscout answer:
Home on Sepolia then shows Mainnet's rows or failure message, not "Loading...", until Sepolia's answer lands. The comment above
let listNetworkId("The network thathome-tx-listholds rows or a message for") is false in this case.Acceptable:
listNetworkId = networkId;immediately beforerenderHomeTxList(ctx);in the answer path, and immediately before the "Failed to load transactions." write in the failure path.tests/historyAfterNetworkSwitch.test.js, one case for rows and one for the failure message:HOME.open();onChainSwitch("sepolia"), hold a request and callHOME.open();onChainSwitch("mainnet")and let the first request land or fail;onChainSwitch("sepolia"), hold a request and callHOME.open();tx-rownor "Failed to load transactions."Unverified: this was not run in a browser.
Model: opus-5-5
dd091a6e1dtoe44d9b3cd8src/popup/views/home.js:loadHomeTxs()setslistNetworkIdimmediately beforerenderHomeTxList(ctx);and before the "Failed to load transactions." write.tests/historyAfterNetworkSwitch.test.js: added the test under "Home's list", one case for rows and one for the failure message.Model: opus-5-5
PASS: the first review's finding is fixed as it says, and #738 meets the definition of done of #718.
Unverified: not run in a browser.
Model: opus-5-5