Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit 622b1b0

Browse files
committed
remove dotcom related code from autoedit-onboarding.ts and create-autoedits-provider.ts
1 parent 6b8a89b commit 622b1b0

File tree

2 files changed

+4
-28
lines changed

2 files changed

+4
-28
lines changed

vscode/src/autoedits/autoedit-onboarding.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import {
22
CodyAutoSuggestionMode,
33
FeatureFlag,
4-
currentAuthStatus,
54
currentResolvedConfig,
6-
currentUserProductSubscription,
75
featureFlagProvider,
86
storeLastValue,
97
telemetryRecorder,
@@ -95,14 +93,8 @@ export class AutoEditBetaOnboarding implements vscode.Disposable {
9593
if (process.env.CODY_TESTING === 'true') {
9694
return false
9795
}
98-
const authStatus = currentAuthStatus()
99-
const productSubscription = await currentUserProductSubscription()
10096
const autoEditFeatureFlag = this.isAutoEditFeatureFlagEnabled()
101-
const { isUserEligible } = isUserEligibleForAutoeditsFeature(
102-
autoEditFeatureFlag,
103-
authStatus,
104-
productSubscription
105-
)
97+
const { isUserEligible } = isUserEligibleForAutoeditsFeature(autoEditFeatureFlag)
10698
return isUserEligible
10799
}
108100

vscode/src/autoedits/create-autoedits-provider.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import {
77
CodyAutoSuggestionMode,
88
NEVER,
99
type PickResolvedConfiguration,
10-
type UserProductSubscription,
1110
combineLatest,
1211
createDisposables,
1312
currentUserProductSubscription,
14-
isFreeUser,
1513
promiseFactoryToObservable,
1614
skipPendingOperation,
1715
} from '@sourcegraph/cody-shared'
@@ -84,12 +82,8 @@ export function createAutoEditsProvider({
8482
promiseFactoryToObservable(async () => await currentUserProductSubscription())
8583
).pipe(
8684
skipPendingOperation(),
87-
createDisposables(([userProductSubscription]) => {
88-
const userEligibilityInfo = isUserEligibleForAutoeditsFeature(
89-
autoeditFeatureFlagEnabled,
90-
authStatus,
91-
userProductSubscription
92-
)
85+
createDisposables(() => {
86+
const userEligibilityInfo = isUserEligibleForAutoeditsFeature(autoeditFeatureFlagEnabled)
9387
if (!userEligibilityInfo.isUserEligible) {
9488
handleAutoeditsNotificationForNonEligibleUser(userEligibilityInfo.nonEligibilityReason)
9589
return []
@@ -193,23 +187,13 @@ function isSettingsEditorOpen(): boolean {
193187
}
194188

195189
export function isUserEligibleForAutoeditsFeature(
196-
autoeditsFeatureFlagEnabled: boolean,
197-
authStatus: AuthStatus,
198-
productSubscription: UserProductSubscription | null
190+
autoeditsFeatureFlagEnabled: boolean
199191
): AutoeditsUserEligibilityInfo {
200192
// Always enable auto-edit when testing
201193
if (process.env.CODY_TESTING === 'true' || process.env.NODE_ENV === 'test') {
202194
return { isUserEligible: true }
203195
}
204196

205-
// Free users are not eligible for auto-edit
206-
if (isFreeUser(authStatus, productSubscription)) {
207-
return {
208-
isUserEligible: false,
209-
nonEligibilityReason: AUTOEDITS_NON_ELIGIBILITY_MESSAGES.PRO_USER_ONLY,
210-
}
211-
}
212-
213197
// Users with autoedit feature flag enabled are eligible for auto-edit
214198
return {
215199
isUserEligible: autoeditsFeatureFlagEnabled,

0 commit comments

Comments
 (0)