UI shows raw 'Failure.errorFailure(message: …)' text in six error messages
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 78/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Dart
- Stars
- 2
- Forks
- 2
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- No 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 basictech01/uniun
-
documentation good first issue P3-Low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
basictech01/uniun#328 ·
Maintainers usually reply within 2 days
-
bug good first issue P2-Medium
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
basictech01/uniun#305 ·
Maintainers usually reply within 2 days
-
enhancement P2-Medium
Difficulty 5/5 Over a week Newbie friendliness 35/100
basictech01/uniun#329 ·
Maintainers usually reply within 2 days
-
bug good first issue P2-Medium
Difficulty 3/5 1-2 days Newbie friendliness 52/100
basictech01/uniun#324 ·
Maintainers usually reply within 2 days
-
bug good first issue
Difficulty 4/5 3-5 days Newbie friendliness 18/100
basictech01/uniun#316 ·
Maintainers usually reply within 2 days
All issues in basictech01/uniun
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
TomBursch/kitchenowl#1255 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
maplibre/flutter-maplibre#709 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
getlantern/lantern#9387 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
bannzai/medicalarm#602 · 2 comments ·
Maintainers usually reply within 1 day