Cause. Reproduced by reloading the popup repeatedly mid-refresh. Chrome fires pagehide on the old page, then cancels its open requests. In the page a cancelled fetch() rejects with the same TypeError: Failed to fetch as an unreachable server, so loadHomeTxs, fetchTokenBalances and, less often, the ETH balance and ENS name lookups each logged it with console.error, which the harness counts as a failure.
Fix.src/popup/index.js aborts an AbortController on pagehide. Its signal reaches loadHomeTxs (as ctx.pageClosed) and refreshBalances(), and each failure report checks signal.aborted first. Nothing looks at the message, so a real failure is still reported. The background worker passes no signal and logs as before.
Tests.
e2e: reloads the popup twice with Blockscout held (holdBlockscout), so the transaction list and token balances are in flight at the second reload; any console.error fails it. Against the unfixed code it logs all four errors.
e2e: the transaction list fails as a network error (failTransactionList); the test declares loadHomeTxs failed: Failed to fetch and Chrome's own report of the failed request.
tests/balanceRefreshCancelled.test.js: the balance refresh logs these failures while the signal is live, not once it is aborted.
awaitRelease() in tests/e2e/network.js now takes the switch name.
Not covered, same cause: the address and token screens and the new-wallet address scan, #475. The new e2e tests sit after the transaction detail tests so that scan has finished.
Judgement call: the real-failure test waits for the ten-second refresh, because a reload draws the list more than once.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/AutistMask/issues/218.
**Cause.** Reproduced by reloading the popup repeatedly mid-refresh. Chrome fires `pagehide` on the old page, then cancels its open requests. In the page a cancelled `fetch()` rejects with the same `TypeError: Failed to fetch` as an unreachable server, so `loadHomeTxs`, `fetchTokenBalances` and, less often, the ETH balance and ENS name lookups each logged it with `console.error`, which the harness counts as a failure.
**Fix.** `src/popup/index.js` aborts an `AbortController` on `pagehide`. Its signal reaches `loadHomeTxs` (as `ctx.pageClosed`) and `refreshBalances()`, and each failure report checks `signal.aborted` first. Nothing looks at the message, so a real failure is still reported. The background worker passes no signal and logs as before.
**Tests.**
- e2e: reloads the popup twice with Blockscout held (`holdBlockscout`), so the transaction list and token balances are in flight at the second reload; any `console.error` fails it. Against the unfixed code it logs all four errors.
- e2e: the transaction list fails as a network error (`failTransactionList`); the test declares `loadHomeTxs failed: Failed to fetch` and Chrome's own report of the failed request.
- `tests/balanceRefreshCancelled.test.js`: the balance refresh logs these failures while the signal is live, not once it is aborted.
`awaitRelease()` in `tests/e2e/network.js` now takes the switch name.
- Not covered, same cause: the address and token screens and the new-wallet address scan, https://git.eeqj.de/sneak/AutistMask/issues/475. The new e2e tests sit after the transaction detail tests so that scan has finished.
- Judgement call: the real-failure test waits for the ten-second refresh, because a reload draws the list more than once.
Model: opus-5-5
clawbot
self-assigned this 2026-10-06 07:57:22 +02:00
Chrome cancels a closing popup's open requests just after pagehide, and in
the page a cancelled fetch() fails with the same "Failed to fetch" as a
server that cannot be reached. The home screen's transaction list and the
balance refresh logged an error for each, and the e2e suite failed on them.
The popup now aborts an AbortController on pagehide, and those failure
reports check its signal first. End-to-end tests reload the popup with
Blockscout held and require nothing logged, and fail the transaction list
for real and require the failure reported; a unit test covers the balance
refresh. The address and token screens and the new-wallet address scan are
#475.
Model: opus-5-5
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.
Closes #218.
Cause. Reproduced by reloading the popup repeatedly mid-refresh. Chrome fires
pagehideon the old page, then cancels its open requests. In the page a cancelledfetch()rejects with the sameTypeError: Failed to fetchas an unreachable server, soloadHomeTxs,fetchTokenBalancesand, less often, the ETH balance and ENS name lookups each logged it withconsole.error, which the harness counts as a failure.Fix.
src/popup/index.jsaborts anAbortControlleronpagehide. Its signal reachesloadHomeTxs(asctx.pageClosed) andrefreshBalances(), and each failure report checkssignal.abortedfirst. Nothing looks at the message, so a real failure is still reported. The background worker passes no signal and logs as before.Tests.
holdBlockscout), so the transaction list and token balances are in flight at the second reload; anyconsole.errorfails it. Against the unfixed code it logs all four errors.failTransactionList); the test declaresloadHomeTxs failed: Failed to fetchand Chrome's own report of the failed request.tests/balanceRefreshCancelled.test.js: the balance refresh logs these failures while the signal is live, not once it is aborted.awaitRelease()intests/e2e/network.jsnow takes the switch name.Model: opus-5-5
PASS
Model: opus-5-5