Skip to content

bug: saved contact payment stalls instead of failing #1827

Closed as not planned
Closed as not planned

Description

@ovitrif

Observed

Paying a saved contact whose private payment path is dead never fails fast. The amount screen does not open; the app keeps retrying ("Encrypted Link Handshake is still in progress", "private link pending") and shows no "contact unreachable" message. Payment requests and first subscription payments to that contact end in "First Payment Failed" after about 30 s. Paying the same person by entering their current pubky works at once.

A dead path here is, for example, a saved contact whose Pubky identity no longer exists: the payee's identity was replaced, so the saved key points at an identity that will never link again.

Steps to reproduce

  1. Save a contact that has private contact payments enabled.
  2. Make the saved identity unreachable, for example by replacing the payee's identity (in regtest, restarting a fixture payee whose pubky changes on restart).
  3. Send → Contact → the saved contact: it stalls or returns "private link pending".
  4. Send → Enter manually → the payee's current pubky: the payment opens.

Code (master at 1764309)

  • PrivatePaykitRepo.beginSavedContactPayment (app/src/main/java/to/bitkit/repositories/PrivatePaykitRepo.kt:569): a saved contact with a private payment path is only paid privately, never through its public endpoints (KDoc at :560-568). There is no fallback when the private path cannot work.
  • Saved contact retries: beginSavedContactPaymentWithRetry (:978) retries on WaitingForUpdatedPaymentList at 1, 3 and 8 s (privatePaymentResolutionRetryDelays, :112).
  • Payment requests and subscriptions: beginPaymentRequestWaitingForUpdatedList (:591) retries 14 times at 2 s (paymentListRetryDelays, :111), about 28 s.
  • Every attempt runs the SDK call under the single operation lock (PaykitSdkOperationLock.withLock, app/src/main/java/to/bitkit/services/PaykitSdkOperationLock.kt:32), and the call itself is non-cancellable (PaykitSdkService.kt:1887). Pay can queue behind background publish and link work, and has no timeout of its own.
  • Typing a pubky that is not a saved contact takes publicPaykitRepo.beginPayment (PrivatePaykitRepo.kt:573), which needs no private link, list version or lock, which is why it works.

Leads ruled out

  • The public path: it works for the same payee, so endpoints and the payee's wallet are fine.
  • Deleting other contacts does not help.

Open

  • Whether the app should mark a saved contact unreachable once its link cannot be established, and surface that within a few seconds instead of retrying.
  • Whether a saved contact that cannot be paid privately should offer its public endpoints, which the current design rules out.

Activity

  1. added this to the 3.2.0 milestone on Nov 9, 2026
  2. ovitrif commented on Nov 9, 2026

    @ovitrif
    CollaboratorAuthor

    Triage: in 3.2.0, a Paykit contact-payment bug on master, not an RC blocker. Twin: synonymdev/bitkit-ios#1254. On the project at 📋 To do.

  3. self-assigned this
    on Nov 13, 2026
  4. ovitrif commented on Nov 13, 2026

    @ovitrif
    CollaboratorAuthor

    Not reproduced on master, closing. Tested at ab92618, which has no app changes since 61a48f8, on a regtest Android 15 emulator. The stack was bitkit-docker main, whose Paykit fixtures run paykit-rs 0.1.1-rc8 (synonymdev/bitkit-docker#38). The payee was the fixture-issuer, saved as a contact while its private link was never completed.

    A saved contact whose private link never completes fails within about 2 s with a clear message:

    • Send → Contact → the contact: the row's spinner ends with the toast "Unable To Pay Contact / Bitkit is still setting up a private connection with this contact. Make sure they've added you as a contact too, or ask them to send you a payment request." It shows 1.7 s after the tap on an idle emulator, and after 1.5–2.7 s in the other runs. The one slow run, 7.7 s, came while the emulator itself was stalling (1.5 s GC pauses, skipped frames).
    • Contacts → the contact → Pay: the same toast after 1.9–2.4 s, over 3 runs.
    • "Encrypted Link Handshake is still in progress" shows only in the log. It is the SDK's RecoveryRequired error for a peer that is still linking. beginContactPayment maps it to PrivateLinkPending and that toast at once. The saved-contact retries cover only WaitingForUpdatedPaymentList.
    • Once the payee has linked and sent its private payment list, the same tap opens the amount screen in 1.8 s.
    Send → ContactContacts → PayLinked, list sent
    android-send-contact2x.mp4
    android-contact-pay2x.mp4
    android-linked2x.mp4

    Why #1732's J1 stalled on the saved contact:

    The replaced identity in this issue's steps was a guess when I filed it, since the failures seen came from that fixture. I did not stage a replaced identity separately.

    Payment requests and first subscription payments: for a contact that isn't linked, beginPaymentRequestWaitingForUpdatedList gets PrivateLinkPending on its first attempt and fails at once. Its wait of 14 × 2 s runs only for a linked payee whose newer private payment list hasn't arrived yet, and it ends in "First Payment Failed". I did not run that case here.

    Still open from this issue, for the team to decide:

    • Should the app mark a saved contact unreachable once its link can't be established?
    • Should a saved contact that can't be paid privately offer its public endpoints?

    Twin: synonymdev/bitkit-ios#1254.

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