An address just added shows every tracked token as 0.0000 until a refresh returns #720

Closed
opened 2026-11-03 01:32:51 +01:00 by clawbot · 1 comment
Collaborator

Where

The balance lists on Home, AddressDetail and DeleteAddress, for an address just added with "+" (src/popup/views/home.js, balanceLinesForAddress() in src/popup/views/helpers.js).

What happens

Found by the review of #664, and the same on next. A new address starts with no balance entries. While "Show tracked tokens with zero balance" is on, every tracked token reads 0.0000 at that address until a refresh returns, though no refresh has read it. Read from the code; not run in a browser.

What should happen

README's balance rules say an amount that is really there is never printed as 0.0000. A tracked token's line at an address no refresh has read does not state zero.

Severity: minor

Definition of done

  • Until a refresh has read a new address, its tracked tokens' lines read quantity unknown, or are left out.
  • A Jest test, failing on next.

Model: opus-5-5

## Where The balance lists on Home, AddressDetail and DeleteAddress, for an address just added with "+" (`src/popup/views/home.js`, `balanceLinesForAddress()` in `src/popup/views/helpers.js`). ## What happens Found by the review of https://git.eeqj.de/sneak/AutistMask/pulls/664, and the same on `next`. A new address starts with no balance entries. While "Show tracked tokens with zero balance" is on, every tracked token reads `0.0000` at that address until a refresh returns, though no refresh has read it. Read from the code; not run in a browser. ## What should happen README's balance rules say an amount that is really there is never printed as `0.0000`. A tracked token's line at an address no refresh has read does not state zero. Severity: minor ## Definition of done - [ ] Until a refresh has read a new address, its tracked tokens' lines read `quantity unknown`, or are left out. - [ ] A Jest test, failing on `next`. Model: opus-5-5
clawbot self-assigned this 2026-11-03 01:32:51 +01:00
Author
Collaborator

Plan: one PR to next, after #719, which changes the same line. It also covers what the review of #664 noted: after a network switch, every tracked token reads 0.0000 until the first refresh returns.

The mark that #664 added, balanceNotFetched, already says this, and a refresh already clears it. So:

  • applyChainSwitchFields() sets it on each token of the incoming network's list.
  • When an address or a wallet is added (home.js, addWallet.js), each token in trackedTokens gets it, through one small function beside trackToken() in src/popup/views/helpers.js.
  • The comment inside updateSendBalance() in src/popup/views/send.js stops saying a null balance only means an unknown scale.

Tests in tests/addedTokenBalance.test.js, each failing on next: a new address, a new wallet, and a network switch each read quantity unknown until a refresh has read the balance.

Model: opus-5-5

Plan: one PR to `next`, after https://git.eeqj.de/sneak/AutistMask/issues/719, which changes the same line. It also covers what the review of https://git.eeqj.de/sneak/AutistMask/pulls/664 noted: after a network switch, every tracked token reads `0.0000` until the first refresh returns. The mark that https://git.eeqj.de/sneak/AutistMask/pulls/664 added, `balanceNotFetched`, already says this, and a refresh already clears it. So: - `applyChainSwitchFields()` sets it on each token of the incoming network's list. - When an address or a wallet is added (`home.js`, `addWallet.js`), each token in `trackedTokens` gets it, through one small function beside `trackToken()` in `src/popup/views/helpers.js`. - The comment inside `updateSendBalance()` in `src/popup/views/send.js` stops saying a null balance only means an unknown scale. Tests in `tests/addedTokenBalance.test.js`, each failing on `next`: a new address, a new wallet, and a network switch each read `quantity unknown` until a refresh has read the balance. 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#720