Skip to content

fix: establish private Paykit links promptly - #1141

Open
ben-kaufman wants to merge 3 commits into
masterfrom
codex/paykit-fast-private-link
Open

fix: establish private Paykit links promptly#1141
ben-kaufman wants to merge 3 commits into
masterfrom
codex/paykit-fast-private-link

Conversation

@ben-kaufman

Copy link
Copy Markdown
Contributor

Description

  • Refresh each saved or scanned contact’s current Paykit receiver paths from Pubky during private sync and persist newly published paths such as bitkit/server.
  • Start a bounded 28-second, two-second-cadence private link/message sync burst after contact updates, path discovery, app foregrounding, and network restoration, then return to the existing low-frequency polling cadence.
  • Refresh incoming Payment Requests during the same bounded window so a newly linked request opens automatically without waiting for the normal 30-second poll.
  • Preserve private-only resolution semantics; no public payment fallback was added.

Preview

No UI changes.

QA Notes

Regression coverage verifies that a contact saved with only bitkit/wallet later discovers bitkit/server, persists it, calls ensureLinkWithPeer, and never starts public payment resolution. Existing send-flow coverage now also verifies that Payment Request polling refreshes immediately when activated.

CI is the authoritative Android build/test run because the native GitHub Packages dependencies require repository package credentials.

@ben-kaufman
ben-kaufman force-pushed the codex/paykit-fast-private-link branch from 6a37c34 to 266f7b2 Compare August 6, 2026 15:34
@ben-kaufman
ben-kaufman marked this pull request as ready for review August 6, 2026 15:39
@ben-kaufman
ben-kaufman requested review from jvsena42 and ovitrif August 6, 2026 15:39
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown

Greptile Summary

The PR accelerates discovery and establishment of private Paykit links and refreshes incoming payment requests during the same bounded synchronization window.

  • Merges newly discovered supported receiver paths into saved contact records.
  • Starts two-second-cadence private-link synchronization bursts after relevant contact, foreground, channel, and connectivity events.
  • Adds immediate bounded payment-request polling alongside the existing low-frequency polling cycle.
  • Extends regression coverage for delayed receiver-path discovery and immediate request refresh.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the eligible follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/repositories/PrivatePaykitRepo.kt Adds bounded private-link synchronization, receiver-path discovery and persistence, lifecycle cleanup, and burst notifications.
app/src/main/java/to/bitkit/usecases/RefreshContactPaykitReceiversUseCase.kt Starts the synchronization burst after a successful explicit contact receiver refresh.
app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt Connects synchronization bursts to lifecycle and connectivity events and adds immediate bounded payment-request polling.
app/src/test/java/to/bitkit/repositories/PrivatePaykitRepoTest.kt Covers discovery, persistence, and private link establishment for a receiver path published after contact creation.
app/src/test/java/to/bitkit/usecases/RefreshContactPaykitReceiversUseCaseTest.kt Verifies burst startup occurs only after successful contact receiver refresh.
app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt Updates request-polling coverage for immediate and periodic refresh behavior.
changelog.d/next/1141.fixed.md Documents the reduced delay for private payment requests.

Sequence Diagram

sequenceDiagram
    participant Event as Contact / Foreground / Network Event
    participant VM as AppViewModel
    participant Repo as PrivatePaykitRepo
    participant Pubky as PubkyService
    participant Paykit as Paykit SDK
    participant Requests as PaymentRequestRepo

    Event->>VM: Trigger private synchronization
    VM->>Repo: startInitialLinkBurst(contactKeys)
    loop Every 2 seconds for bounded window
        Repo->>Pubky: discoverRelevantReceiverPaths(contact)
        Pubky-->>Repo: Supported receiver paths
        Repo->>Pubky: Persist newly discovered paths
        Repo->>Paykit: Ensure private links/endpoints
        VM->>Requests: Refresh incoming requests
    end
Loading

Reviews (2): Last reviewed commit: "fix: stop retrying removed paykit reques..." | Re-trigger Greptile

@ben-kaufman ben-kaufman closed this Aug 6, 2026
@ben-kaufman ben-kaufman reopened this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant