fix: say an unknown-scale balance the same way on Send and on confirm #425

Merged
clawbot merged 1 commits from issue-377-unknown-scale-send into next 2026-10-04 15:59:16 +02:00
Collaborator

Fixes #377.

When two addresses' explorer reports disagree on a token's decimals, the Send screen showed the stored figure (Current balance: 5.0000 NOVEL) while the confirmation screen it leads to said unknown (NOVEL). A new function in src/popup/views/send.js, tokenBalanceAndDecimals(), now gives both the Send screen's balance line and the Review handler the balance and scale, so both screens read unknown (NOVEL), the wording the confirmation screen already used. The handler's comments moved into it.

The fee-unknown message names its cause. With no scale, estimateGas() cannot encode the transfer, so the message says the wallet does not know how many decimal places the token uses and that the transaction cannot be sent, with no retry. Any other cause keeps the old sentence.

Not visible in the diff:

  • The message text moved out of index.html into show() in confirmTx.js, because it now depends on the pending transaction. It is set before the first paint, so nothing moves.
  • Against next, the new test fails on the Send line, which reads Current balance: 5.0000 NOVEL.

Disclosures:

  • Judgement call: the balance list and the token's own screen still show the row's figure for this holding, since they format each row at fetch time without the cross-address check. The README now says so.
  • Judgement call: the fee message says "this wallet does not know" rather than reusing "nothing this wallet can consult reports", which is untrue when the reports exist but disagree.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/377. When two addresses' explorer reports disagree on a token's `decimals`, the Send screen showed the stored figure (`Current balance: 5.0000 NOVEL`) while the confirmation screen it leads to said `unknown (NOVEL)`. A new function in `src/popup/views/send.js`, `tokenBalanceAndDecimals()`, now gives both the Send screen's balance line and the Review handler the balance and scale, so both screens read `unknown (NOVEL)`, the wording the confirmation screen already used. The handler's comments moved into it. The fee-unknown message names its cause. With no scale, `estimateGas()` cannot encode the transfer, so the message says the wallet does not know how many decimal places the token uses and that the transaction cannot be sent, with no retry. Any other cause keeps the old sentence. Not visible in the diff: - The message text moved out of `index.html` into `show()` in `confirmTx.js`, because it now depends on the pending transaction. It is set before the first paint, so nothing moves. - Against `next`, the new test fails on the Send line, which reads `Current balance: 5.0000 NOVEL`. Disclosures: - Judgement call: the balance list and the token's own screen still show the row's figure for this holding, since they format each row at fetch time without the cross-address check. The README now says so. - Judgement call: the fee message says "this wallet does not know" rather than reusing "nothing this wallet can consult reports", which is untrue when the reports exist but disagree. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 12:44:22 +02:00
clawbot self-assigned this 2026-10-04 12:44:22 +02:00
Author
Collaborator

FAIL

  1. The branch conflicts with next in TODO.md. next added three entries at the top of Completed Steps (#283, #426, #297) in the place where this PR adds its entry (line 48 on the rebased tree). Acceptable: rebase onto the current next and keep every entry.

Not run: the browser e2e suites.

Model: opus-5-5

FAIL 1. The branch conflicts with `next` in `TODO.md`. `next` added three entries at the top of Completed Steps (https://git.eeqj.de/sneak/AutistMask/issues/283, https://git.eeqj.de/sneak/AutistMask/issues/426, https://git.eeqj.de/sneak/AutistMask/issues/297) in the place where this PR adds its entry (line 48 on the rebased tree). Acceptable: rebase onto the current `next` and keep every entry. Not run: the browser e2e suites. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-04 15:21:11 +02:00
clawbot added 1 commit 2026-10-04 15:28:55 +02:00
fix: say an unknown-scale balance the same way on Send and on confirm (closes #377)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
93cc072a0b
When two addresses' explorer reports disagree on a token's decimals, the
Send screen showed the stored figure while the confirmation screen said
the balance was unknown. One function in send.js now gives both the
balance and scale, so both read `unknown (SYMBOL)`.

The confirmation screen's fee-unknown message names its cause: for an
unknown scale it says the wallet does not know the token's decimal
places and the transaction cannot be sent, instead of asking for a
retry that cannot help. Other causes keep the old sentence.

Model: opus-5-5
clawbot force-pushed issue-377-unknown-scale-send from 8741f491e9 to 93cc072a0b 2026-10-04 15:28:55 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-04 15:28:59 +02:00
Author
Collaborator

Rebased onto a68f30c; only TODO.md conflicted (both sides added Completed Steps entries), resolved by keeping every entry with this PR's on top; nothing else changed.

Model: opus-5-5

Rebased onto `a68f30c`; only `TODO.md` conflicted (both sides added Completed Steps entries), resolved by keeping every entry with this PR's on top; nothing else changed. Model: opus-5-5
Author
Collaborator

PASS

Model: opus-5-5

PASS Model: opus-5-5
clawbot merged commit 45f11ee920 into next 2026-10-04 15:59:16 +02:00
clawbot deleted branch issue-377-unknown-scale-send 2026-10-04 15:59:18 +02: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#425