Repository navigation
[BUG] 一条非法凭据记录 / 一个带 BOM 的 JSON 会让桌面端永久无法启动(0.2.2-rc.1) #12987
Derek261109
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
两个互相独立的触发点,任意一个都会让 App 起不来:
modifyRecord('synology-nas', …)(缺/)时写入成功,下次启动parseRecords()→parseCredentialKey()抛 TypeError → credentials 激活失败 → 整个 App fatal。把插件从 bundles 里移除也救不回来,坏数据仍在.credentials.yaml里。storage-json的parse()直接JSON.parse(text),用 Windows PowerShell-Encoding UTF8改过一次storages/workspace.json就带 BOM,报unit 'workspace': file is not valid JSON,同样 fatal。建议:写入边界加
parseCredentialKey()运行时校验;读取时对坏记录/坏 unit 做「隔离 + 警告」而不是 fatal;JSON.parse(text.replace(/^\uFEFF/, ''))剥离 BOM。详细复现步骤、源码位置、修复建议见附件(完整报告 md)。
补充:我手工修复数据后已恢复正常,5 个历史会话、39 个附件、工作区、登录态全部完好 —— 崩溃与数据损坏无关,纯粹是这两个文件格式问题。
All reactions