Skip to content

fix: keep confirm open until the swipe finishes - #2017

Open
ovitrif wants to merge 16 commits into
masterfrom
fix/lock-confirm-swipe
Open

ovitrif wants to merge 16 commits into
masterfrom
fix/lock-confirm-swipe

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #2018
Twin: synonymdev/bitkit-ios#1418
Refs:

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, system back, dragging the sheet down and tapping the amount 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

  • Lock the confirm screen while the swipe runs: the swipe keeps its loading state, Back is hidden, system back does nothing, the sheet can't be dragged or tapped away, and the amount, address, method, speed, tags and LNURL comment can't be edited.
  • AppViewModel.isSendSwipeRunning is true while the current send's swipe checks or the payment it confirmed still run, including the update quotes, which give up with the payment error after 60 s even while the LDK queue is stuck; closing or starting a send clears it. The screen frees itself once nothing runs for a swipe for a second, so a swipe that stops early never traps the user; the amount warning dialog, the biometrics prompt and the prepared fee review stay leavable while the user answers them, and closing one, or swiping to accept a new fee, locks it again. A pay confirmation the hardware fee check turns down is cleared, so it holds nothing.
  • The sheet lock is scoped to the confirm screen: once the payment moves on (Pending, Success, Error, PIN), the sheet can be closed again even while the payment finishes in the background.
  • The per-send guard (sendStateGeneration, bumped when the send sheet closes) now also drops the failure of an update quote for a send the user left, instead of showing its error on whatever is open next.
  • A failed send now resets the confirm screen under its error screen. Before, Back from the error, or a new invoice opened onto that confirm screen, left the swipe spinning forever with every swipe ignored (also on master).

Out of Scope

Design

N/A — no design available.

Preview

J1 at 2x: after "Yes, Send", system back and a drag down leave Confirm open while the swipe runs; the payment then completes.

rec-j1b2x.mp4

QA Notes

Setup

Dev build pointed at a local Spark regtest (spark-sdk regtest/local), QuickPay off, as in the journey's precondition: a wallet with an open channel to that stack's SSP Lightning node that can send about 30 000 sats and a Spark balance of about 30 000 sats, and a second wallet (or the stack's Lightning node) that can issue a 50 000-sat invoice.

Journeys

  • J1: updated update-spending-balance-payment.xml — system back and dragging the sheet down leave the confirm screen open while the swipe runs — passed on 9214a3422

Manual Tests

N/A

Automated Checks

  • added AppViewModelSendFlowTest.kt — the swipe keeps running while it quotes the update again, and stops once the new fee shows
  • added AppViewModelSendFlowTest.kt — a swipe of a closed send holds nothing, and its failing update quote shows no error
  • added SendConfirmUpdateFeeTest.kt — the lock hides Back and blocks edits on its own, and an unlocked confirm takes edits
  • added SendConfirmUpdateFeeTest.kt — a swipe with nothing running for it frees the confirm after a second
  • added AppViewModelSendFlowTest.kt — a hardware confirm while the fee refreshes clears the pay confirmation
  • added AppViewModelSendFlowTest.kt — a stalled update quote ends the swipe with the payment error
  • added SendConfirmUpdateFeeTest.kt — a pending pay confirmation with nothing running stays locked
  • added SendConfirmUpdateFeeTest.kt — a new run after the idle release locks from its first composition
  • added SendConfirmUpdateFeeTest.kt — a closed biometrics prompt locks again from its first composition
  • added SendConfirmUpdateFeeTest.kt — a swipe accepting a prepared fee locks the confirm
  • added SendConfirmUpdateFeeTest.kt — the amount warning frees the confirm while the user answers it
  • added AppViewModelSendFlowTest.kt — a stalled update quote at the payment ends it with the payment error
  • added SendErrorNavigationTest.kt — Back from a failed swipe returns to a confirmation that takes a swipe

Evidence

just compile, just lint and just test pass at a452ade.

J1 on a regtest emulator (Android 16, 896×1994 at 320 dpi) against the local Spark stack, on 9214a3422, built with the local backend and Spark settings:

  • Wallet: 500 000 in savings, a 32 000-sat channel to the SSP node, 30 000 on Spark. The second try added another 32 000-sat channel, so it paid an 80 000 invoice that still needed the update.
  • Confirm showed the amount with its details open, "Instant (± ₿ 322)" and "Update fee ₿ 2", with no "up to" and no Route row. The over-half-balance dialog showed; "Yes, Send".
  • 0.1 s after "Yes, Send" system back left Confirm up with the swipe loading; 1 s after, a drag down moved the sheet partway and it snapped back to Confirm. No Back button showed; the layout 4.7 s later still read Confirm.
  • The swipe moved 29 602 sats to Spark, closed the emptied channel and sent the payment about 8 s after "Yes, Send". Bitcoin Sent showed 80 000; Activity listed "Sent 80 322" and "Move to Spark 29 602"; both channels were closed.
  • A first try at 50 000 locked the same way, but ended on "Payment Pending": Spark failed the send with "Failed to select leaves after all retries" about a second after the moved funds landed, and the funds stayed in Spark. That failure comes from the combined payment, not from this change.

Gaps

None.

Models used

  • Planning/scoping: Claude Opus 5.5 (reasoning: medium)
  • Implementation: Claude Opus 5.5 (reasoning: medium)
  • Review: gemini-4-neon-high (reasoning: Not exposed)
  • Review rounds: 14

Metadata note: the review ran through Gemini Neon's CLI, whose record names the model but not a reasoning setting.

Verified: just compile, just lint, just test
Verified: just compile, just lint, just test
Verified: none (journey text only)
@ovitrif ovitrif added this to the 3.2.0 milestone Nov 24, 2026
@ovitrif ovitrif self-assigned this Nov 24, 2026
@ovitrif
ovitrif requested review from jvsena42 and pwltr November 24, 2026 18:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T18:34:48.366021Z fb0f0c2 PR opened
ℹ️ 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" or "@codex security review".

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)
@ovitrif

