Repository navigation
fix(portfolio): 保留真实失败分类并恢复失败态手动组合入口 - #364
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联问题与范围
Closes #298
#299 已完成失败详情本地化,本 PR 不重复该部分,只修复重新打开后剩余的状态处理问题:
fetchPortfolioAtom原先先分类再抛普通 Error,随后 catch 清空 failure 并统一回退 demo,导致真实失败卡片不可达。基于当前
main的9afa460,无其他 PR 依赖。修改说明
timeout/parse-error/provider-error清空旧快照、保留 failure,显示现有分类失败卡片,不用示例资产掩盖请求异常。not-connected/no-account-permission保持现有带徽标 demo,但保留 failure;成功的空账户仍保留原有 demo 行为,partial 仍显示真实数据与本地化警告。下一次成功清除旧错误和 demo 标记。AUTH_EXPIRED/TIMEOUT/PARSE_FAILURE和旧 LongBridge 错误码;适配器保留LONGBRIDGE_NOT_INSTALLED,不再塌缩为普通 provider error,不解析英文错误文案。完整回退策略、复现步骤和六张截图见 验收记录。
测试报告
环境:Windows x64,Bun 1.4.2,Node.js 22.16.0。
核心回归已验证先失败后通过。第一轮独立审阅发现的标准化错误码不匹配、手动组合入口消失两个 P2 已修复;第二轮独立审阅无新增 P1/P2,另独立复跑 22 项定向测试通过。
主进程集成测试使用真实
runProviderCall → ProviderFetchError → MarketDataService → toIpcResult → UI classifier,仅 stub Electron 原生宿主。UI 测试覆盖中英文失败状态、partial、示例回退、请求拒绝、失败后恢复及手动账户导航。全量测试的 10 项 skip 来自 Windows/Bash、真实账户 fixture 缺失、Windows 符号链接权限。最初沙箱运行曾因现有 Pi 测试无法创建
C:\tmp\pi失败;构建曾因 esbuild 无法读取上级目录失败;授权所需访问后重跑均通过。未调整生产逻辑或测试断言来绕过这些环境限制。本机安装时因下载限制设置了
ELECTRON_SKIP_BINARY_DOWNLOAD=1;E2E 通过ELECTRON_BINARY指向本机已有 Electron 可执行文件。正常完成 Electron 安装的环境直接运行上述命令即可。UI 截图与证据边界
脚本使用独立用户目录,启动构建后的真实应用,在主进程注入标准化后的
market:getPortfolio错误响应,经真实 preload/IPC、atom 与页面验收;手动入口场景另注入portfolio:listManual。这证明失败状态可达,不声称真实金融 Provider 在线验收。所有资产均为仓库示例或测试 fixture,无真实账号数据。顶部 LongBridge 安装提示来自验收机未安装 CLI,不属于本 PR 修复范围。
解析失败
超时
未连接时保留明确标记的示例组合
券商失败后仍可导入手动组合
不扩展新重试机制、金融计算、外部 Provider 接入或 #299 的本地化范围。