UI shows raw 'Failure.errorFailure(message: …)' text in six error messages
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 78/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Dart
- Estrelas
- 2
- Forks
- 2
- Merge médio
- 3d 5h
- PRs com merge (30d)
- 10
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de basictech01/uniun
-
documentation good first issue P3-Low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
basictech01/uniun#328 ·
Mantenedores costumam responder em até 2 dias
-
bug good first issue P2-Medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
basictech01/uniun#305 ·
Mantenedores costumam responder em até 2 dias
-
enhancement P2-Medium
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
basictech01/uniun#329 ·
Mantenedores costumam responder em até 2 dias
-
bug good first issue P2-Medium
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
basictech01/uniun#324 ·
Mantenedores costumam responder em até 2 dias
-
app performance is slowAbertabug good first issue
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 18/100
basictech01/uniun#316 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de basictech01/uniun
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
TomBursch/kitchenowl#1255 ·
Mantenedores costumam responder em até 1 dia
-
Backend Subtask SW VTA
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 82/100
aau-giraf/visual-tangible-artefacts#507 ·
Mantenedores costumam responder em até 1 dia
-
documentation good first issue p1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
VeryGoodOpenSource/vgv-ai-flutter-plugin#217 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug useful
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
hiddify/hiddify-app#2709 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
ccch1mneyyy/dsh-Go#2068 ·
Mantenedores costumam responder em até 1 dia