NWC: a failed wallet payment drops the seller into the manual QR without saying why
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- internationalization, mobile, testing
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Dart
- Stelle
- 11
- Fork
- 9
- Merge medio
- 2g 1h
- PR unite (30g)
- 16
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MostroP2P/app
-
documentation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
area: ui bug priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
area: ui bug priority: high
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Bug: Button "Share logs" does nothingForse già presa @Luquitasjeffrey l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
area: rust-core bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MostroP2P/app
Issue simili
-
Python example: list a model's scenes and their camerasForse già presa @rudraparmar76 l’ha presa oggi. Apertadocumentation good first issue python
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
iamahsanmehmood/openskp#796 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Plural rendering: first matching part wins, but gen-l10n lets the last one win (=1 shadows one)Apertabug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
crowdin/flutter-sdk#97 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
MrSpideyNihal/lockfeed#16 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
InlitX/GymMane#529 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno