Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Following the fix for immediate activation waiting on local extension host (#260061), the timeout workaround in the authentication service is no longer necessary.

Changes

src/vs/workbench/services/authentication/browser/authenticationService.ts:

  • Removed the 5-second timeout waiting for auth providers to register in tryActivateProvider()
  • Removed the TODO comment about fixing this later
  • Removed unused imports (raceCancellation, raceTimeout)
  • Simplified the method to throw immediately if the provider is not registered after activation

Before:

const result = await raceTimeout(
    raceCancellation(
        Event.toPromise(Event.filter(this.onDidRegisterAuthenticationProvider, e => e.id === providerId, store), store),
        this._disposedSource.token
    ),
    5000
);
// ... error handling for timeout

After:

const provider = this._authenticationProviders.get(providerId);
if (provider) {
    return provider;
}
throw new Error(`No authentication provider '${providerId}' is currently registered.`);
Original prompt

This section details on the original issue you should resolve

<issue_title>Remove timeout code now that immediate activation will wait on the local Ext Host</issue_title>
<issue_description>Followup from #260061

We can now remove the timeout here

private async getSessions(authProviderId: string): Promise<readonly AuthenticationSession[]> {
for (let attempt = 1; attempt <= 3; attempt++) {
try {
return await this.authenticationService.getSessions(authProviderId, undefined, undefined, true);
} catch (error) {
this.logService.warn(`[DefaultAccount] Attempt ${attempt} to get sessions failed:`, getErrorMessage(error));
if (attempt === 3) {
throw error;
}
await timeout(500);
}
}
throw new Error('Unable to get sessions after multiple attempts');
}
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove timeout code for immediate activation Remove timeout workaround in defaultAccount initialization Feb 3, 2026
Copilot AI requested a review from TylerLeonhardt February 3, 2026 17:47
@TylerLeonhardt
Copy link
Member

@copilot there is also code in auth land that has a timeout waiting for an auth provider to be registered.. we can get rid of that

const store = new DisposableStore();
try {
// TODO: Remove this timeout and figure out a better way to ensure auth providers
// are registered _during_ extension activation.
const result = await raceTimeout(
raceCancellation(
Event.toPromise(
Event.filter(
this.onDidRegisterAuthenticationProvider,
e => e.id === providerId,
store
),
store
),
this._disposedSource.token
),
5000
);
provider = this._authenticationProviders.get(providerId);

…ider

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 3, 2026

@copilot there is also code in auth land that has a timeout waiting for an auth provider to be registered.. we can get rid of that
https://github.com/microsoft/vscode/blob/2a057b677f...

Removed the timeout workaround in tryActivateProvider() in a233963. The method now throws immediately if the provider is not registered after activation, and I also cleaned up the unused raceTimeout and raceCancellation imports.

Copilot AI changed the title Remove timeout workaround in defaultAccount initialization Remove timeout workarounds now that immediate activation waits on the local Ext Host Feb 3, 2026
this.logService.error('[DefaultAccount] Error while waiting for installed extensions to be registered', getErrorMessage(error));
}

await this.extensionService.whenInstalledExtensionsRegistered();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot revert this change, I want to focus this PR on the auth service change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in d13e615. The PR now only contains the auth service changes.

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copilot AI changed the title Remove timeout workarounds now that immediate activation waits on the local Ext Host Remove timeout workaround in authentication service now that immediate activation waits on the local Ext Host Feb 3, 2026
Copilot AI requested a review from TylerLeonhardt February 3, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove timeout code now that immediate activation will wait on the local Ext Host

2 participants