Skip to content

Commit 9c5fbbe

Browse files
committed
fail closed
1 parent 334faa1 commit 9c5fbbe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/sim/lib/billing/core/subscription.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export { getHighestPrioritySubscription }
2828
/**
2929
* Check if a referenceId (user ID or org ID) has an active subscription
3030
* Used for duplicate subscription prevention
31+
*
32+
* Fails closed: returns true on error to prevent duplicate creation
3133
*/
3234
export async function hasActiveSubscription(referenceId: string): Promise<boolean> {
3335
try {
@@ -40,7 +42,8 @@ export async function hasActiveSubscription(referenceId: string): Promise<boolea
4042
return !!activeSub
4143
} catch (error) {
4244
logger.error('Error checking active subscription', { error, referenceId })
43-
return false
45+
// Fail closed: assume subscription exists to prevent duplicate creation
46+
return true
4447
}
4548
}
4649

0 commit comments

Comments
 (0)