@@ -102,6 +102,7 @@ export default class RemoteConnector extends Disposable {
102
102
103
103
public static AUTH_COMPLETE_PATH = '/auth-complete' ;
104
104
private static LOCK_COUNT = 0 ;
105
+ private static SSH_DEST_KEY = 'ssh-dest:' ;
105
106
106
107
constructor ( private readonly context : vscode . ExtensionContext , private readonly logger : Log , private readonly telemetry : TelemetryReporter ) {
107
108
super ( ) ;
@@ -662,6 +663,8 @@ export default class RemoteConnector extends Disposable {
662
663
if ( password ) {
663
664
await this . showSSHPasswordModal ( password ) ;
664
665
}
666
+
667
+ this . telemetry . sendTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'gateway' , status : 'connected' , ...params } ) ;
665
668
} catch ( e ) {
666
669
this . telemetry . sendTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'gateway' , status : 'failed' , reason : e . toString ( ) , ...params } ) ;
667
670
if ( e instanceof NoSSHGatewayError ) {
@@ -700,6 +703,8 @@ export default class RemoteConnector extends Disposable {
700
703
const localAppDestData = await this . getWorkspaceLocalAppSSHDestination ( params ) ;
701
704
sshDestination = localAppDestData . localAppSSHDest ;
702
705
localAppSSHConfigPath = localAppDestData . localAppSSHConfigPath ;
706
+
707
+ this . telemetry . sendTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'local-app' , status : 'connected' , ...params } ) ;
703
708
} catch ( e ) {
704
709
this . logger . error ( `Failed to connect ${ params . workspaceId } Gitpod workspace:` , e ) ;
705
710
if ( e instanceof LocalAppError ) {
@@ -726,7 +731,7 @@ export default class RemoteConnector extends Disposable {
726
731
727
732
await this . updateRemoteSSHConfig ( usingSSHGateway , localAppSSHConfigPath ) ;
728
733
729
- await this . context . globalState . update ( sshDestination ! , params ) ;
734
+ await this . context . globalState . update ( ` ${ RemoteConnector . SSH_DEST_KEY } ${ sshDestination ! } ` , params ) ;
730
735
731
736
vscode . commands . executeCommand (
732
737
'vscode.openFolder' ,
@@ -786,31 +791,32 @@ export default class RemoteConnector extends Disposable {
786
791
if ( vscode . env . remoteName === 'ssh-remote' && this . context . extension . extensionKind === vscode . ExtensionKind . UI && remoteUri ) {
787
792
const [ , sshDestStr ] = remoteUri . authority . split ( '+' ) ;
788
793
const sshDest = parseSSHDest ( sshDestStr ) ;
789
- const usingSSHGateway = typeof sshDest !== 'string' ;
790
794
791
795
const connectionSuccessful = await isRemoteExtensionHostRunning ( ) ;
792
- const connectionInfo = this . context . globalState . get < SSHConnectionParams > ( sshDestStr ) ;
796
+ const connectionInfo = this . context . globalState . get < SSHConnectionParams > ( ` ${ RemoteConnector . SSH_DEST_KEY } ${ sshDestStr } ` ) ;
793
797
if ( connectionInfo ) {
794
- const kind = usingSSHGateway ? 'gateway' : 'local-app' ;
795
- if ( connectionSuccessful ) {
796
- this . telemetry . sendTelemetryEvent ( 'vscode_desktop_ssh' , {
797
- kind,
798
- status : 'connected' ,
799
- instanceId : connectionInfo . instanceId ,
800
- workspaceId : connectionInfo . workspaceId ,
801
- gitpodHost : connectionInfo . gitpodHost
802
- } ) ;
803
- } else {
804
- this . telemetry . sendTelemetryEvent ( 'vscode_desktop_ssh' , {
805
- kind,
806
- status : 'failed' ,
807
- reason : 'remote-ssh extension: connection failed' ,
808
- instanceId : connectionInfo . instanceId ,
809
- workspaceId : connectionInfo . workspaceId ,
810
- gitpodHost : connectionInfo . gitpodHost
811
- } ) ;
812
- }
813
- await this . context . globalState . update ( remoteUri . authority , undefined ) ;
798
+ sshDest ;
799
+ // const usingSSHGateway = typeof sshDest !== 'string';
800
+ // const kind = usingSSHGateway ? 'gateway' : 'local-app';
801
+ // if (connectionSuccessful) {
802
+ // this.telemetry.sendTelemetryEvent('vscode_desktop_ssh', {
803
+ // kind,
804
+ // status: 'connected',
805
+ // instanceId: connectionInfo.instanceId,
806
+ // workspaceId: connectionInfo.workspaceId,
807
+ // gitpodHost: connectionInfo.gitpodHost
808
+ // });
809
+ // } else {
810
+ // this.telemetry.sendTelemetryEvent('vscode_desktop_ssh', {
811
+ // kind,
812
+ // status: 'failed',
813
+ // reason: 'remote-ssh extension: connection failed',
814
+ // instanceId: connectionInfo.instanceId,
815
+ // workspaceId: connectionInfo.workspaceId,
816
+ // gitpodHost: connectionInfo.gitpodHost
817
+ // });
818
+ // }
819
+ await this . context . globalState . update ( `${ RemoteConnector . SSH_DEST_KEY } ${ sshDestStr } ` , undefined ) ;
814
820
}
815
821
816
822
return connectionSuccessful ;
0 commit comments