Skip to content

[Bug]: Reconnecting dismisses “Payment returned to Savings” before the user closes it #2030

In review

Description

@piotr-iohk

What happened?

A restored 20,000-sat swap settled successfully. Its blue “Payment returned to Savings” notification appeared for 1.243 seconds. Reconnecting displaced it with the older connection warning, followed by “Back online”. No one dismissed the payment notification.

Expected behavior

Keep the payment-return notification visible until the user closes it. Then show the current connection status.

Steps to Reproduce

  1. On local regtest, use a swap-enabled build with the provider configured for recovery. Fund a disposable wallet’s Spending balance via a Lightning channel. Connect a compatible Paykit profile and save an on-chain-only Paykit contact.
  2. Pay the contact 20,000 sats from Spending using Pubky Swaps. When the provider logs HTLC funded; awaiting client claim, force-stop Bitkit before mining a block.
  3. With the app stopped, use a newer Paykit SDK to save version 6 shared state for the same test profile. Restore the disposable wallet from its recovery phrase in a clean QA installation that reads version 4.
  4. When the update warning appears, drag downward on it and hold to pause its timer. Once the app rediscovers the swap, mine one block to confirm the lockup. Wait for the payment-return event to queue behind the warning.
  5. With mobile data off, turn Wi-Fi off and back on. Release the drag while reconnection is completing. The timing that reproduces the bug is for “Back online” to reach the queue just after the payment return becomes visible.
  6. Leave the payment notification untouched and observe which notification appears next.

Logs / Screenshots / Recordings

In the full-screen clip, watch around 0:03–0:05. The blue Polish notification reads “Płatność zwrócona do Oszczędności”. The large heading underneath reads “Wallet restored”. The trace records the payment notification at 11:53:19.163, the offline warning at 11:53:20.406, and “Back online” at 11:53:23.394.

2026-11-25-restored-payment-toast.mp4
s22-final-claim.log
11-25 11:51:46.851 23973 24000 I QATrace : current=none queue=
11-25 11:52:59.374 23973 24028 W APP     : 2026-11-25 10:52:59.373 WARN    [PubkyRepo.kt:642]                   Kept saved session, paykit state needs an app update [AppError='code=storage_error, context=unsupported SDK state blob version 6, expected 4'] - PubkyRepo
11-25 11:52:59.390 23973 24000 I QATrace : current=Błąd queue=
11-25 11:53:01.770 23973 24024 W APP     : 2026-11-25 10:53:01.769 WARN    [PubkyRepo.kt:642]                   Kept saved session, paykit state needs an app update [AppError='code=storage_error, context=unsupported SDK state blob version 6, expected 4'] - PubkyRepo
11-25 11:53:07.127 23973 24029 I APP     : 2026-11-25 10:53:07.127 INFO    [WalletViewModel.kt:591]             Restored '1' Pubky Swaps routes, '0' known - WalletViewModel
11-25 11:53:09.558 23973 24000 I QATrace : current=Błąd queue=[Płatność zwrócona do Oszczędności]
11-25 11:53:10.496 23973 24000 I QATrace : current=Błąd queue=[Płatność zwrócona do Oszczędności][Problemy z połączeniem z internetem]
11-25 11:53:19.163 23973 24000 I QATrace : current=Płatność zwrócona do Oszczędności queue=[Problemy z połączeniem z internetem]
11-25 11:53:20.406 23973 24000 I QATrace : current=Problemy z połączeniem z internetem queue=[Połączenie z Internetem przywrócone]
11-25 11:53:23.394 23973 24000 I QATrace : current=Połączenie z Internetem przywrócone queue=
11-25 11:53:26.389 23973 24000 I QATrace : current=none queue=
s22-address-queue-complete.log
11-25 11:56:17.769 30344 31109 I QATrace : current=none queue=
11-25 11:56:26.411 30344 31109 I QATrace : current=Połączenie z Internetem przywrócone queue=
11-25 11:56:29.394 30344 31109 I QATrace : current=none queue=
11-25 11:57:18.904 30344 31109 I QATrace : current=Błąd queue=
11-25 11:57:18.907 30344 30414 I QAQueue : Enqueued production INFO payment-return notification with autoHide=false
11-25 11:57:18.949 30344 31109 I QATrace : current=Błąd queue=[Płatność zwrócona do Oszczędności]
11-25 11:57:19.153 30344 31109 I QATrace : current=Błąd queue=[Płatność zwrócona do Oszczędności][Stosowanie zmian…]
11-25 11:57:20.128 30344 31109 I QATrace : current=Błąd queue=[Płatność zwrócona do Oszczędności][Zmieniono typ adresu]
11-25 11:57:28.623 30344 31109 I QATrace : current=Płatność zwrócona do Oszczędności queue=[Zmieniono typ adresu]
11-25 11:58:31.624 30344 31109 I QATrace : current=Zmieniono typ adresu queue=
11-25 11:58:34.624 30344 31109 I QATrace : current=none queue=
s22-trace.log
11-25 11:36:59.659 11773 11855 W APP     : 2026-11-25 10:36:59.657 WARN    [PubkyRepo.kt:642]                   Kept saved session, paykit state needs an app update [AppError='code=storage_error, context=unsupported SDK state blob version 6, expected 4'] - PubkyRepo
11-25 11:37:00.111 11773 11818 I QAQueue : Enqueued production INFO payment-return notification with autoHide=false
11-25 11:37:00.111 11773 12994 I QATrace : current=none queue=[Płatność zwrócona do Oszczędności]
11-25 11:37:00.152 11773 12994 I QATrace : current=Płatność zwrócona do Oszczędności queue=
11-25 11:37:00.395 11773 12994 I QATrace : current=Stosowanie zmian… queue=
11-25 11:37:01.444 11773 12994 I QATrace : current=Zmieniono typ adresu queue=
11-25 11:37:04.439 11773 12994 I QATrace : current=none queue=
provider-settlement.log
2026-11-25T10:53:11.007683Z  INFO swap_provider::reverse: Reverse swap: client claimed; hold invoice settled

Bitkit Version

3.1.1 (197), regtest debug, 17b0f3c8fa6ccb63a86329fa4c1a6ee7c6bd63db

Device / OS

Samsung Galaxy S22 (SM-S901B), Android 16, Polish UI.

Reproducibility

Observed once with a real restored swap. A separate controlled run reproduced the interruption when an address change began after the payment notice was already visible.

Additional context

Manual case 4 in #2023. The provider logged client claimed; hold invoice settled, and the 20,000-sat output confirmed. The notification has autoHide=false and inherits interruptible=true. The queue dismisses an interruptible current item on the next enqueue. The address-change case passed when its result was already queued before the payment notification became current.

Activity

  1. added theissue type on Nov 25, 2026
  2. self-assigned this
    on Nov 25, 2026
  3. added this to the 3.2.0 milestone on Nov 25, 2026
  4. ovitrif commented on Nov 25, 2026

    @ovitrif
    Collaborator

    Triage: 3.2.0. It comes from the update warning added in #2023, which ships in 3.2.0, so the fix goes in the same release.

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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions