UI shows raw 'Failure.errorFailure(message: …)' text in six error messages
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
Direzione di ricerca
Read lib/core/error/failures.dart and test/TESTING.md, then inspect the six listed UI call sites and the four exception-wrapping call sites in gana_engine.dart and receive_share_bloc.dart. Trace whether the wrapped errors reach a screen, and add the requested widget tests for each UI spot. Done when the SnackBars show boom without the union text and the other listed paths use the message where it reaches users.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What users see
Some error messages show Dart's internal text instead of the message. For example, a failed relay add shows
Could not add relay: Failure.errorFailure(message: connection refused)
instead of Could not add relay: connection refused.
Cause
Failure is a freezed union, so toString() prints the variant name and field (Failure.errorFailure(message: …)). Failure.toMessage() (lib/core/error/failures.dart) returns just the message, and 49 call sites already use it. These six UI spots call toString() instead:
| File | Line | Shown to the user |
|---|---|---|
lib/common/widgets/relay_selector_field.dart |
113 | add-relay error |
lib/features/settings/widgets/identity_card.dart |
389 | add-relay error |
lib/features/settings/widgets/identity_card.dart |
429 | relay error |
lib/features/settings/widgets/logout_button.dart |
126 | logout error |
lib/common/qr/uniun_qr_scanner_page.dart |
120 | QR-login failed |
lib/common/qr/uniun_qr_scanner_page.dart |
158 | follow from QR failed |
Four more spots wrap f.toString() in an exception: gana_engine.dart lines 616, 642 and 693, and receive_share_bloc.dart line 305. That raw text then becomes the exception's message. Check whether any of it reaches the screen, for example a Gana run's failure reason.
Fix
- Replace
f.toString()withf.toMessage()at each UI spot. - For each spot, add a widget test that makes the use case return
Left(Failure.errorFailure('boom'))and expectsboomwithoutFailure.errorFailure(in the SnackBar. Followtest/TESTING.md.
Small and self-contained, so a good first issue.
- Lingua principale
- Dart
- Stelle
- 2
- Fork
- 2
- Merge medio
- 3g 5h
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 basictech01/uniun
-
documentation good first issue P3-Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
basictech01/uniun#328 ·
I maintainer di solito rispondono entro 2 giorni
-
bug good first issue P2-Medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
basictech01/uniun#305 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement P2-Medium
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
basictech01/uniun#329 ·
I maintainer di solito rispondono entro 2 giorni
-
bug good first issue P2-Medium
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
basictech01/uniun#324 ·
I maintainer di solito rispondono entro 2 giorni
-
app performance is slowApertabug good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
basictech01/uniun#316 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di basictech01/uniun
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
TomBursch/kitchenowl#1255 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
maplibre/flutter-maplibre#709 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
getlantern/lantern#9387 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
bannzai/medicalarm#602 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno