From 7746049bb42f35c592b6f5288cbeb75917543a3e Mon Sep 17 00:00:00 2001 From: Fiz <34069775+Hafizzle@users.noreply.github.com> Date: Tue, 31 Mar 2026 12:17:42 -0500 Subject: [PATCH] fix(groups): expired guild plans not showing in upgrade modal (#15637) use dateCreated instead of customerId to identify previously upgraded groups. Team cron clears customerId on expired plans as a query optimization, which makes them invisible to the upgrade flow. dateCreated is set on every group plan since the feature was introduced and is never cleared, so it reliably indicates a group was previously upgraded. --- website/server/models/group.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/server/models/group.js b/website/server/models/group.js index ca44d764a8..99071d83c7 100644 --- a/website/server/models/group.js +++ b/website/server/models/group.js @@ -159,7 +159,7 @@ schema.plugin(baseModel, { if (plainObj.purchased) { plainObj.purchased.active = originalDoc.hasActiveGroupPlan(); const plan = originalDoc.purchased && originalDoc.purchased.plan; - if (plan && plan.customerId) { + if (plan && plan.dateCreated) { plainObj.purchased.wasUpgraded = true; if (plan.dateTerminated) { plainObj.purchased.dateTerminated = plan.dateTerminated; @@ -317,7 +317,7 @@ schema.statics.getGroups = async function getGroups (options = {}) { type: 'guild', privacy: 'private', _id: { $in: user.guilds }, - 'purchased.plan.customerId': { $exists: true }, + 'purchased.plan.dateCreated': { $exists: true }, }; if (!filters.includeExpiredPlans) { query.$or = [