From edb66effd96ee76096f57534813a6629eb287934 Mon Sep 17 00:00:00 2001 From: STRIX Date: Tue, 8 Sep 2026 14:48:17 +0800 Subject: [PATCH] T6 review: suppress orphaned open() timer rejection when sendPacket fails first --- entry/src/main/ets/ssh/Channel.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entry/src/main/ets/ssh/Channel.ts b/entry/src/main/ets/ssh/Channel.ts index c8e9ef8..65f28b0 100644 --- a/entry/src/main/ets/ssh/Channel.ts +++ b/entry/src/main/ets/ssh/Channel.ts @@ -84,6 +84,12 @@ export class SshChannel { } }, timeoutMs); }); + // If sendPacket below throws first, the timer above would later reject + // a promise nobody awaits; mark it handled (await below still throws). + opened.catch((e: Object): void => { + const err = e as Error; + Log.debug(SshChannel.TAG, `open wait aborted: ${err.message}`); + }); await this.transport.sendPacket(w.toBytes()); await opened; }