Fix auto forward cache (#185997)

This commit is contained in:
Alex Ross
2023-06-23 07:51:49 -07:00
committed by GitHub
parent 06197f020d
commit b34f54ccec
@@ -743,7 +743,7 @@ export class TunnelModel extends Disposable {
async close(host: string, port: number, reason: TunnelCloseReason): Promise<void> {
const key = makeAddress(host, port);
const oldTunnel = this.forwarded.get(key)!;
if (reason === TunnelCloseReason.AutoForwardEnd) {
if ((reason === TunnelCloseReason.AutoForwardEnd) && oldTunnel && (oldTunnel.source.source === TunnelSource.Auto)) {
this.sessionCachedProperties.set(key, {
local: oldTunnel.localPort,
name: oldTunnel.name,