Repository navigation
v0.8.6:SSH 连接失败崩溃修复 / SSH Connection Failure Crash Fix
中文
修复
- 🔴 修复 SSH 连接失败导致桌面端崩溃:连接网络不可达的主机(如 ProxyJump 配错)时,底层 socket 的
error事件在connectClientreject 之后仍可能异步触发;若无监听器则未捕获异常直接掀翻进程。在connect()和buildJumpChain()中提前注册防御性error监听器,捕获并记录这些异步错误。 - 修复连接失败后会话状态不正确:首次连接失败时状态机通过
transition(state, { type: 'fail' })进入reconnect-exhausted终态,会话记录保留让前端能看到错误日志与状态,不再被误标为"已连接"。 - 修复前端活跃会话判定:
isActiveSession将reconnect-exhausted视为终态,连接失败的主机不再在连接表单中显示"已连接"标记。 - 修复
connectError字段回归:补回 catch 块中record.connectError赋值,恢复前端红色错误消息显示与use-session-polling失败检测回调。 - 简化
connectClient内部结构:删除与外层调用方重复注册的空函数defenseHandler及其try/finally包裹,恢复线性代码结构。
English
Fixes
- 🔴 Fix desktop crash on SSH connection failure: When connecting to an unreachable host (e.g. misconfigured ProxyJump), the underlying socket
errorevent may fire asynchronously afterconnectClientrejects; without a listener, the uncaught exception crashes the process. Defensiveerrorlisteners are now registered early inconnect()andbuildJumpChain()to catch and log these async errors. - Fix incorrect session state after connection failure: On first connection failure, the state machine transitions to
reconnect-exhaustedterminal state viatransition(state, { type: 'fail' }). The session record is retained so the frontend can display error logs and status, instead of being incorrectly marked as "connected". - Fix frontend active session detection:
isActiveSessionnow treatsreconnect-exhaustedas a terminal state; a host whose connection failed no longer shows an "connected" badge in the connect form. - Fix
connectErrorfield regression: Restoredrecord.connectErrorassignment in the catch block, recovering the frontend red error message display and theuse-session-pollingfailure detection callback. - Simplify
connectClientinternal structure: Removed the redundant emptydefenseHandlerfunction (duplicated with the caller's listener) and itstry/finallywrapper, restoring the linear code structure.
Full Changelog: v0.8.5...v0.8.6