Skip to content

Commit

Permalink
Forces local GitHub on web and fixes timing issue getting session
Browse files Browse the repository at this point in the history
Closes #3938
  • Loading branch information
axosoft-ramint committed Jan 21, 2025
1 parent 40d690b commit 65f85cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { Sources } from '../../../constants.telemetry';
import type { Container } from '../../../container';
import { gate } from '../../../system/decorators/-webview/gate';
import { debug, log } from '../../../system/decorators/log';
import { serialize } from '../../../system/decorators/serialize';
import type { DeferredEventExecutor } from '../../../system/event';
import {
isCloudSelfHostedIntegrationId,
Expand Down Expand Up @@ -479,6 +480,7 @@ class BuiltInAuthenticationProvider extends LocalIntegrationAuthenticationProvid
}

@debug()
@serialize()
override async getSession(
descriptor?: IntegrationAuthenticationSessionDescriptor,
options?: { createIfNeeded?: boolean; forceNewSession?: boolean },
Expand Down
9 changes: 8 additions & 1 deletion src/plus/integrations/authentication/models.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { AuthenticationSession } from 'vscode';
import { isWeb } from '@env/platform';
import type { IntegrationId, SupportedCloudIntegrationIds } from '../../../constants.integrations';
import {
HostingIntegrationId,
Expand Down Expand Up @@ -55,9 +56,15 @@ export type CloudIntegrationAuthType = 'oauth' | 'pat';
export const CloudIntegrationAuthenticationUriPathPrefix = 'did-authenticate-cloud-integration';

export function getSupportedCloudIntegrationIds(): SupportedCloudIntegrationIds[] {
return configuration.get('cloudIntegrations.enabled', undefined, true)
let supportedCloudIntegrationIds = configuration.get('cloudIntegrations.enabled', undefined, true)
? supportedOrderedCloudIntegrationIds
: supportedOrderedCloudIssueIntegrationIds;
if (isWeb) {
// We always have a local GitHub session on vscode.dev and github.dev
supportedCloudIntegrationIds = supportedCloudIntegrationIds.filter(id => id !== HostingIntegrationId.GitHub);
}

return supportedCloudIntegrationIds;
}

export function isSupportedCloudIntegrationId(id: string): id is SupportedCloudIntegrationIds {
Expand Down

0 comments on commit 65f85cc

Please sign in to comment.