Repository navigation
Fix price-sensitive Android QuickPay coverage in @send_2 - #326
Conversation
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Sizes the Android QuickPay invoices in @send_2 from the wallet's own USD quote (at most $1 for the two auto-paid invoices, $8 for the one that must stop at review), tops up spending in 10,000-sat steps until the review invoice plus 2,000 sats fits, and asserts the review screen shows that amount and more than $5. Reviewed 4454bfd, full tier, static.
What I checked, and 5 candidates I ruled out
Read in full: test/specs/send.e2e.ts at the head; formatSats in test/helpers/actions.ts.
Build: skipped. The PR's code was not run here (talos-pr-run could not confirm the author's permission and fails closed), so typecheck, lint and Prettier rest on the PR body.
CI: this repo reports no checks for the branch. The bitkit-android run named in the body (run 47394823192, attempt 2, branch fix/send-overlay-recipient) is green on all seven local shards; its Send job started 43 s after this head was committed.
Ruled out
- iOS gets an extra top-up: iOS keeps 1,000 / 10,000, so spending goes 4,000 to 14,000 and the loop stops there (14,000 is not below 12,000). One top-up, as before.
- Spending text drifts when
smallSatsis not round:formatSats(6_000 - smallSats)gives the same space-grouped text the app shows (for example5 050), and the earlier exact assertions already assume LND direct payments carry no fee. - Bad quote yields a nonsense invoice: a
$0.00or unparsable fiat reading gives a non-finite or tinysatsPerDollarand the helper throws with the quote in the message. - Top-up failure hidden until the balance wait times out:
paymentErroris checked after eachsendPaymentSyncand throws at once. - Funding loop outgrows the channel: at the run's quote (about 2,000 sats per dollar) it needs two top-ups. A quote three times higher needs about four, still far under the 100,000-sat channel.
Merge confidence: 5/5. No findings, the file was read whole, and the green Android Send shard covers the change. The iOS path keeps its old amounts.
jvsena42
left a comment
There was a problem hiding this comment.
Approving at 4454bfdaa. No findings.
What I checked:
- iOS is unchanged.
quickPayInvoiceAmountsreturns 1,000 / 10,000 before reading anything. Spending goes 6,000 → 5,000 → 4,000, and the loop runs one top-up to 14,000 (14,000 ≥ 10,000 + 2,000). That is the same path and the same asserted texts as before. - The Android quote.
satsPerDollarcomes fromTotalBalance-primarysats divided byTotalBalance-secondaryUSD, both read from the same balance. A$0.00or non-numeric reading throws, and the error carries the quote. - The amounts. Each automatic payment is at most $1 and the review invoice is $8, so a quote refresh in either direction stays clear of the $5 limit.
formatSatsproduces the same space-grouped text the app shows for amounts that aren't round. - The top-up loop. It throws on
paymentErrorinstead of timing out at the balance wait. At about 2,000 sats per dollar it needs two 10,000-sat top-ups, well inside the 100,000-sat channel. - The activity checks after the review invoice only require at least 3 rows, so extra top-ups don't break them.
Device gate: no device check needed. This is a test-only change. The Android Send shard passed on synonymdev/bitkit-android#2244 (run 47394823192).
Reviewer model: claude-opus-5-5
Reasoning effort: low (session setting)
Android QuickPay automatically pays invoices below its $5 USD limit. In the failed Send job, the 10,000-sat invoice was worth $4.98–$4.99, so the test timed out waiting for manual review.
Use the wallet’s displayed USD conversion to size both automatic payments and an $8 review invoice. Fund the regtest wallet in 10,000-sat increments to leave room for the channel reserve and fees. With QuickPay enabled, assert that the review screen shows the invoice amount in sats and a USD value above $5. The iOS case keeps its existing invoice amounts.
Verification