Skip to content

fix: expose rejected incoming payment requests - #1217

Open
ovitrif wants to merge 3 commits into
masterfrom
codex/1209-payment-request-errors
Open

fix: expose rejected incoming payment requests#1217
ovitrif wants to merge 3 commits into
masterfrom
codex/1209-payment-request-errors

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1209

Description

  • Records stable parse, resolution, and presentation failure reasons while redacting payment-request counterparties.
  • Retries explicitly opened payment requests 15 times before showing localized terminal feedback and keeping the request actionable.
  • Adds accessibility tags, regression coverage, documentation, and a reproducible rejected-request journey.

Preview

The existing error toast reports that the payment request is no longer available. The request row remains visible and actionable so the user can retry or dismiss it.

QA Notes

Manual Tests

  • 1. Sender Receive → Payment Request Details → request 1 sat from a saved contact → Payment Request Sent: request reaches the receiver.
  • 2. Sender Settings → disable Paykit → receiver Home → Payment Requests in-sheet → tap Pay: 15 attempts run at two-second intervals, then the localized unavailable toast appears.
  • 3. Payment Requests in-sheet after terminal feedback → use the same row: it remains available for retry or dismissal.

Automated Checks

  • Unit tests added in PaykitPaymentRequestDiagnosticsTest.kt: verify parse and presentation diagnostics redact valid and invalid counterparties.
  • Unit tests modified in PaykitPaymentRequestRepoTest.kt and PublicPaykitRepoTest.kt: cover stable parse and resolution failure reasons.
  • Unit tests modified in AppViewModelSendFlowTest.kt: cover 15 explicit attempts, localized terminal feedback, and request-sheet restoration.
  • Instrumented tests modified in PaymentRequestsScreenTest.kt: cover stable request, Pay, and Dismiss accessibility tags; the focused class passes 5/5 on API 37 and 5/5 on API 36.
  • CI: standard build, unit test, lint, detekt, and E2E checks pass.

The full two-wallet journey passed on API 37: a delivered 1-sat request became unresolvable after its sender disabled Paykit, produced 15 redacted resolution_failed attempts, showed terminal feedback, and returned to the request sheet with the same row actionable. The full connected suite remains blocked by the unrelated existing OnchainServiceTests.testDeriveRegtestDescriptorsForSupportedAccountTypes failure; the focused payment-request UI class passes on API 37 and API 36.

@ovitrif
ovitrif marked this pull request as ready for review September 2, 2026 00:55
@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown

Greptile Summary

The PR exposes previously silent incoming Paykit request failures while preserving failed requests for manual retry or dismissal.

  • Adds stable, redacted diagnostics for request parsing and presentation failures.
  • Gives explicitly opened requests fourteen delayed retries after the initial attempt, then shows localized terminal feedback and restores the request list when appropriate.
  • Adds payment-request accessibility tags, regression tests, documentation, changelog coverage, and a reproducible failure journey.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issue identified.

The parsing refactor preserves existing eligibility checks, diagnostics redact counterparties, and the explicit retry sequence matches the documented immediate attempt plus fourteen delayed attempts before terminal feedback.

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/repositories/PaykitPaymentRequestRepo.kt Refactors request parsing into reason-specific results and adds redacted diagnostics without changing the accepted request contract.
app/src/main/java/to/bitkit/repositories/PublicPaykitRepo.kt Maps endpoint-resolution outcomes to stable incoming-request failure categories.
app/src/main/java/to/bitkit/repositories/PrivatePaykitRepo.kt Preserves presentation errors for the view model instead of logging and obscuring their source locally.
app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt Adds explicit retry exhaustion feedback, request-list restoration, and detailed diagnostics across presentation and decoding failures.
app/src/main/java/to/bitkit/ui/screens/paymentrequests/PaymentRequestsScreen.kt Adds stable test and accessibility tags to request rows and actions.
app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt Expands regression coverage for retries, terminal feedback, and request-sheet restoration.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Incoming Paykit request] --> B[Parse and validate terms]
    B -->|Rejected| C[Record redacted diagnostic]
    B -->|Actionable| D[Resolve private payment details]
    D -->|Opened| E[Open normal send flow]
    D -->|Failed| F{Explicitly opened?}
    F -->|No| G[Retry using background cadence]
    F -->|Yes, attempts remain| H[Wait two seconds]
    H --> D
    F -->|Fifteenth failure| I[Show unavailable feedback]
    I --> J[Keep request available for retry or dismissal]
Loading

Reviews (1): Last reviewed commit: "chore: rename changelog fragment" | Re-trigger Greptile

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.

fix: expose rejected incoming payment requests

1 participant