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
bug: closed swap send gets its contact back after hold failure #1925
A swap send's hold payment failing after its Send sheet was closed puts the swap's contact back on the send state, with no Send sheet open.
Why
Since fix: pubky swaps route follow-ups #1923, restoreSwapContact and releaseFailedSwapHold (AppViewModel.kt) restore the contact when the send session matches. Only resetSendState bumps the session; hideSheet bumps only sendStateGeneration, so a closed send still matches.
A later payment with no contact of its own then takes that contact: send A (plain Lightning, no contact) and send B (swap to a contact) both go to Pending and the sheet closes; B's hold fails and sets activeContactPaymentContext to B's contact; A settles and syncContactForActivity tags A's activity with B's contact.
isPaymentRequestPresentationBlocked() also reads the restored context, so incoming payment requests are held back while no send is open.
The swap route is behind the debug-only PUBKY_SWAPS_ROUTES flag.
Fix
Bump the send session in hideSheet too, so a closed send never gets its contact back, while edits inside an open send (the source switch the session check is for) still keep it. Add a test that closes the sheet before the hold fails.
Activity