docs(plans): 记录 K19 网络文案修复
This commit is contained in:
1 parent
28d2679b83
commit
131f0c4e06
1 file changed
+97
@@ -2202,6 +2202,103 @@ $ flutter test
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 35. K19 非 ApiException 网络文案修复
|
||||||
|
|
||||||
|
### 35.1 缺陷与修复
|
||||||
|
|
||||||
|
Trae 复核发现,账号中心三个逻辑类在断网、超时等非 `ApiException`
|
||||||
|
失败时,把内部哨兵键直接交给 `errorText`,会原样上屏:
|
||||||
|
|
||||||
|
```text
|
||||||
|
accountProfileLoadFailed
|
||||||
|
accountProfileSaveFailed
|
||||||
|
accountDevicesLoadFailed
|
||||||
|
accountExportLoadFailed
|
||||||
|
```
|
||||||
|
|
||||||
|
修复严格沿用既有 `errorText` 约定:
|
||||||
|
|
||||||
|
- 非 `ApiException` 统一置 `networkError`;
|
||||||
|
- `ApiException.message` 继续原样透传;
|
||||||
|
- 未修改 `errorText` 映射表;
|
||||||
|
- 未修改既有测试断言。
|
||||||
|
|
||||||
|
修改位置:
|
||||||
|
|
||||||
|
```text
|
||||||
|
ReelShort/lib/pages/account/account_profile_logic.dart
|
||||||
|
ReelShort/lib/pages/account/account_devices_logic.dart
|
||||||
|
ReelShort/lib/pages/account/account_export_logic.dart
|
||||||
|
```
|
||||||
|
|
||||||
|
### 35.2 TDD 与定向测试
|
||||||
|
|
||||||
|
先给 `FakeAccountRepository` 增加通用异常开关,并新增四个页面测试。
|
||||||
|
修复前红灯:
|
||||||
|
|
||||||
|
```text
|
||||||
|
00:01 +4 -4: Some tests failed.
|
||||||
|
|
||||||
|
should_show_localized_network_copy_when_profile_load_fails
|
||||||
|
should_show_localized_network_copy_when_profile_save_fails
|
||||||
|
should_show_localized_network_copy_when_devices_fail
|
||||||
|
should_show_localized_network_copy_when_export_fails
|
||||||
|
```
|
||||||
|
|
||||||
|
修复后定向测试:
|
||||||
|
|
||||||
|
```text
|
||||||
|
$ flutter test test/account/account_pages_test.dart
|
||||||
|
00:01 +8: All tests passed!
|
||||||
|
```
|
||||||
|
|
||||||
|
四个用例分别使用中文、英文、印尼语当前语言环境,断言上屏
|
||||||
|
`l10n.networkError`,且不出现内部哨兵键。
|
||||||
|
|
||||||
|
### 35.3 最终门禁
|
||||||
|
|
||||||
|
```text
|
||||||
|
$ dart analyze lib test
|
||||||
|
Analyzing lib, test...
|
||||||
|
No issues found!
|
||||||
|
```
|
||||||
|
|
||||||
|
```text
|
||||||
|
$ flutter test
|
||||||
|
00:23 +339: All tests passed!
|
||||||
|
```
|
||||||
|
|
||||||
|
```text
|
||||||
|
$ flutter build apk --debug
|
||||||
|
Running Gradle task 'assembleDebug'... 7.2s
|
||||||
|
✓ Built build/app/outputs/flutter-apk/app-debug.apk
|
||||||
|
```
|
||||||
|
|
||||||
|
### 35.4 Git
|
||||||
|
|
||||||
|
```text
|
||||||
|
27ab7ce fix(account): 本地化网络异常文案
|
||||||
|
42ce1d1 fix(account): 合并网络异常文案修复
|
||||||
|
9b3ab9d..42ce1d1 develop -> develop
|
||||||
|
```
|
||||||
|
|
||||||
|
提交 author/committer 均为 `Zhou Weidong <502333560@qq.com>`。
|
||||||
|
|
||||||
|
### 35.5 用户验证建议
|
||||||
|
|
||||||
|
设备侧取证由用户执行:
|
||||||
|
|
||||||
|
1. 登录后断开手机网络,打开「个人资料」。
|
||||||
|
预期:显示当前语言的网络异常文案,不出现 `accountProfileLoadFailed`。
|
||||||
|
2. 恢复网络后修改昵称,再断网保存。
|
||||||
|
预期:显示当前语言的网络异常文案,不出现 `accountProfileSaveFailed`。
|
||||||
|
3. 断网打开「登录设备」。
|
||||||
|
预期:显示当前语言的网络异常文案,不出现 `accountDevicesLoadFailed`。
|
||||||
|
4. 断网打开「数据导出」。
|
||||||
|
预期:显示当前语言的网络异常文案,不出现 `accountExportLoadFailed`。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 34. K19 客户端账号中心
|
## 34. K19 客户端账号中心
|
||||||
|
|
||||||
### 34.1 基线与实施范围
|
### 34.1 基线与实施范围
|
||||||
|
|||||||
Reference in new issue
Block a user