Skip to content

Commit 22d6ada

Browse files
geroplroboquat
authored andcommitted
[server] Debug logging for automatic OSS subscription
1 parent 28bc525 commit 22d6ada

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

components/ee/payment-endpoint/src/accounting/subscription-service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ export class SubscriptionService {
9797
const subs = await this.getNotYetCancelledSubscriptions(user, now.toISOString());
9898
const uncancelledOssSub = subs.find(s => s.planId === Plans.FREE_OPEN_SOURCE.chargebeeId && !s.cancellationDate);
9999
if (uncancelledOssSub) {
100+
log.debug({ userId: userId }, "already has professional OSS subscription");
100101
return;
101102
}
102103

103-
await this.subscribe(userId, Plans.FREE_OPEN_SOURCE, undefined, now.toISOString());
104+
const subscription = await this.subscribe(userId, Plans.FREE_OPEN_SOURCE, undefined, now.toISOString());
105+
log.debug({ userId: userId }, "create new OSS subscription", { subscription });
104106
return;
105107
}
106108

components/server/src/auth/login-completion-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export class LoginCompletionHandler {
109109

110110
protected async checkForAndSubscribeToProfessionalOss(user: User) {
111111
const eligible = await this.userService.checkAutomaticOssEligibility(user);
112+
log.debug({ userId: user.id }, "user eligible for OSS subscription?", { eligible });
112113
if (!eligible) {
113114
return;
114115
}

0 commit comments

Comments
 (0)