UI shows raw 'Failure.errorFailure(message: …)' text in six error messages
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Dart
- 星标
- 2
- 派生
- 2
- 平均合并
- 3 天 5 小时
- 30 天内合并 PR
- 10
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
basictech01/uniun 的其他 Issue
-
documentation good first issue P3-Low
难度 2/5 1-3 小时 新手友好度 78/100
basictech01/uniun#328 ·
维护者通常 2 天内回复
-
bug good first issue P2-Medium
难度 2/5 1-3 小时 新手友好度 64/100
basictech01/uniun#305 ·
维护者通常 2 天内回复
-
enhancement P2-Medium
难度 5/5 一周以上 新手友好度 35/100
basictech01/uniun#329 ·
维护者通常 2 天内回复
-
bug good first issue P2-Medium
难度 3/5 1-2 天 新手友好度 52/100
basictech01/uniun#324 ·
维护者通常 2 天内回复
-
bug good first issue
难度 4/5 3-5 天 新手友好度 18/100
basictech01/uniun#316 ·
维护者通常 2 天内回复
查看 basictech01/uniun 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 73/100
TomBursch/kitchenowl#1255 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 78/100
maplibre/flutter-maplibre#709 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
getlantern/lantern#9387 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
bannzai/medicalarm#602 · 2 条评论 ·
维护者通常 1 天内回复