NWC: the wallet balance is read once at connect and never refreshed
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend-api-design, mobile
Línea de trabajo
Start with lib/features/settings/providers/nwc_provider.dart and the Rust bridge at lib/src/rust/api/nwc.dart; trace connectWallet, payInvoice, trade success, wallet screen opening, and app resume to find the refresh points. Treat failed refreshes as unknown without displaying zero. Add the provider and widget tests described in the issue; done means the wallet screen shows the updated balance after each refresh trigger and the tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context
NwcNotifier keeps balanceSats in NwcWalletState, and the connected wallet screen shows it (nwcBalanceSats). It has an updateBalance(int? sats) method "from a get_balance result" (lib/features/settings/providers/nwc_provider.dart:66), and the Rust bridge exposes getBalance() (lib/src/rust/api/nwc.dart:37).
What happens
Nothing calls updateBalance, and nothing calls getBalance(). The balance shown is the one read once in connectWallet (at connect, or when reconnecting at startup). After the wallet pays a hold invoice, or receives a payout from a make_invoice it generated, the settings screen keeps showing the old balance until the app restarts. That figure can be off by the whole trade amount, and the user may decide whether to pay with the wallet based on it.
How to fix
- Refresh the balance (
getBalance()→updateBalance) when the wallet screen opens, after a successfulpayInvoice, after a trade where the wallet generated the payout invoice reaches success, and on app resume. - Treat a failed refresh as "unknown" (keep the last value and mark it stale, or hide it). Don't show 0.
- Add a provider test: after
updateBalanceis wired to a fakegetBalance, the state changes. Add a widget test that the wallet screen shows the refreshed figure.
- Lenguaje dominante
- Dart
- Estrellas
- 11
- Forks
- 9
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MostroP2P/app
-
documentation priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
area: ui bug priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
NWC: the pay and buyer-invoice readouts are zero-size, so no accessibility tree carries themAbiertoarea: ui bug priority: high
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Bug: Button "Share logs" does nothingPosiblemente ocupada @Luquitasjeffrey la tomó hace 8 días. Abierto
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
area: rust-core bug priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
Todos los issues de MostroP2P/app
Issues similares
-
Python example: list a model's scenes and their camerasPosiblemente ocupada @rudraparmar76 la tomó hoy. Abiertodocumentation good first issue python
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
iamahsanmehmood/openskp#796 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Plural rendering: first matching part wins, but gen-l10n lets the last one win (=1 shadows one)Abiertobug help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
crowdin/flutter-sdk#97 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
MrSpideyNihal/lockfeed#16 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
InlitX/GymMane#529 · 1 comentario ·
Los mantenedores suelen responder en 1 día