ovitrif commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Added the changelog fragment in 2a014e3.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from a452ade (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@ovitrif ovitrif removed this from the 3.2.0 milestone Nov 24, 2026
@ovitrif

ovitrif commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Linked #2018 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 talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Static review at 2a014e33c. Per the repo's policy for unvouched Android branches it was not built here; CI's build-and-test, lint and detekt are green at this head, and the e2e and compose-ui jobs were still pending when I read it.

The lock itself holds up. isLocked gates the top bar's Back and the inputs' onEvent. BackHandler blocks system back, and the sheet's dismissEnabled blocks both drag and scrim. DisposableEffect clears it on every exit: Pending, Success, Error, PIN, or another sheet replacing the send. The PIN and biometrics hand-offs keep the lock through shouldConfirmPay, and the 300 ms pre-swipe delay is covered because the idle timer restarts once isSendSwipeRunning flips. Moving the generation check ahead of getOrElse in confirmSparkUpdateQuote is right, and the new view model test covers it.

One inline point, on the scope of isSendSwipeRunning.

Not covered by a test: the 1 s idle release (SWIPE_IDLE_RELEASE) that frees a swipe which stopped early. The new compose test sets isLocked = true directly, so nothing asserts that the screen unlocks again.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed

Verified: just compile, just lint, just test
Verified: just compile, just lint, just test
Verified: just compile, just lint, just test
@ovitrif

ovitrif commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Not covered by a test: the 1 s idle release (SWIPE_IDLE_RELEASE) that frees a swipe which stopped early.

@talosmachina Covered in ef71c45: the lock rule moved into rememberConfirmLock, and SendConfirmUpdateFeeTest.kt now checks that it holds while the swipe runs and frees the confirm a second after nothing runs for it.

@talosmachina

Copy link
Copy Markdown
Contributor

Checked ef71c45: that closes the gap. rememberConfirmLock now carries the whole rule, and the new test drives it through all three states: still locked after 2 s with the swipe running, still locked half a second after it stops, free after 1.5 s. The half-way assertion also keeps the test honest. If the compose clock ever auto-advanced through the delay, the test would fail there, not pass.

9214a34 also settles my inline point on the scope of isSendSwipeRunning. Runs are now counted per sendSession, the flag is refreshed when a new send starts and when the sheet closes, and the renamed view model test asserts that a closed send's payment holds nothing.

I read this from the diff only, I did not build it here. build-and-test, lint and compose-ui were still pending at 9214a3422 when I checked.

@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.

Code scan of 9214a34: no HIGH or MEDIUM. The fee approved at the swipe still bounds what pays (confirmSparkUpdateQuote returns to Confirm on a higher fee, and updateSpendingBalanceIfNeeded fails with UpdateFeeUnseen). Edits are gated in the swipe's own composition, and onConfirmPay still refuses a second submission.

Four inline comments: two lock-outs reproduced with failing tests, one stall to time on device, and a journey nit. All are new in this PR, since master has no lock.

tests (both fail at 9214a34; with both inline fixes AppViewModelSendFlowTest 768/768, SendConfirmUpdateFeeTest 5/5)
diff --git a/app/src/test/java/to/bitkit/ui/screens/wallets/send/SendConfirmUpdateFeeTest.kt b/app/src/test/java/to/bitkit/ui/screens/wallets/send/SendConfirmUpdateFeeTest.kt
index 32999e7d0..0b43f0072 100644
--- a/app/src/test/java/to/bitkit/ui/screens/wallets/send/SendConfirmUpdateFeeTest.kt
+++ b/app/src/test/java/to/bitkit/ui/screens/wallets/send/SendConfirmUpdateFeeTest.kt
@@ -27,6 +27,7 @@ import kotlin.test.assertEquals
 import kotlin.test.assertFalse
 import kotlin.test.assertTrue
 import kotlin.time.Duration
+import kotlin.time.Duration.Companion.seconds
 
 @RunWith(RobolectricTestRunner::class)
 class SendConfirmUpdateFeeTest {
@@ -115,6 +116,43 @@ class SendConfirmUpdateFeeTest {
         assertFalse(isLocked)
     }
 
+    @Config(sdk = [34])
+    @Test
+    fun `VERIFY a pending pay confirmation with nothing running stays locked`() {
+        var isLocked = false
+        composeRule.setContent {
+            isLocked = rememberConfirmLock(
+                isLoading = true,
+                isSwipeRunning = false,
+                uiState = SendUiState(shouldConfirmPay = true),
+            )
+        }
+        advanceBy(5.seconds)
+
+        assertTrue(isLocked, "unlocked after 5 s")
+    }
+
+    @Config(sdk = [34])
+    @Test
+    fun `VERIFY a new run after the idle release locks from its first composition`() {
+        var isSwipeRunning by mutableStateOf(false)
+        val composed = mutableListOf<Pair<Boolean, Boolean>>()
+        composeRule.setContent {
+            val locked = rememberConfirmLock(isLoading = true, isSwipeRunning = isSwipeRunning, uiState = SendUiState())
+            composed += isSwipeRunning to locked
+        }
+        advanceBy(SWIPE_IDLE_RELEASE * 2)
+        assertEquals(false to false, composed.last(), "idle release did not fire")
+        val released = composed.size
+
+        composeRule.runOnUiThread { isSwipeRunning = true }
+        advanceBy(SWIPE_IDLE_RELEASE / 4)
+
+        val afterFlip = composed.drop(released)
+        assertTrue(afterFlip.isNotEmpty())
+        assertTrue(afterFlip.all { (running, locked) -> !running || locked }, "compositions after flip: $afterFlip")
+    }
+
     private fun advanceBy(duration: Duration) {
         composeRule.waitForIdle()
         composeRule.mainClock.advanceTimeBy(duration.inWholeMilliseconds)
diff --git a/app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt b/app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt
index 53d69f283..ed284cefa 100644
--- a/app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt
+++ b/app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt
@@ -21815,6 +21815,26 @@ class AppViewModelSendFlowTest : BaseUnitTest() {
         assertFalse(sut.isSendSwipeRunning.value)
     }
 
+    @Test
+    fun `VERIFY a hardware confirm while the fee refreshes clears the pay confirmation`() = test {
+        setSendState(
+            SendUiState(
+                address = "bcrt1qverifyhardware",
+                amount = 60_000uL,
+                isAmountInputValid = true,
+                payMethod = SendMethod.ONCHAIN,
+                hardwareWalletId = "hardware-wallet",
+                onchainFeeUi = OnchainFeeUi(sats = 150, isLoading = true),
+                shouldConfirmPay = true,
+            ),
+        )
+
+        sut.setSendEvent(SendEvent.PayConfirmed)
+        advanceUntilIdle()
+
+        assertFalse(sut.sendUiState.value.shouldConfirmPay, "shouldConfirmPay stays true after the early return")
+    }
+
     @Test
     fun `a scan while the node starts decides on QuickPay once the channels are usable`() = test {
         val bolt11 = "lnbcrt1quickpaystarting"

Device gate: ⚠️ not run yet. Pending: J1 on the local Spark stack, Back and drag during the lock, the stalled re-quote (airplane mode after "Yes, Send"), PIN cancel and success, a higher re-quote, and normal Lightning and on-chain sends. perf: ⚠️ not measured; not performance-relevant (one StateFlow, one LaunchedEffect).

Reviewer model: claude-fable-5-2 (primary), claude-opus-5-5 (verifier, coordinator)
Reasoning effort: Not exposed

Clear the pay confirmation when a hardware fee is still loading, lock a new run from its first composition, bound the update re-quote at 60 s, and note system back as Android-only in the journey.

Verified: AppViewModelSendFlowTest and SendConfirmUpdateFeeTest pass; just compile, test and lint running
Route the payment's own update quote through the same 60 s bound and log a timeout. The lock UI test now checks the lock's own edit guard against an unlocked control.

Verified: AppViewModelSendFlowTest and SendConfirmUpdateFeeTest pass
The biometrics prompt frees the lock like the PIN does, and closing it locks Confirm from the first frame until the payment starts.

Verified: SendConfirmUpdateFeeTest passes

@pwltr pwltr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 9214a34. The normal swipe holds confirmation through the first spending-balance re-quote, and a result from that first quote is discarded after the send changes.

Low: The prepared-fee exception in SendConfirmScreen.kt:266 leaves Confirm dismissible even after the user swipes to accept the higher fee. System Back during the loading delay can silently cancel the send through SendSheet.kt:544. Keep Back available while the user is deciding on the new fee, and apply the lock once they swipe again.

Low candidate: AppViewModel.kt:9563 can leave shouldConfirmPay set if a hardware fee refresh starts between the swipe and the confirmation event with PIN-for-payments off. The flag prevents the idle release at SendConfirmScreen.kt:262 even after the refresh completes. A flow-level trace is needed to establish a reachable refresh in that interval that leaves Confirm open.

Low candidate: After the idle release, SendConfirmScreen.kt:259–266 can render one unlocked composition when a swipe resumes, such as when the user accepts an amount warning after more than a second. Whether Back can dismiss the sheet during that interval still needs a timing trace.

Low candidate: The swipe lock has no app-level deadline while the spending-balance quote waits for Spark invoice creation or LDK fee estimation in MoveToSparkRepo.kt:204–235. A stalled call could leave the user unable to dismiss Confirm. The effective SDK deadline and recovery behavior still need to be established.

Pre-existing Low: The execution-time quote at AppViewModel.kt:8146 lacks the send ownership check used for the first quote. If a payment link replaces the send while it waits, a higher fee can appear on the replacement and reset Confirm (AppViewModel.kt:8148, AppViewModel.kt:8121). A quote failure can instead take the replacement to the payment error screen (AppViewModel.kt:8132).

Pre-existing Medium candidate: An ordinary on-chain swipe can resume from its fee check and set shouldConfirmPay on a different payment (AppViewModel.kt:6785–6791). This requires a payable Lightning link to replace the send during that check, with QuickPay and PIN-for-payments off. Confirmation can then submit the replacement without a new swipe. A controlled trace is needed to establish that the replacement can reach confirmation before the original fee check resumes.

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

@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 9214a3422: nothing above LOW after the code scan and the device gate. The four inline comments from the earlier review stand: two LOWs with failing tests and fixes, the stalled re-quote (now timed on device and kept LOW), and the journey nit.

Device gate (Gate_Throwaway emulator, local Spark stack from bitkit-docker's spark profile, devDebug arm64 PR build and base ddd0718a2 build):

  • J1: pass. Confirm showed 48 955 with Instant ± ₿ 197 and Update fee ₿ 2. After "Yes, Send", a drag at +1.6 s and system Back at +2.3 s left Confirm open; Bitcoin Sent at +10.5 s. Activity shows Sent 49 152 and Move to Spark 29 600; the channel closed.
  • M1, stalled re-quote: Confirm locked 60.5 s / 60.4 s with the SSP and proxy frozen, 18.7 s with the proxy only, then "Payment Failed". Base let Back leave at +11.7 s. Details on the inline thread.
  • M2, PIN: cancel reset Confirm and Back left it, nothing paid. Success: drag at +1.4 s and Back at +1.9 s left Confirm open, paid once.
  • M4, normal sends: Lightning 4 078 (drag dismissed the success sheet) and on-chain 20 000 (Back dismissed it): pass.
  • ⚠️ M3, higher re-quote: not run. The move is one hop to the wallet's own peer, so the fee is always the 2-sat floor on this stack.
  • ⚠️ Pending-sheet dismiss and the LDK-sync stall of the fee estimate: not run.

Device gate: J1, M1, M2, M4 pass; ⚠️ M3 and the pending-sheet dismiss not run. perf: ⚠️ not measured; not performance-relevant (one StateFlow, one LaunchedEffect).

Reviewer model: claude-fable-5-2 (primary, device runbook), claude-opus-5-5 (verifier, coordinator)
Reasoning effort: Not exposed (primary), medium (device runbook)

@jvsena42

Copy link
Copy Markdown
Member

Out of scope for this PR, seen during the device gate at 9214a3422: airplane mode right after "Yes, Send" on an update-path payment ends in SIGABRT (ChannelMonitor[Update] persistence failed unrecoverably) about 2 min 45 s after payInvoice, because LDK's channel-monitor write to VSS cannot complete. Base ddd0718a2 crashes the same way, so the PR does not introduce it. The one difference is that with this PR Confirm stays locked for those 2 min 48 s, where base let the user go back to Home first. Balances and the channel were intact after relaunch.

@ovitrif
ovitrif requested review from jvsena42 and pwltr November 25, 2026 09:58
The prepared fee review stays leavable because it clears the swipe's loading; the swipe accepting it now locks Confirm like any other.

Verified: SendConfirmUpdateFeeTest and AppViewModelSendFlowTest pass
The amount warning now keys the lock like biometrics, so closing it locks Confirm from the first frame. Tests cover the warning freeing the lock and a stalled update quote at payment time.

Verified: SendConfirmUpdateFeeTest and AppViewModelSendFlowTest pass

@pwltr pwltr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 727505d.

Low candidate: Confirm can stay locked past 60 seconds on a payment that needs both LDK and Spark balances. Both re-quotes wait for an LDK routing estimate on a queue whose separate job keeps the caller waiting until the queued native work returns, even after the quote timeout expires. This applies to the preflight quote in AppViewModel.kt:8166 and the execution quote in AppViewModel.kt:8146, through ServiceQueue.kt:18 and LightningService.kt:1229. If LDK work stalls past the deadline, Back and sheet dismissal stay blocked. At the second quote, the stall also delays failure cleanup before any funds move or the invoice is sent. A stalled-queue test at either call site would establish the duration and recovery behavior.

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

A biometrics failure no longer clears loading before the PIN check, matching the direct PIN path, so Confirm stays locked when the PIN returns.

Verified: just compile, test and lint running
@ovitrif

ovitrif commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

@pwltr

Low: The prepared-fee exception in SendConfirmScreen.kt:266 leaves Confirm dismissible even after the user swipes to accept the higher fee.

Fixed in 47dc1a9: the review stays leavable because it clears the swipe's loading, and the swipe that accepts the new fee now locks Confirm. 649ec25 and a206cb0 also lock again from the first frame after the amount warning closes, and through a PIN fallback after biometrics fail.

Low candidate: AppViewModel.kt:9563 can leave shouldConfirmPay set if a hardware fee refresh starts between the swipe and the confirmation event

Low candidate: After the idle release, SendConfirmScreen.kt:259–266 can render one unlocked composition when a swipe resumes

Low candidate: The swipe lock has no app-level deadline while the spending-balance quote waits for Spark invoice creation or LDK fee estimation

Fixed in c30635f and 2b1c307, from the same points on the earlier review: the turned-down pay confirmation is cleared, a new run locks from its first composition, and both update quotes give up after 60 s with the payment error.

Pre-existing Low: The execution-time quote at AppViewModel.kt:8146 lacks the send ownership check used for the first quote.

Pre-existing Medium candidate: An ordinary on-chain swipe can resume from its fee check and set shouldConfirmPay on a different payment

Out of scope: tracked in #2026, because both predate this PR and need a send-ownership check across the payment path.

@ovitrif

ovitrif commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Out of scope for this PR, seen during the device gate at 9214a3422: airplane mode right after "Yes, Send" on an update-path payment ends in SIGABRT

@jvsena42 out of scope: tracked in #2027, because base crashes the same way.

@ovitrif
ovitrif requested a review from pwltr November 25, 2026 10:47
The LDK queue finishes its work after its caller is cancelled, so the 60 s bound now awaits the quote apart and stops waiting on time. The stalled-quote tests stall on work that ignores cancellation; both fail on the previous code.

Verified: AppViewModelSendFlowTest passes; the two stalled-quote tests fail without the change
@ovitrif

ovitrif commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

@pwltr

Low candidate: Confirm can stay locked past 60 seconds on a payment that needs both LDK and Spark balances.

Fixed in 4eabbfa: both quotes are awaited apart from the LDK queue's work, so the swipe gives up at 60 s with the payment error even while that work keeps running. The two stalled-quote tests in AppViewModelSendFlowTest.kt now stall on work that ignores cancellation, and both fail on the previous code.

A failure now resets the confirmation under the error screen, so Back, or a new invoice reusing that confirmation, no longer leaves the swipe spinning.

Verified: SendErrorNavigationTest passes and fails without the change
An error over another screen leaves the confirmation's reset alone, so a PIN finished later keeps its payment locked. sendSession is volatile, since the swipe tracking reads it across threads.

Verified: SendErrorNavigationTest passes
@ovitrif

ovitrif commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Added in 1dc1f0b and a452ade, a bug also on master: after a failed send, Back from the error screen, or a new lightning: invoice opened onto the same confirm screen, left the swipe spinning forever with every swipe ignored. The error screen is pushed over Confirm, whose saved loading state nothing reset. A failure now resets the confirm screen it covers, as coin selection already does; SendErrorNavigationTest.kt covers Back after a failure and fails without the change.

a452ade also makes sendSession volatile, since the swipe tracking reads it across threads.

This branch has not been deployed

No deployments
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.

bug: leaving confirm undoes a finished swipe

4 participants