Repository navigation
Conversation
Hide the sync overlay on the recipient steps, so a Lightning invoice Spark can pay is decoded without waiting for the node, and let Spark take an amountless invoice's amount. Refs synonymdev/bitkit-android#2032 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spark can pay before the node runs, so the deferred validation on node start skips a send that already reached a pending or result route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Spark payment can be submitted before the node runs, and its balance then no longer covers it, so the overlay came back over the pending or result screen. Skip it on the routes after submission. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QuickPay pays as soon as it shows, so it must still wait for the node when Spark can't cover the payment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Placed in 3.2.0 for RC4: Send blocking Spark-payable invoices until the node runs (synonymdev/bitkit-android#2032 comment) was agreed into RC4 in the release thread, with its Android twin synonymdev/bitkit-android#2244. This PR closes no issue, so it carries the milestone. |
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryLets users choose recipients and review Spark-payable invoices before the Lightning node runs.
No new actionable issues found. The earlier submitted-payment finding is fixed. Device journeys and iOS tests were not run during this review. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Choose recipient] --> B{Spark can pay?}
B -->|Yes| C[Review or QuickPay]
B -->|No| D[Wait for node and check funds]
D -->|Lightning can pay| C
D -->|Unified invoice needs Savings| E[Replace QuickPay with Amount]
C --> F[Submit payment]
F --> G[Keep payment result unchanged]
Reviews (4) · Last reviewed commit: "fix: refresh QuickPay retry readiness an..." · Reviewed by Greptile |
| // Spark can pay before the node runs, so a send may already be paying or settled when it starts | ||
| guard !flow.didFinish, !flow.isSubmittingPayment, !PaykitPaymentActivity.shared.isActive, | ||
| !Self.isPastReview(flow.navigationPath.last ?? currentRoot) else { return } |
There was a problem hiding this comment.
The new guard protects only the node-start callback. The hasUsableChannels callback still calls validatePaymentAfterSync() during or after submission. If Spark pays before startup and a small channel reconnects afterward, hasValidatedAfterSync can still be false while the remaining Spark balance no longer covers the invoice. Validation then dismisses the paid send as insufficient, or moves a unified invoice back to .amount.
Apply these guards to both callbacks, or put them in the shared validation entry point.
Knowledge Base Used:
There was a problem hiding this comment.
Fixed in 0083a2c. The hasUsableChannels callback now uses the same hasSubmittedPayment guard as the node-start callback (didFinish, isSubmittingPayment, Paykit activity, or a route past submission, with QuickPay counted only once it started), so channels becoming usable after a Spark payment no longer revalidate it.
Not device-verified: it needs a wallet with a channel and Spark funds, and the local regtest stack has no channel set up for this run. Leaving this thread open. Not twinned: Android has no usable-channels revalidation after submission.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict: ⛔️ Request changes
The PR moved to 2ef665b after this run; these results are for 88fe44e.
Findings:
- MEDIUM — QuickPay skips Savings fallback before submission —
Bitkit/Views/Wallets/Send/SendSheet.swift:631..quickpaycounts as past review while the sync screen still prevents it from submitting. For a unified invoice opened with the node down, no channels, insufficient Spark and enough Savings, startup skips deferred validation and QuickPay attempts the unfunded Lightning leg. Device-confirmed: a 20000-sat invoice failed withRouteNotFounddespite 100000 sats in Savings; the same invoice reached Savings Amount with QuickPay disabled. Keep deferred validation until QuickPay actually starts. This adds device evidence to the existing finding.
QA for 88fe44e:
Tested on iPhone 17 Pro simulator, iOS 27.0, using regtest funds. These recordings use 88fe44e plus the startup hold shown below; playback is 2×.
Pay a fixed invoice through Spark before the node starts ✅ Review and Payment Pending stayed clear; settlement before startup was verified in Breez Spark’s stored payment history.
The 1000-sat payment was completed with a 6-sat fee before the hold was released. The recording shows Bitcoin Sent after startup was released; it does not claim that success UI appeared while held.
fixed-node-down-2x.2x.mp4
Pay an amountless invoice through Spark before the node starts ⏭️ Not driven before the head moved.
The run stopped after its current case when the PR moved to 2ef665b.
Clear the on-chain overlay when the node starts ✅ The connection overlay cleared to Savings Amount after explicit startup release.
onchain-node-start-2x.2x.mp4
Send Lightning with the node running ⏭️ Not driven before the head moved.
The run stopped after its current case when the PR moved to 2ef665b.
Fall back from QuickPay to Savings after node startup ❌ QuickPay attempted Lightning and showed Payment Failed instead of Savings Amount.
Both runs used the same unified 20000-sat invoice, no channels, insufficient Spark, and 100000 sats in Savings. The device log records node startup followed by RouteNotFound. The control video ends during startup; its final state was checked in the accessibility snapshot: Amount, SAVINGS (AssetButton-savings), 20 000, available 99 888, and enabled ContinueAmount.
| QuickPay enabled: failure | QuickPay disabled: startup |
|---|---|
quickpay-fallback-failure-2x.2x.mp4 |
unified-quickpay-off-2x.2x.mp4 |
Test hook used by the recorded cases
Not pushed. Holds node startup before setup while Breez Spark starts normally, then waits for explicit release. It does not change payment routing or simulate a payment result. Because the hold precedes event-handler setup, fixed-invoice settlement was checked in Breez Spark’s stored history before release.
diff --git a/Bitkit/ViewModels/WalletViewModel.swift b/Bitkit/ViewModels/WalletViewModel.swift
index 723823c93..2ad4854fe 100644
--- a/Bitkit/ViewModels/WalletViewModel.swift
+++ b/Bitkit/ViewModels/WalletViewModel.swift
@@ -311,6 +311,16 @@ class WalletViewModel: ObservableObject {
syncState()
// Spark needs no node, so it starts alongside it and keeps running while the node stops.
Task { await SparkManager.shared.start(walletIndex: walletIndex) }
+ #if DEBUG // test hook
+ let reviewHold = Env.appStorageUrl.appendingPathComponent("revd-hold-node") // test hook
+ if FileManager.default.fileExists(atPath: reviewHold.path) { // test hook
+ Logger.info("REVD: node startup held before setup", context: "ReviewHook") // test hook
+ while FileManager.default.fileExists(atPath: reviewHold.path) { // test hook
+ try await Task.sleep(nanoseconds: 100_000_000) // test hook
+ } // test hook
+ Logger.info("REVD: node startup explicitly released", context: "ReviewHook") // test hook
+ } // test hook
+ #endif // test hook
do {
let electrumServerUrl = electrumConfigService.getCurrentServer().fullUrl
let rgsServerUrl = rgsConfigService.getCurrentServerUrl()Deciding observations:
Fixed invoice, before release: payment_type=send status=completed amount=1000 fees=6 method=lightning
QuickPay enabled: node startup held → explicitly released → Node started → Failed to send payment: RouteNotFound
QuickPay disabled: startup release → Savings Amount, 20000 sats
Recipient-screen coverage relies on the author’s exact-head evidence, rather than repeating those cases. Amountless entry/review evidence there does not establish completion; that case remains unrun here.
Coverage: full 63f39dc8..88fe44e, including the send helpers, their callers and tests. The helper tests and changelog received code review; no separate device case applies to those files. This report does not assess the newer 2ef665b head.
Twin: synonymdev/bitkit-android#2244 matches the recipient, amountless and submitted-payment overlay intent; the iOS QuickPay startup path above breaks Savings fallback.
Reviewed by gpt-6.1-sol-high
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict:
Findings: Not assessed. The delta from 88fe44e to ae9bead was deferred because this PR is a draft; the repository’s reviewer rules require waiting until it is ready for review. The previous finding has not been reverified.
QA for ae9bead: No build, unit tests or device cases ran. No earlier result is presented as validation of this head.
Twin: synonymdev/bitkit-android#2244; parity was not reassessed in this deferred run.
Reviewed by gpt-6.1-sol-high
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict:
Findings: Not assessed. The delta from ae9bead to 8f11931 was deferred because this PR is still a draft; the repository’s reviewer rules require waiting until it is ready for review. The previous findings have not been reverified.
QA for 8f11931: No build, unit tests or device cases ran. No earlier result is presented as validation of this head.
Twin: synonymdev/bitkit-android#2244; parity was not reassessed in this deferred run.
Reviewed by gpt-6.1-sol-high
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict:
Findings: Not assessed. The delta from 8f11931 to f711daa was deferred because this PR is still a draft; the repository’s reviewer rules require waiting until it is ready for review. The previous findings have not been reverified.
QA for f711daa: No build, unit tests or device cases ran. Manual cases 1–5 and the prior review’s follow-up cases were not driven because the review was deferred. No earlier result is presented as validation of this head.
Twin: synonymdev/bitkit-android#2244; parity was not reassessed in this deferred run.
Reviewed by gpt-6.1-sol-high
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict:
Findings: Not assessed. The delta from f711daa to 384ce62 was deferred because this PR is still a draft; the repository’s reviewer rules require waiting until it is ready for review. The previous findings have not been reverified.
QA for 384ce62: No build, unit tests or device cases ran. Manual cases 1–5 and the prior review’s follow-up cases were not driven because the review was deferred. No earlier result is presented as validation of this head.
Twin: synonymdev/bitkit-android#2244; parity was not reassessed in this deferred run.
Reviewed by gpt-6.1-sol-high
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict:
Findings: Not assessed. The delta from 384ce62 to d547026 was deferred because this PR is still a draft; the repository’s reviewer rules require waiting until it is ready for review. The previous findings have not been reverified.
QA for d547026: No build, unit tests or device cases ran. Manual cases 1–5 and the prior review’s follow-up cases were not driven because the review was deferred. No earlier result is presented as validation of this head.
Twin: synonymdev/bitkit-android#2244; parity was not reassessed in this deferred run.
Reviewed by gpt-6.1-sol-high
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: follow-up on iOS #1578 from 88fe44ed to d547026b. The verified baseline supplies unchanged recipient-step, amountless-invoice predicate, and changelog coverage.
3 actionable findings — resolve or provide an evidence-backed rebuttal.
Focused Swift checks using the pinned helper implementations confirmed that a Quick Pay retry can inherit the original attempt's hold and that a Spark-only refresh can preserve an inflated Spending limit on upgrade. The iOS app suite was unrun locally. The matching unit-test run was still in progress at the final check. The PR description contains earlier fix notes alongside the manual checklist. The checklist informed the runtime plan, and findings were verified against pinned source.
Compared recipient and amount entry, Quick Pay gating, and cancellation at Android #2244, 37f8ec48. Android cancels a typed invoice's node wait when leaving the address step and uses live Spark capacity for amountless entry while the node is down. The Appium source at 9a64fa31 checks the Spark recipient amount and normal Quick Pay success, with no assertion for a cold-start Quick Pay retry.
Device testing was not performed in this review. The runtime plan retains all five author cases.
Suggested additional test cases
- On iOS with funded Spark and a channel that can reconnect, start a Lightning-only Quick Pay while the node is starting. Let Spark release the hold, make the first attempt fail, then bring the channel online with insufficient Spark balance for the retry. Tap Try Again and verify that the ready channel can be used without a connection timeout.
- On iOS, upgrade a wallet with no channels and a cached Spending limit. While node balances are unavailable, let a Spark credit raise the limit, then spend part of the balance and open another amountless invoice. Verify that Available and the amount cap fall with the current Spark capacity.
Earlier findings reconciled at this revision: 3 verified fixed.
Findings
-
[MEDIUM] Release Quick Pay retries once the channel is ready — inline at
Bitkit/Views/Wallets/Send/SendSheet.swift:514. -
[MEDIUM] Keep Spark refreshes from inflating the legacy Spending limit — inline at
Bitkit/ViewModels/WalletViewModel.swift:1485. -
[LOW] Move the connecting journey's overlay check to Amount — With the node starting, the iOS on-chain connecting journey still expects the sync overlay immediately after opening Send. The pinned recipient guard would show the recipient screen instead, causing the journey to fail on the intended behavior. Update it to assert that the recipient screen is available, enter a valid on-chain address, then assert that the Bitcoin overlay appears on Amount and clears when the node runs. Source analysis agrees with author cases 1 and 4.
Source. Summary placement: The obsolete assertion is in an unchanged journey file.
Reviewer model: gpt-6.2-sol
Reasoning effort: high
|
The connecting journey from the review summary is updated in 5ec8c06b. J1 opens Recipient with startup held, pastes an on-chain address, checks the Bitcoin connecting overlay on Amount, then releases startup and checks that Amount is usable. XML parsing passed. Device execution is pending. The two inline findings have replies in their original threads. |
|
@greptileai please review the updated head 5ec8c06, including the QuickPay retry and legacy Spending limit fixes. |
Source: qa, mainnet QA of 3.2.0 RC3 (synonymdev/bitkit-android#2160 (comment); iOS shares the overlay rule)
Twin: synonymdev/bitkit-android#2244
Spark is ready about 0.4 s after launch, but the Send sheet kept its sync overlay up until the node ran. After 20 s in the background, Send was blocked for 24 s, even for invoices Spark could pay (#2032 comment).
Description
Out of Scope
AppViewModel.handleLnurlPayInvoice: an LNURL scanned while the node is down shows the existing "Lightning not running" toast. Before, the overlay kept the user from reaching the scanner.ChannelPending.Design
N/A — no design available.
Preview
QA Notes
Setup
Debug (regtest) build of this branch on an iPhone with a funded Spark balance. A wallet with a channel shows the Lightning variant of the overlay; without one, the Bitcoin variant.
Journeys
Manual Tests
Cold start the app (iOS keeps the node running in the background) and open Send right away: the send options show at once, and no sync overlay.
During 1., paste an invoice with an amount Spark can pay: review opens before the node runs, and the payment completes.
During 1., paste an amountless invoice: amount entry shows without the overlay. Enter an amount within the Spark balance, continue, and pay.
During 1., paste an on-chain address: the overlay shows on the Amount step and clears once the node runs.
With the node running and a usable channel, a normal Lightning send still works.
Cold-start a Lightning-only QuickPay that Spark releases before the node is ready. Let the first attempt fail, restore a funded usable channel, and make Spark insufficient before Try Again. Verify the retry uses the ready channel without a connection timeout.
Upgrade a wallet with a legacy Spending limit before its first separate channel snapshot. With node balances unavailable, credit Spark above that limit, then debit Spark. Open an amountless invoice after each refresh and check Available and the amount cap against the greater of the original limit and current Spark capacity.
Let a channel become usable after a Spark payment is submitted. Verify Pending or Success remains visible and the sheet does not revalidate the settled payment.
Evidence
Follow-up at 5ec8c06b. Xcode 27.2 on an iPhone 18 Pro simulator ran the unit suite with 4,717 passes, five skips and zero failures. The QuickPay retry and consecutive Spark refresh regressions passed. SwiftFormat 0.64.6 and J1 XML parsing passed. J1 and the manual cases await candidate device testing.
iPhone 17 Pro simulator (iOS 26.5) on local Spark regtest (
bitkit-dockerspark profile). Node held down by launching with-E2E_LOCAL_HOST=127.0.0.2. Final build88fe44eda; invoices went in by deeplink. Unit tests:ChannelFreeRailTestsandSendSheetLifecycleTestspass on88fe44eda.Tree service error: insufficient funds: the local SSP has no 8,192-sat leaves, so swaps fail.Node startednot observed because the node was held down).Gaps: payments made while the node is down are blocked by the local SSP's leaf pool, not by this change. QuickPay stays behind the overlay (
88fe44eda), since it pays as soon as it shows; not exercised on device.Review round (Greptile, ovi-reviewer)
iPhone 17 Pro simulator (iOS 26.5), local regtest. Savings 100,000, Spark 0, no channels, QuickPay on at $5. A unified BIP21 for 1,000 sats was deeplinked on a cold start, so the node starts under the overlay.
384ce626b: 3/3 PASS. The overlay showed, then on-chain Amount (Savings, 1,000 sats) right afterNode started, and it stayed ~26 s with no QuickPay or Lightning attempt. Earlier headsae9bead8a,8f11931acandf711daaadshowed "Payment Failed" there.d547026bb(Spark releases the hold): unified invoice 2/2 PASS, on-chain Amount held ~55 s. Lightning-only invoice with Spark funded (20,000): the overlay dropped while the node was still starting, and QuickPay paid through Spark (Bitcoin Sent, 1,006 sats).quickpay-fallback.mp4
Unit tests at
d547026bb:ChannelFreeRailTestsandSendSheetLifecycleTestspass (168), including the new submission, hold, Spark-release and send-limit tests.🤖 Generated with Claude Code
Models used
gpt-6.2-astra(reasoning:high). Earlier implementation model and effort are unrecorded in the PR.gpt-6.2-sol(reasoning:high) andgpt-6.1-sol(reasoning:high). Greptile did not identify its model or effort in the review.