fix: the ETH line reads unknown at an address no refresh has read (closes #736) #741

Merged
clawbot merged 1 commits from issue-736-unknown-eth-balance into next 2026-11-03 11:24:19 +01:00
Collaborator

An address's ETH balance is now null until a refresh has read that address. That covers a new address, a new wallet, addresses a wallet scan finds, and every address after a network switch.

  • The balance lists and AddressToken read quantity unknown.
  • Home's ETH balance reads unknown (ETH), the wording ConfirmTx uses. quantity unknown (SepoliaETH) would wrap at that font size.
  • Send reads Current balance: unknown (ETH), and "Max" flashes "This token's balance is unknown."
  • "Send" is refused only for a balance read as zero.
  • addressHoldsFunds() counts a null or missing balance as may hold funds.
  • From the review of #735: doRefreshAndRender() deletes balanceNotFetched only when it read every address in stored.wallets too, and README says "a refresh in the popup".

What the diff does not show:

  • Send's balance line is not drawn again when a refresh returns. It stays unknown until the screen reopens. "Max" reads the live balance.
  • While ETH is unknown, DeleteAddress says "This address may hold a balance." It says so even above a token's line, when a refresh read the token but not ETH.
  • If another popup page adds an address, this page never reads it. Its tracked tokens keep balanceNotFetched until it reopens.

Disclosures:

  • Deviation: the plan has the USD total treat null as a part it cannot count. Setting partial would print Total: unpriced tokens only at an empty new address. So getAddressValue() gives no total, as before the first price fetch.

Model: opus-5-5

An address's ETH balance is now `null` until a refresh has read that address. That covers a new address, a new wallet, addresses a wallet scan finds, and every address after a network switch. - The balance lists and AddressToken read `quantity unknown`. - Home's ETH balance reads `unknown (ETH)`, the wording ConfirmTx uses. `quantity unknown (SepoliaETH)` would wrap at that font size. - Send reads `Current balance: unknown (ETH)`, and "Max" flashes "This token's balance is unknown." - "Send" is refused only for a balance read as zero. - `addressHoldsFunds()` counts a `null` or missing `balance` as may hold funds. - From the review of https://git.eeqj.de/sneak/AutistMask/pulls/735: `doRefreshAndRender()` deletes `balanceNotFetched` only when it read every address in `stored.wallets` too, and README says "a refresh in the popup". What the diff does not show: - Send's balance line is not drawn again when a refresh returns. It stays `unknown` until the screen reopens. "Max" reads the live balance. - While ETH is unknown, DeleteAddress says "This address may hold a balance." It says so even above a token's line, when a refresh read the token but not ETH. - If another popup page adds an address, this page never reads it. Its tracked tokens keep `balanceNotFetched` until it reopens. Disclosures: - Deviation: the plan has the USD total treat `null` as a part it cannot count. Setting `partial` would print `Total: unpriced tokens only` at an empty new address. So `getAddressValue()` gives no total, as before the first price fetch. Model: opus-5-5
clawbot added the needs-review label 2026-11-03 10:25:57 +01:00
clawbot self-assigned this 2026-11-03 10:25:57 +01:00
Author
Collaborator

FAIL: needs-rework

Finding

  • src/shared/prices.js, comment above getAddressValue(), the usd: line. "or null when nothing is knowable at all — testnet, before the first fetch, or an ETH balance no refresh has read" is false for the third case. A refresh reads ETH and tokens separately, so an address whose ETH read failed can hold a token whose value is known, and usd is still null. Acceptable: change the words to "or null when no total can be stated — testnet, before the first fetch, or an ETH balance no refresh has read". No code change.

Follow-up notes, which do not fail the review

  • src/popup/views/deleteAddress.js: at an address no refresh has read, the screen states "This address holds a balance." as fact, even when the address is empty, and is not redrawn when the refresh returns. The plan keeps the warning. A later change could say "This address may hold a balance." in this case.
  • src/popup/views/send.js: Send now opens at an unread address, and its line stays unknown after a refresh has read the balance, until the screen reopens. A later change could draw the line again when a refresh returns.
  • src/popup/views/helpers.js, addressHoldsFunds(): it tests === null where the other readers test == null, so a stored address with no balance field reads as unknown but gets no warning. Use == null.
  • tests/deleteAddress.test.js: the new test sits between the comment "The sentence must not assert an amount" and the test that comment describes. Move the new test above the comment.

Model: opus-5-5

**FAIL**: `needs-rework` **Finding** - `src/shared/prices.js`, comment above `getAddressValue()`, the `usd:` line. "or null when nothing is knowable at all — testnet, before the first fetch, or an ETH balance no refresh has read" is false for the third case. A refresh reads ETH and tokens separately, so an address whose ETH read failed can hold a token whose value is known, and `usd` is still `null`. Acceptable: change the words to "or null when no total can be stated — testnet, before the first fetch, or an ETH balance no refresh has read". No code change. **Follow-up notes, which do not fail the review** - `src/popup/views/deleteAddress.js`: at an address no refresh has read, the screen states "This address holds a balance." as fact, even when the address is empty, and is not redrawn when the refresh returns. The plan keeps the warning. A later change could say "This address may hold a balance." in this case. - `src/popup/views/send.js`: Send now opens at an unread address, and its line stays `unknown` after a refresh has read the balance, until the screen reopens. A later change could draw the line again when a refresh returns. - `src/popup/views/helpers.js`, `addressHoldsFunds()`: it tests `=== null` where the other readers test `== null`, so a stored address with no `balance` field reads as unknown but gets no warning. Use `== null`. - `tests/deleteAddress.test.js`: the new test sits between the comment "The sentence must not assert an amount" and the test that comment describes. Move the new test above the comment. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-03 10:41:46 +01:00
clawbot added 1 commit 2026-11-03 10:46:57 +01:00
fix: the ETH line reads unknown at an address no refresh has read (closes #736)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
617bd91688
An address's ETH balance is now null until a refresh has read it. That covers
a new address, a new wallet, addresses a wallet scan finds, and every address
after a network switch.

Its line reads `quantity unknown`, Home's balance `unknown (ETH)`, and Send
`Current balance: unknown (ETH)`. Max says the balance is unknown. Send is no
longer refused as zero. The address has no total, and DeleteAddress warns that
it may hold a balance.

A refresh also deletes `balanceNotFetched` only when it read every address in
the stored record.

Model: opus-5-5
clawbot force-pushed issue-736-unknown-eth-balance from 11c9481556 to 617bd91688 2026-11-03 10:46:57 +01:00 Compare
Author
Collaborator
  • src/shared/prices.js: the usd: comment now says "no total can be stated".
  • src/popup/views/deleteAddress.js: says "This address may hold a balance." at an address no refresh has read, with README's sentence on that screen.
  • src/popup/views/helpers.js: addressHoldsFunds() tests == null, so the old test that an address with no balance holds nothing now expects a warning.
  • tests/deleteAddress.test.js: the new test sits above the comment.
  • PR body: the DeleteAddress line now says what the screen says.

Model: opus-5-5

- `src/shared/prices.js`: the `usd:` comment now says "no total can be stated". - `src/popup/views/deleteAddress.js`: says "This address may hold a balance." at an address no refresh has read, with README's sentence on that screen. - `src/popup/views/helpers.js`: `addressHoldsFunds()` tests `== null`, so the old test that an address with no `balance` holds nothing now expects a warning. - `tests/deleteAddress.test.js`: the new test sits above the comment. - PR body: the DeleteAddress line now says what the screen says. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-03 10:57:54 +01:00
Author
Collaborator

PASS: #741 meets the definition of done of #736, and the first review's finding and the follow-up notes asked for are done.

Follow-up notes, which do not fail the review

  • README.md, the list under "An address's ETH balance is null": the Send line holds only while ETH is selected, because a selected token shows its own balance and "Max" fills it in. I read the list as being about ETH, so I did not fail it. A later change could start the line "With ETH selected, Send reads".
  • src/popup/views/deleteAddress.js, the comment above balanceWarningHtml(): its cases for no total leave out an ETH balance no refresh has read. A later change could add it after "on testnet or before the first price fetch".

Model: opus-5-5

**PASS**: https://git.eeqj.de/sneak/AutistMask/pulls/741 meets the definition of done of https://git.eeqj.de/sneak/AutistMask/issues/736, and the first review's finding and the follow-up notes asked for are done. **Follow-up notes, which do not fail the review** - `README.md`, the list under "An address's ETH balance is `null`": the Send line holds only while ETH is selected, because a selected token shows its own balance and "Max" fills it in. I read the list as being about ETH, so I did not fail it. A later change could start the line "With ETH selected, Send reads". - `src/popup/views/deleteAddress.js`, the comment above `balanceWarningHtml()`: its cases for no total leave out an ETH balance no refresh has read. A later change could add it after "on testnet or before the first price fetch". Model: opus-5-5
clawbot merged commit 9c691dfa6b into next 2026-11-03 11:24:19 +01:00
clawbot deleted branch issue-736-unknown-eth-balance 2026-11-03 11:24:19 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#741