Skip to content

Commit 4950027

Browse files
committed
Fixes graph gating
1 parent d40056c commit 4950027

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

src/git/gitProviderService.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,25 @@ export class GitProviderService implements Disposable {
520520
cacheKey = path;
521521
}
522522

523-
let access = this._accessCache.get(cacheKey);
524-
if (access == null) {
525-
access = this.accessCore(feature, repoPath);
526-
this._accessCache.set(cacheKey, access);
523+
let accessPromise = this._accessCache.get(cacheKey);
524+
if (accessPromise == null) {
525+
accessPromise = this.accessCore(feature, repoPath);
526+
this._accessCache.set(cacheKey, accessPromise);
527527
}
528+
529+
const access = await accessPromise;
530+
if (
531+
feature === PlusFeatures.Graph &&
532+
access.visibility !== RepositoryVisibility.Private &&
533+
access.subscription.current.plan.effective.id === SubscriptionPlanId.Free
534+
) {
535+
return {
536+
allowed: true,
537+
subscription: { current: access.subscription.current },
538+
visibility: access.visibility,
539+
};
540+
}
541+
528542
return access;
529543
}
530544

@@ -554,14 +568,6 @@ export class GitProviderService implements Disposable {
554568
if (visibility !== RepositoryVisibility.Private) {
555569
switch (plan) {
556570
case SubscriptionPlanId.Free:
557-
if (feature === PlusFeatures.Graph) {
558-
return {
559-
allowed: true,
560-
subscription: { current: subscription },
561-
visibility: visibility,
562-
};
563-
}
564-
565571
return {
566572
allowed: false,
567573
subscription: { current: subscription, required: SubscriptionPlanId.FreePlus },

0 commit comments

Comments
 (0)