Skip to content

Commit cb0c47c

Browse files
authored
Revert "chat - begin installation earlier (#252925)" (#254961)
This reverts commit 4e32b01.
1 parent a3a5f7c commit cb0c47c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/vs/workbench/contrib/chat/browser/chatSetup.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,13 +1252,13 @@ class ChatSetupController extends Disposable {
12521252
let session: AuthenticationSession | undefined;
12531253
let entitlement: ChatEntitlement | undefined;
12541254

1255-
const installation = this.doInstall();
1256-
12571255
// Entitlement Unknown or `forceSignIn`: we need to sign-in user
12581256
if (this.context.state.entitlement === ChatEntitlement.Unknown || options.forceSignIn) {
12591257
this.setStep(ChatSetupStep.SigningIn);
12601258
const result = await this.signIn({ useAlternateProvider: options.useAlternateProvider });
12611259
if (!result.session) {
1260+
this.doInstall(); // still install the extension in the background to remind the user to sign-in eventually
1261+
12621262
const provider = options.useAlternateProvider ? defaultChat.alternativeProviderId : options.useEnterpriseProvider ? defaultChat.enterpriseProviderId : defaultChat.providerName;
12631263
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined, provider });
12641264
return undefined; // treat as cancelled because signing in already triggers an error dialog
@@ -1270,7 +1270,7 @@ class ChatSetupController extends Disposable {
12701270

12711271
// Await Install
12721272
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);
12741274
} finally {
12751275
this.setStep(ChatSetupStep.Initial);
12761276
this.context.resume();
@@ -1304,7 +1304,7 @@ class ChatSetupController extends Disposable {
13041304
return { session, entitlement: entitlements?.entitlement };
13051305
}
13061306

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> {
13081308
const wasRunning = this.context.state.installed && !this.context.state.disabled;
13091309
let signUpResult: boolean | { errorCode: number } | undefined = undefined;
13101310

@@ -1337,7 +1337,7 @@ class ChatSetupController extends Disposable {
13371337
}
13381338
}
13391339

1340-
await this.doInstallWithRetry(installation);
1340+
await this.doInstallWithRetry();
13411341
} catch (error) {
13421342
this.logService.error(`[chat setup] install: error ${error}`);
13431343
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 {
13551355
return true;
13561356
}
13571357

1358-
private async doInstallWithRetry(installation: Promise<void>): Promise<void> {
1358+
private async doInstallWithRetry(): Promise<void> {
13591359
let error: Error | undefined;
13601360
try {
1361-
await installation;
1361+
await this.doInstall();
13621362
} catch (e) {
13631363
this.logService.error(`[chat setup] install: error ${error}`);
13641364
error = e;
@@ -1374,7 +1374,7 @@ class ChatSetupController extends Disposable {
13741374
});
13751375

13761376
if (confirmed) {
1377-
return this.doInstallWithRetry(this.doInstall());
1377+
return this.doInstallWithRetry();
13781378
}
13791379
}
13801380

0 commit comments

Comments
 (0)