Repository navigation
Replies: 1 comment
|
The diagnosis and regex change are correct. For an affected user, first confirm the reservation with For the recovery path, classify |
|
The diagnosis and regex change are correct. For an affected user, first confirm the reservation with For the recovery path, classify |
Uh oh!
There was an error while loading. Please reload this page.
摘要
当桌面端的本地 webserver 因端口落入 Windows 保留端口区间(由 Hyper-V / WSL 通过
winnat服务动态预留)而无法绑定时,net.Server.listen()会以EACCES: permission denied拒绝——而不是EADDRINUSE。fatal-recovery弹窗目前只特殊处理listen EADDRINUSE,因此EACCES会落到通用路径。结果用户看到的是误导性的提示「如果应用文件缺失或损坏,请关闭应用并重新安装」,并被提供「禁用第三方插件」按钮——这两者都与实际问题毫无关系。复现步骤
在启用了 Hyper-V / WSL / Docker Desktop(WSL2 后端)的 Windows 机器上,
winnat服务会预留一段动态 TCP 端口区间:listen EACCES: permission denied 127.0.0.1:<port>。崩溃日志片段:
当前行为
期望行为
EACCES(端口被保留 / 权限拒绝)导致的监听地址冲突,并给出准确建议(例如「该端口被系统保留;重启以获得其他端口,或停止 Hyper-V / WSL」)。EADDRINUSE的处理保持一致。根因分析
apps/desktop/src/fatal-recovery.ts用以下方式判断监听冲突:该正则只匹配
EADDRINUSE。Windows 的保留端口冲突表现为EACCES(其他地址失败表现为EADDRNOTAVAIL),因此被误判为通用启动失败。修复建议
扩大监听冲突的检测范围,覆盖其余
listen地址错误,并使用准确、可操作的文案:并新增
startupAddressUnavailable文案(中英文),同时覆盖「已有其他实例运行」与「端口被系统保留(如 Hyper-V / WSL)」两种情况。完整的补丁(含测试)附在下方。全部 24 个
fatal-recovery测试均通过。补丁(diff)
环境
@deepseek-ai/dsh-desktop0.2.0-rc.2win32 x64,Electron 44.0.0,Node 24.18.1winnat/ Hyper-V / WSL)All reactions