@@ -92,17 +92,6 @@ export async function activate(context: vscode.ExtensionContext) {
9292 const remoteConnector = new RemoteConnector ( context , sessionService , hostService , experiments , logger , telemetryService , notificationService , remoteService ) ;
9393 context . subscriptions . push ( remoteConnector ) ;
9494
95- context . subscriptions . push ( vscode . window . registerUriHandler ( {
96- handleUri ( uri : vscode . Uri ) {
97- // logger.trace('Handling Uri...', uri.toString());
98- if ( uri . path === GitpodServer . AUTH_COMPLETE_PATH ) {
99- authProvider . handleUri ( uri ) ;
100- } else {
101- remoteConnector . handleUri ( uri ) ;
102- }
103- }
104- } ) ) ;
105-
10695 remoteConnectionInfo = getGitpodRemoteWindowConnectionInfo ( context ) ;
10796 vscode . commands . executeCommand ( 'setContext' , 'gitpod.remoteConnection' , ! ! remoteConnectionInfo ) ;
10897
@@ -121,13 +110,21 @@ export async function activate(context: vscode.ExtensionContext) {
121110 // Backwards compatibility with older gitpod-remote extensions
122111 commandManager . register ( { id : 'gitpod.api.autoTunnel' , execute : ( ) => { } } ) ;
123112
124- if ( ! context . globalState . get < boolean > ( FIRST_INSTALL_KEY , false ) ) {
125- context . globalState . update ( FIRST_INSTALL_KEY , true ) ;
126- telemetryService . sendTelemetryEvent ( 'gitpod_desktop_installation' , { gitpodHost : hostService . gitpodHost , kind : 'install' } ) ;
127- }
113+ const firstLoadPromise = sessionService . didFirstLoad . then ( ( ) => remoteConnector . updateSSHRemotePlatform ( ) ) ;
114+
115+ context . subscriptions . push ( vscode . window . registerUriHandler ( {
116+ handleUri ( uri : vscode . Uri ) {
117+ // logger.trace('Handling Uri...', uri.toString());
118+ if ( uri . path === GitpodServer . AUTH_COMPLETE_PATH ) {
119+ authProvider . handleUri ( uri ) ;
120+ } else {
121+ firstLoadPromise . then ( ( ) => remoteConnector . handleUri ( uri ) ) ;
122+ }
123+ }
124+ } ) ) ;
128125
129126 // Because auth provider implementation is in the same extension, we need to wait for it to activate first
130- sessionService . didFirstLoad . then ( async ( ) => {
127+ firstLoadPromise . then ( async ( ) => {
131128 if ( remoteConnectionInfo ) {
132129 remoteSession = new RemoteSession ( remoteConnectionInfo . connectionInfo , context , remoteService , hostService , sessionService , experiments , logger ! , telemetryService ! , notificationService ) ;
133130 await remoteSession . initialize ( ) ;
@@ -141,6 +138,11 @@ export async function activate(context: vscode.ExtensionContext) {
141138 }
142139 } ) ;
143140
141+ if ( ! context . globalState . get < boolean > ( FIRST_INSTALL_KEY , false ) ) {
142+ context . globalState . update ( FIRST_INSTALL_KEY , true ) ;
143+ telemetryService . sendTelemetryEvent ( 'gitpod_desktop_installation' , { gitpodHost : hostService . gitpodHost , kind : 'install' } ) ;
144+ }
145+
144146 success = true ;
145147 } finally {
146148 const rawActivateProperties = {
0 commit comments