File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
apps/sim/lib/billing/core Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff 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 */
3234export 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
You can’t perform that action at this time.
0 commit comments