NWC: a failed wallet payment drops the seller into the manual QR without saying why
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- internationalization, mobile, testing
Research direction
Start with NwcPaymentWidget._pay in lib/shared/widgets/nwc_payment_widget.dart and trace onFallbackToManual to the screen that displays the manual QR. Read the invoice failure warning in NwcInvoiceWidget and check the existing localization and widget test patterns. Add a localized failure message for wallet errors and timeouts, then verify the relevant widget tests show the reason above the QR.
Written by the indexing model from the issue text.
Description
Context
When the seller presses "pay with wallet", NwcPaymentWidget._pay (lib/shared/widgets/nwc_payment_widget.dart:40-58) calls nwc_api.payInvoice. On any failure, whether a NIP-47 error from the wallet, a timeout or an exception, it calls onFallbackToManual, and the screen switches to the manual QR.
What happens
The reason is only printed (debugPrint('NWC payment failed: ${result.error}') / debugPrint('NWC payment error: $e')). The seller sees the screen change from a pay button to a QR with no message: nothing says the wallet refused, that it lacked balance, or that it never answered. "Insufficient balance", "the wallet is unreachable", "quota exceeded" and "restricted" all look the same, and none looks like an error. A user can easily believe the payment went through, or pay the QR from a second wallet without knowing why the first one failed.
The invoice side already does better: NwcInvoiceWidget shows a warning icon and a message when generation fails (line 109).
Mortsom's nwc_payment_refused_then_manual (INSUFFICIENT_BALANCE) and nwc_wallet_unreachable_then_manual (no answer) both pass. The fallback works, but the only evidence of why it happened is the harness's own wallet log.
How to fix
- Pass the failure to the screen:
onFallbackToManual(String reason), or an enum built from the NIP-47 error code (INSUFFICIENT_BALANCE,QUOTA_EXCEEDED,RESTRICTED,PAYMENT_FAILED, timeout). - When the screen switches to manual, show it as a localized banner above the QR, or as a snackbar, e.g. "Your wallet could not pay: insufficient balance. Pay this invoice from another wallet or cancel the trade."
- Optional, and a contract change: expose the reason on an automation readout (e.g.
pay.nwc.error, labelled with the code), so automation can assert the right failure was reported. - Add widget tests for each mapped code and for the timeout.
- Dominant language
- Dart
- Stars
- 11
- Forks
- 9
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 16
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MostroP2P/app
-
documentation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
area: ui bug priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area: ui bug priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Bug: Button "Share logs" does nothingPossibly taken @Luquitasjeffrey claimed this 7 days ago. Open
Difficulty 2/5 Half a day Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
area: rust-core bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Python example: list a model's scenes and their camerasPossibly taken @rudraparmar76 claimed this today. Opendocumentation good first issue python
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
iamahsanmehmood/openskp#796 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Plural rendering: first matching part wins, but gen-l10n lets the last one win (=1 shadows one)Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
crowdin/flutter-sdk#97 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
MrSpideyNihal/lockfeed#16 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
InlitX/GymMane#529 · 1 comment ·
Maintainers usually reply within 1 day