Skip to content

bug: closed swap send gets its contact back after hold failure #1925

Closed

Description

@ovitrif

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.

Found in review of #1923:

Activity

  1. added this to the 3.3.0 milestone on Nov 14, 2026
  2. self-assigned this
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions