Repository navigation
fix: validate minimum paykit request amounts - #1457
ben-kaufman wants to merge 1 commit into
Conversation
|
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Rejects incoming on-chain Paykit requests of 546 sats or less with the existing Amount Too Low toast before the balance check, so a funded wallet no longer sees "0 more needed". Reviewed 43a184e, light tier (one 11-line change in AppViewModel.onScanOnchain).
What I checked, and 4 candidates I ruled out
Read: the commit's diff, onScanOnchain around the new guard, validateAmount, Env.dustLimit (546), the five new tests in AppViewModelSendFlowTest.kt, the journey and README rows.
CI at review time: lint, detekt, build-local and Greptile green; build and the local e2e shards still running. This review is reasoned from the code and CI; the branch was not built here.
Ruled out
- Off by one:
amount <= dustLimitwithdustLimit = 546rejects 546 and accepts 547, matching the> dustLimitrule invalidateAmountand the 547 shown in the toast. The boundary test covers both sides. - Rejecting a payable Lightning request: the guard runs only once
payMethodisONCHAIN, after the unified fallback, andsmall incoming unified request remains payable over Lightningcovers that path. - Hardware funding source: a hardware wallet forces
ONCHAINand the guard runs beforeselectHardwareFundingSourceForAmount, so dust never reaches the hardware send path. - Request lost or auto-reopening:
clearActiveContactPaymentContext(retryIncomingRequest = false)is the same cleanup the shortfall branch uses. The test keeps the request pending and shows that manual Pay retries it while a new 547-sat request still opens.
Merge confidence: 4/5, no findings and the change has tests, but build and e2e had not finished at review time.
There was a problem hiding this comment.
Suggestion: 👍 Approve
Review: diff 6 files.
Twin: synonymdev/bitkit-ios#913 identical at commit
QA:
Tests queued.
Reviewed by gpt-6.1-sol-high via gh-pr-review-loop skill
Commands: @ovi-reviewer review · test · retest
There was a problem hiding this comment.
Suggestion: 👍 Approve
Interim test report for the review; the rest resumes on its own.
QA:
🟠 Test J1
Test J1
Incomplete: The lane disconnected during app launch and UI inspection.
Reviewed by gpt-6.1-sol-high via gh-pr-review-loop skill
Commands: @ovi-reviewer review · test · retest
This PR fixes misleading balance feedback for on-chain Paykit requests below 547 sats.
Description
Out of Scope
Design
N/A — no design available. Reuses the existing minimum-invoice toast.
Preview
QA Notes
Journeys
minimum-onchain-amount.xml— 100 and 546 sats show the 547-sat minimum, preparation closes, unpaid requests remain retryable, and 547 sats reaches confirmation.Manual Tests
N/A
Automated Checks
AppViewModelSendFlowTest.kt— five regressions cover below-minimum feedback, delayed preparation cleanup and retry, the payable boundary, genuine balance shortfall, and a small valid Lightning alternative.minimum-onchain-amount.xmlon an API 36 regtest emulator with a disposable staging issuer — minimum feedback and manual retry verified; a prepared 547-sat confirmation was dismissed without paying.