Skip to content

Commit 6d28a43

Browse files
committed
fix: connection close lifecycle bug
1 parent d3c9cd2 commit 6d28a43

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

client/src/connection/ssh/index.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,13 @@ export class SSHSession extends Session {
131131
};
132132

133133
private onConnectionClose = () => {
134-
if (!this._sessionReady) {
135-
this._reject?.(new Error(l10n.t("Could not connect to the SAS server.")));
136-
}
134+
this._stream = undefined;
135+
this._resolve = undefined;
136+
this._reject = undefined;
137+
this._html5FileName = "";
138+
this._workDirectory = undefined;
139+
this.clearAuthState();
140+
sessionInstance = undefined;
137141
};
138142

139143
private onConnectionError = (err: Error) => {
@@ -176,14 +180,7 @@ export class SSHSession extends Session {
176180
};
177181

178182
private onStreamClose = (): void => {
179-
this._stream = undefined;
180-
this._resolve = undefined;
181-
this._reject = undefined;
182-
this._html5FileName = "";
183-
this.clearAuthState();
184-
this._workDirectory = undefined;
185183
this._conn.end();
186-
sessionInstance = undefined;
187184
updateStatusBarItem(false);
188185
};
189186

0 commit comments

Comments
 (0)