@@ -1252,13 +1252,13 @@ class ChatSetupController extends Disposable {
1252
1252
let session : AuthenticationSession | undefined ;
1253
1253
let entitlement : ChatEntitlement | undefined ;
1254
1254
1255
- const installation = this . doInstall ( ) ;
1256
-
1257
1255
// Entitlement Unknown or `forceSignIn`: we need to sign-in user
1258
1256
if ( this . context . state . entitlement === ChatEntitlement . Unknown || options . forceSignIn ) {
1259
1257
this . setStep ( ChatSetupStep . SigningIn ) ;
1260
1258
const result = await this . signIn ( { useAlternateProvider : options . useAlternateProvider } ) ;
1261
1259
if ( ! result . session ) {
1260
+ this . doInstall ( ) ; // still install the extension in the background to remind the user to sign-in eventually
1261
+
1262
1262
const provider = options . useAlternateProvider ? defaultChat . alternativeProviderId : options . useEnterpriseProvider ? defaultChat . enterpriseProviderId : defaultChat . providerName ;
1263
1263
this . telemetryService . publicLog2 < InstallChatEvent , InstallChatClassification > ( 'commandCenter.chatInstall' , { installResult : 'failedNotSignedIn' , installDuration : watch . elapsed ( ) , signUpErrorCode : undefined , provider } ) ;
1264
1264
return undefined ; // treat as cancelled because signing in already triggers an error dialog
@@ -1270,7 +1270,7 @@ class ChatSetupController extends Disposable {
1270
1270
1271
1271
// Await Install
1272
1272
this . setStep ( ChatSetupStep . Installing ) ;
1273
- success = await this . install ( session , entitlement ?? this . context . state . entitlement , providerId , watch , installation , options ) ;
1273
+ success = await this . install ( session , entitlement ?? this . context . state . entitlement , providerId , watch , options ) ;
1274
1274
} finally {
1275
1275
this . setStep ( ChatSetupStep . Initial ) ;
1276
1276
this . context . resume ( ) ;
@@ -1304,7 +1304,7 @@ class ChatSetupController extends Disposable {
1304
1304
return { session, entitlement : entitlements ?. entitlement } ;
1305
1305
}
1306
1306
1307
- private async install ( session : AuthenticationSession | undefined , entitlement : ChatEntitlement , providerId : string , watch : StopWatch , installation : Promise < void > , options : { useAlternateProvider ?: boolean ; useEnterpriseProvider ?: boolean } ) : Promise < ChatSetupResultValue > {
1307
+ private async install ( session : AuthenticationSession | undefined , entitlement : ChatEntitlement , providerId : string , watch : StopWatch , options : { useAlternateProvider ?: boolean ; useEnterpriseProvider ?: boolean } ) : Promise < ChatSetupResultValue > {
1308
1308
const wasRunning = this . context . state . installed && ! this . context . state . disabled ;
1309
1309
let signUpResult : boolean | { errorCode : number } | undefined = undefined ;
1310
1310
@@ -1337,7 +1337,7 @@ class ChatSetupController extends Disposable {
1337
1337
}
1338
1338
}
1339
1339
1340
- await this . doInstallWithRetry ( installation ) ;
1340
+ await this . doInstallWithRetry ( ) ;
1341
1341
} catch ( error ) {
1342
1342
this . logService . error ( `[chat setup] install: error ${ error } ` ) ;
1343
1343
this . telemetryService . publicLog2 < InstallChatEvent , InstallChatClassification > ( 'commandCenter.chatInstall' , { installResult : isCancellationError ( error ) ? 'cancelled' : 'failedInstall' , installDuration : watch . elapsed ( ) , signUpErrorCode : undefined , provider } ) ;
@@ -1355,10 +1355,10 @@ class ChatSetupController extends Disposable {
1355
1355
return true ;
1356
1356
}
1357
1357
1358
- private async doInstallWithRetry ( installation : Promise < void > ) : Promise < void > {
1358
+ private async doInstallWithRetry ( ) : Promise < void > {
1359
1359
let error : Error | undefined ;
1360
1360
try {
1361
- await installation ;
1361
+ await this . doInstall ( ) ;
1362
1362
} catch ( e ) {
1363
1363
this . logService . error ( `[chat setup] install: error ${ error } ` ) ;
1364
1364
error = e ;
@@ -1374,7 +1374,7 @@ class ChatSetupController extends Disposable {
1374
1374
} ) ;
1375
1375
1376
1376
if ( confirmed ) {
1377
- return this . doInstallWithRetry ( this . doInstall ( ) ) ;
1377
+ return this . doInstallWithRetry ( ) ;
1378
1378
}
1379
1379
}
1380
1380
0 commit comments