fix(billing): only adopt live subscriptions from created events

This commit is contained in:
Narciso
2026-11-18 16:18:48 -04:00
parent 1f215b76af
commit 3ffdb445bb
+5 -1
View File
@@ -140,7 +140,11 @@ export default async function handler(
const subscription = await stripe.subscriptions.retrieve(
newSubscription.id,
);
if (hasEnded(subscription)) {
// A late event of an older subscription must not replace the current one.
if (
subscription.status !== "active" &&
subscription.status !== "trialing"
) {
break;
}