Skip to content

[server] Don't count "Professional Open Source" as personal subscription #12754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/server/ee/src/billing/billing-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export class BillingModesImpl implements BillingModes {
}
const cbSubscriptions = await this.subscriptionSvc.getActivePaidSubscription(user.id, now);
Copy link
Contributor

Choose a reason for hiding this comment

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

Side note: getActivePaidSubscription is wrongly named (because it also returns unpaid / free subscriptions 🙄). Thankfully, this is all going away soon. 👋

const cbTeamSubscriptions = cbSubscriptions.filter((s) => isTeamSubscription(s));
const cbPersonalSubscriptions = cbSubscriptions.filter((s) => !isTeamSubscription(s));
const cbPersonalSubscriptions = cbSubscriptions.filter(
(s) => !isTeamSubscription(s) && s.planId !== Plans.FREE_OPEN_SOURCE.chargebeeId,
);
let canUpgradeToUBB = false;
if (cbPersonalSubscriptions.length > 0) {
if (cbPersonalSubscriptions.every((s) => Subscription.isCancelled(s, now.toISOString()))) {
Expand Down