Skip to content

bug: replaced send sheet keeps its swap contact #1930

Open

Description

@ovitrif

A swap send's hold payment failing after its Send sheet was replaced by another sheet puts the swap's contact back on the send state, with no Send sheet open.

Why

  • fix: pubky swaps route review follow-ups #1929 bumps sendSession in hideSheet, so a closed send no longer gets its contact back. showSheet can also close an open Send sheet: it sets _currentSheet to null, then to the new sheet, without going through hideSheet. SheetHost calls onDismiss only when the dismissed key matches the current one, so a programmatic swap never reaches hideSheet.
  • Two callers do this while a Send sheet can be open:
    • handleChannelClosed shows Sheet.ConnectionClosed on a counterparty close.
    • ContentView opens sheet deep links.
  • A counterparty close while a swap's hold HTLC is in flight is a natural way for that hold to fail later. Then releaseFailedSwapHold or restoreSwapContact passes the session check and sets activeContactPaymentContext with no Send sheet open, the bug: closed swap send gets its contact back after hold failure #1925 symptom.

The swap route is behind the debug-only PUBKY_SWAPS_ROUTES flag.

Fix

Bump the send session wherever an open Sheet.Send is replaced, in a small helper both hideSheet and showSheet call. Add a test like swap route hold failing after its sheet closed leaves no contact behind, with showSheet(Sheet.ConnectionClosed) in place of hideSheet().

Found in review of #1929:

Activity

  1. added this to the 3.3.0 milestone on Nov 14, 2026
  2. changed the title [-]fix: replaced send sheet keeps its swap contact[/-] [+]bug: replaced send sheet keeps its swap contact[/+] 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions