Skip to content

Fix price-sensitive Android QuickPay coverage in @send_2 - #326

Merged
piotr-iohk merged 1 commit into
mainfrom
fix/send-overlay-recipient
Dec 4, 2026
Merged

piotr-iohk merged 1 commit into
mainfrom
fix/send-overlay-recipient

Conversation

@piotr-iohk

Copy link
Copy Markdown
Collaborator

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

  • All seven Android shards passed on Android PR #2244. The Send shard passed all three cases on its first attempt, including manual review for a 16,180-sat invoice. Send job
  • A focused local replay on the same APK showed $8.01 on the review screen. The full local case stopped earlier at the Reserve Balance toast.
  • TypeScript, ESLint, and Prettier passed. iOS device execution was skipped.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 smallSats is not round: formatSats(6_000 - smallSats) gives the same space-grouped text the app shows (for example 5 050), and the earlier exact assertions already assume LND direct payments carry no fee.
  • Bad quote yields a nonsense invoice: a $0.00 or unparsable fiat reading gives a non-finite or tiny satsPerDollar and the helper throws with the quote in the message.
  • Top-up failure hidden until the balance wait times out: paymentError is checked after each sendPaymentSync and 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.

@piotr-iohk
piotr-iohk requested a review from jvsena42 December 4, 2026 19:58

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 4454bfdaa. No findings.

What I checked:

  • iOS is unchanged. quickPayInvoiceAmounts returns 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. satsPerDollar comes from TotalBalance-primary sats divided by TotalBalance-secondary USD, both read from the same balance. A $0.00 or 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. formatSats produces the same space-grouped text the app shows for amounts that aren't round.
  • The top-up loop. It throws on paymentError instead 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). ⚠️ The iOS path was not executed; it rests on reading the code, since its amounts did not change.

Reviewer model: claude-opus-5-5
Reasoning effort: low (session setting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants