Repository navigation
fix: keep confirm open until the swipe finishes - #1418
Conversation
A swipe on Confirm, such as one that first updates the spending balance, now holds the screen until it moves on or returns to Confirm: no Back, no swipe back, no sheet drag and no edits. The per-visit guard stays as a safety net. Verified: none (unit suite runs next)
The confirm's swipe-back hold gets its own flag, so the PIN and Pending screens keep their own setting. A payment still running holds a rebuilt Confirm, and the subscription sheet embedding the send flow keeps its drag off too. Verified: none (unit suite runs next)
Confirm applies its hold directly on appear and disappear, since a screen covered by the PIN may see no change in between. Verified: none (unit suite runs next)
A confirm leaving no longer clears a hold the next confirm already took, such as an LNURL confirm paying on its own. Verified: none (unit suite runs next)
The lock is an observable object that reports each change at once, not on the next redraw, which a screen covered by the PIN may skip. Swipe back and the sheet count their holders, so one confirm leaving never frees another, and automatic payments hold too. Verified: none (unit suite runs next)
A confirm opened from a lightning: link is the sheet's root, with no Back or swipe back to try, so the journey drags the sheet only. Verified: J1 on a regtest simulator at c0e0485 (journey text only)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Verified: none (changelog only)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fa8a721ea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryKeeps Send Confirm and LNURL Confirm locked while a swipe or its payment runs.
Acknowledged scope: Checks were based on source inspection. No simulator tests or visual captures were run; this Linux environment cannot run the iOS UI. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Confirm appears] --> B{Swipe or payment running?}
B -->|Yes| C[Hold Back, sheet drag, and edits]
B -->|No| D[Confirm stays editable]
C --> E{What happens next?}
E -->|Confirm leaves view| F[Release this screen's hold]
E -->|Work ends on Confirm| D
F -->|Return to Confirm| B
Reviews (1) · Last reviewed commit: "test: drag only on a confirm opened from..." · Reviewed by Greptile |
|
Linked #1419 as the 3.2.0 tracking issue for this PR and moved the milestone from this PR to that issue, since the release milestone tracks issues. |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Locks Send Confirm and LNURL Confirm (Back, swipe back, sheet drag, inputs) from the swipe until the payment moves on or returns to Confirm, with per-flow and global hold counters so a leaving confirm never frees the next one. Reviewed 535e5cf, full tier, static: iOS does not build on this reviewer's Linux host, so nothing was built or run here.
What I checked, and 6 candidates I ruled out
Read: ConfirmSwipeLock and confirmSwipeLock(_:), the swipe and automatic-payment entry points in SendConfirmationView.swift and LnurlPayConfirm.swift, submitPayment through performPayment / performSwapRoutedPayment / performServiceRoutedPayment, requestPinCheck / resolvePinCheck in SendSheet.swift, SubscriptionSheet's routes, MoveToSparkManager.updateQuote / updateSpendingBalanceIfNeeded, SwipeButton.
CI at review time: SwiftFormat, validate, build-local green; Run Tests, Run Integration Tests and e2e-tests-local still pending.
Ruled out
- Hold leaked when the PIN covers Confirm:
onDisappeardrops visibility, andonAppearre-readsisSubmittingPaymentand re-locks whileruns > 0, so a missedonChangewhile covered cannot leave a stale hold. - Rebuilt Confirm appearing before the old one disappears: each lock reports only on its own
isHoldingedge, so the counters balance in either order (testALeavingConfirmKeepsTheNextConfirmsHold). - Warnings alert or biometric prompt blocked by
allowsHitTesting(false): the alerts hang offconfirmationContentoutside the locked VStack and present separately; biometrics is system UI. - Subscription sheet stuck undismissable:
isSendConfirmLockedonly goes stale ifSubscriptionSheet.routeleaves.paymentwhile the embedded flow holds, and no path writesroutefrom inside the payment flow. - Automatic payment that falls back to manual confirmation staying locked:
showManualConfirmationreturns out ofsubmitPayment, so thedeferends the run. - User trapped on Confirm by a hung quote: the lock has no timeout, so a Spark or LDK call that never returns would keep Back and the drag off; ruled out narrowly, since those calls fail rather than hang on a lost connection and the payment legs after them are bounded (
sparkBalanceWait60 s,sendWithTimeoutto Pending).
Not exercised here: the embedded subscription sheet's drag and Back / swipe back on a pushed Confirm, which the PR's Gaps also lists as not device-tested.
Merge confidence: 4/5, no findings, but the unit and integration runs were still pending and the hung-quote candidate was ruled out narrowly.
Reviewer model: claude-opus-5-5
Reasoning effort: Unknown (the review session cannot read its own run settings)
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 535e5cf.
Low: Send Confirm and LNURL Confirm can stay locked on the swipe spinner for roughly three minutes during a Spending balance update. If the channel move settles near its two-minute deadline and Spark is slow to show the balance, the app can wait roughly another minute before it reaches the recipient payment’s Pending path. During that wait the user can no longer dismiss Confirm to check Activity. Showing progress for the balance move would explain the wait while preserving the swipe. See SendConfirmationView.swift:2043, LnurlPayConfirm.swift:416, and MoveToSparkManager.swift:678-709.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.2 Sol
Reasoning effort: high
Combined review
Model: GPT-6.2 Sol
Reasoning effort: high
@pwltr out of scope: tracked in #1421, because the wait is bounded by the move's deadlines and ends in the payment's Pending path, and showing the move's progress is new UI that fits better in its own change than on this approved fix. |
Closes #1419
Twin: synonymdev/bitkit-android#2017
Refs: #1373
After the confirm swipe, a payment that needs the spending balance update quotes the update fee again before it moves anything, which takes a second or two. The confirm screen stayed fully interactive meanwhile: Back, swipe back, dragging the sheet down and tapping the amount or fee all worked, so a swipe the user made could be undone silently by leaving. This PR locks the confirm screen from the swipe until it moves on to the payment or returns to confirm (new fee, failure), on the update path and the normal path alike.
Description
ConfirmScreenVisit) stays as a safety net for a quote finishing after the user left.Out of Scope
SendConfirmationView: the lock blocks touches; VoiceOver and other assistive technologies can still reach the confirm's controls while the swipe runs.Design
N/A — no design available.
Preview
J1 at 2x: after "Yes, Send", a drag down while the swipe loads pulls the sheet partway and it snaps back to Confirm.
rec-j1c2x.mp4
QA Notes
Setup
Debug build (regtest) pointed at a local Spark regtest stack from synonymdev/bitkit-docker (
docs/spark-regtest.md):E2E_BUILDwithE2E_BACKEND=local,E2E_LOCAL_HOST=127.0.0.1,SPARK_LOCAL_CONFIG_B64from the docs andSPARK_LOCAL_CHAIN_URLset to the stack's chain API. QuickPay off, a new wallet with savings, a ~32 000-sat channel to the stack's SSP Lightning node, about 30 000 sats on Spark, and a 50 000-sat invoice from another node on the stack.Journeys
update-spending-balance-payment.xml— dragging the sheet down leaves the confirm screen open while the swipe runs — lock passed onc0e048511; the 50 000 payment itself failed on Spark (see Gaps)Manual Tests
N/A
Automated Checks
SendConfirmationSwipeTests.swift— a running swipe holds Confirm until it moves on or returns, a swipe that stopped while the PIN covered Confirm leaves it free, a running payment holds a rebuilt ConfirmSendConfirmationSwipeTests.swift— a confirm leaving keeps the next confirm's holdEvidence
The unit suite passes at c0e0485; later commits change only the journey text and the changelog.
J1 on a regtest simulator (iPhone 17 Pro, 804×1748) against the local Spark stack, on
c0e048511:Gaps
lightning:link, so Confirm is the sheet's root with no Back or swipe back to try; Back hiding and swipe back on a pushed Confirm (reached from Amount) were not device-tested.DialogConfirmaccessibility id on iOS, which the journey names.Models used
Claude Opus 5.5(reasoning:medium)Claude Opus 5.5(reasoning:medium)gemini-4-neon-high(reasoning:Not exposed)Metadata note: the review ran through Gemini Neon's CLI, whose record names the model but not a reasoning setting.