Repository navigation
fix(desktop): Host 被外部结束或原生崩溃时,不再把最后一行 stderr 当作原因 - #239
Merged
Merged
Conversation
有用户看到「exited with 3221225477: [dsh-wechat] login failed: Login timeout」, 而微信超时是约 24 小时前的日志;另一例 0x40010004 是进程被外部结束,提示却引用了插件的二维码超时。 - 0x40010004、0xC000013A 标为「从应用外部结束」; - 其他 NTSTATUS 失败码标为原生崩溃,并注明最后输出可能无关; - 普通退出码保持原样。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
问题
Host 退出时,官方的退出信息会把 Host 最后一行 stderr 接在后面,看起来像是退出原因。实际遇到的两例:
dsh desktop host exited with 3221225477: [dsh-wechat] login failed: Login timeout:3221225477 是 0xC0000005 访问冲突,那条微信超时日志是约 24 小时前打印的。用户和排查的人都会被这条信息引向无关的插件。
改动
dsh-electron/scripts/host-quit-adaptation.mjs新增adaptHostExit,构建原生外壳时与已有的adaptHostQuit一起作用于官方host-process.mjs:(ended from outside the app; last output: …)(native crash 0xC0000005; last output, possibly unrelated: …);没有 stderr 时只写(native crash 0x…)锚点同时匹配源码的单引号写法和 esbuild 输出的双引号写法;锚点不唯一时构建失败,不会悄悄跳过。
测试
dsh-electron/tests/host-quit-adaptation.test.mjs新增两项:覆盖上表各种退出码和无 stderr 的情况,以及两种引号写法。node --test dsh-electron/tests/*.test.mjs:256 通过,0 失败。host-process.mjs上的锚点由 CI 的原生外壳构建检查。source-receipt.json已刷新(保留 createdAt),audit-eduwork-distribution --verify-receipt无错误。🤖 Generated with Claude Code