@@ -1248,13 +1248,13 @@ class ChatSetupController extends Disposable {
1248
1248
let session : AuthenticationSession | undefined ;
1249
1249
let entitlement : ChatEntitlement | undefined ;
1250
1250
1251
- const installation = this . doInstall ( ) ;
1252
-
1253
1251
// Entitlement Unknown or `forceSignIn`: we need to sign-in user
1254
1252
if ( this . context . state . entitlement === ChatEntitlement . Unknown || options . forceSignIn ) {
1255
1253
this . setStep ( ChatSetupStep . SigningIn ) ;
1256
1254
const result = await this . signIn ( { useAlternateProvider : options . useAlternateProvider } ) ;
1257
1255
if ( ! result . session ) {
1256
+ this . doInstall ( ) ; // still install the extension in the background to remind the user to sign-in eventually
1257
+
1258
1258
const provider = options . useAlternateProvider ? defaultChat . alternativeProviderId : options . useEnterpriseProvider ? defaultChat . enterpriseProviderId : defaultChat . providerId ;
1259
1259
this . telemetryService . publicLog2 < InstallChatEvent , InstallChatClassification > ( 'commandCenter.chatInstall' , { installResult : 'failedNotSignedIn' , installDuration : watch . elapsed ( ) , signUpErrorCode : undefined , provider } ) ;
1260
1260
return undefined ; // treat as cancelled because signing in already triggers an error dialog
@@ -1266,7 +1266,7 @@ class ChatSetupController extends Disposable {
1266
1266
1267
1267
// Await Install
1268
1268
this . setStep ( ChatSetupStep . Installing ) ;
1269
- success = await this . install ( session , entitlement ?? this . context . state . entitlement , providerId , watch , installation , options ) ;
1269
+ success = await this . install ( session , entitlement ?? this . context . state . entitlement , providerId , watch , options ) ;
1270
1270
} finally {
1271
1271
this . setStep ( ChatSetupStep . Initial ) ;
1272
1272
this . context . resume ( ) ;
@@ -1300,7 +1300,7 @@ class ChatSetupController extends Disposable {
1300
1300
return { session, entitlement : entitlements ?. entitlement } ;
1301
1301
}
1302
1302
1303
- private async install ( session : AuthenticationSession | undefined , entitlement : ChatEntitlement , providerId : string , watch : StopWatch , installation : Promise < void > , options : { useAlternateProvider ?: boolean ; useEnterpriseProvider ?: boolean } ) : Promise < ChatSetupResultValue > {
1303
+ private async install ( session : AuthenticationSession | undefined , entitlement : ChatEntitlement , providerId : string , watch : StopWatch , options : { useAlternateProvider ?: boolean ; useEnterpriseProvider ?: boolean } ) : Promise < ChatSetupResultValue > {
1304
1304
const wasRunning = this . context . state . installed && ! this . context . state . disabled ;
1305
1305
let signUpResult : boolean | { errorCode : number } | undefined = undefined ;
1306
1306
@@ -1333,7 +1333,7 @@ class ChatSetupController extends Disposable {
1333
1333
}
1334
1334
}
1335
1335
1336
- await this . doInstallWithRetry ( installation ) ;
1336
+ await this . doInstallWithRetry ( ) ;
1337
1337
} catch ( error ) {
1338
1338
this . logService . error ( `[chat setup] install: error ${ error } ` ) ;
1339
1339
this . telemetryService . publicLog2 < InstallChatEvent , InstallChatClassification > ( 'commandCenter.chatInstall' , { installResult : isCancellationError ( error ) ? 'cancelled' : 'failedInstall' , installDuration : watch . elapsed ( ) , signUpErrorCode : undefined , provider } ) ;
@@ -1351,10 +1351,10 @@ class ChatSetupController extends Disposable {
1351
1351
return true ;
1352
1352
}
1353
1353
1354
- private async doInstallWithRetry ( installation : Promise < void > ) : Promise < void > {
1354
+ private async doInstallWithRetry ( ) : Promise < void > {
1355
1355
let error : Error | undefined ;
1356
1356
try {
1357
- await installation ;
1357
+ await this . doInstall ( ) ;
1358
1358
} catch ( e ) {
1359
1359
this . logService . error ( `[chat setup] install: error ${ error } ` ) ;
1360
1360
error = e ;
@@ -1370,7 +1370,7 @@ class ChatSetupController extends Disposable {
1370
1370
} ) ;
1371
1371
1372
1372
if ( confirmed ) {
1373
- return this . doInstallWithRetry ( this . doInstall ( ) ) ;
1373
+ return this . doInstallWithRetry ( ) ;
1374
1374
}
1375
1375
}
1376
1376
0 commit comments