You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pending screen can miss its resolution when an earlier Pending screen consumes it #2162
A payment can resolve, but its replacement Pending screen still shows Pending. This happens when an earlier Pending screen for the same payment hash takes the resolution before the replacement screen reads it.
Mechanism
PendingPaymentRepo delivers a resolution two ways:
_resolution, a SharedFlow with no replay, for live observers.
lastResolutions, which keeps the result for a screen that starts later, read through consumeResolution(hash).
SendPendingViewModel.observeResolution calls consumeResolution(paymentHash) on every resolution it collects (SendPendingViewModel.kt ~330).
When two view models exist for the same hash, the race goes like this:
An earlier SendPendingViewModel (old screen not yet cleared) is still collecting.
A replacement Pending screen for the same hash is created, but its init has not run yet.
resolve emits. The earlier view model collects the resolution and removes it from lastResolutions.
The replacement view model's init calls consumeResolution and gets null. It subscribes after the emit, so it never receives it either.
The replacement screen stays on Pending until the user closes the sheet. Funds and the activity entry are unaffected.
How the second screen can appear
The send sheet can open a new Pending screen for a hash that already has one. One way is QuickPay tracking an earlier send of the same invoice as pending (#2036). This code path is unchanged on master.
Possible direction
The screen that was not shown should not remove the stored result. For example:
only consume when pendingPaymentRepo.isActive(paymentHash) matches this view model; or
key consumption by view model, rather than having any observer drop the stored resolution.
Milestone 3.3.0: this has existed since 3.1.1 and only affects what the screen shows.
iOS uses the same consume-once slot: AppViewModel.sendSheetPendingResolution, cleared by any SendPendingScreen for that hash through consumeSendSheetPendingResolution. So the same race probably exists there too, though it hasn't been reproduced.
Activity
ovitrif commentedon Nov 27, 2026
Milestone 3.3.0: this has existed since 3.1.1 and only affects what the screen shows.
iOS uses the same consume-once slot:
AppViewModel.sendSheetPendingResolution, cleared by anySendPendingScreenfor that hash throughconsumeSendSheetPendingResolution. So the same race probably exists there too, though it hasn't been reproduced.