Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

only log non-trial deletions

Steven Tey84b56839f2f3
diff --git a/apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts b/apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts
index 7e9bec81d9..b9ca0f875f 100644
--- a/apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts
+++ b/apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts
@@ -166,18 +166,19 @@ export async function customerSubscriptionDeleted(
url: "",
})),
),
- // Log the deletion
- log({
- message:
- ":cry: Workspace *`" +
- workspace.slug +
- "`* deleted their *`" +
- capitalize(workspace.plan) +
- "`* subscription" +
- (isBlacklistedCancellation ? " (blacklisted / banned)" : ""),
- type: "cron",
- mention: true,
- }),
+ // Log the deletion (only for non trial subscriptions)
+ !workspace.trialEndsAt &&
+ log({
+ message:
+ ":cry: Workspace *`" +
+ workspace.slug +
+ "`* deleted their *`" +
+ capitalize(workspace.plan) +
+ "`* subscription" +
+ (isBlacklistedCancellation ? " (blacklisted / banned)" : ""),
+ type: "cron",
+ mention: true,
+ }),
// Don't send feedback if the user was blacklisted / banned
!isBlacklistedCancellation &&