Skip to content

Commit dff3f64

Browse files
waleedlatif1claude
andcommitted
revert: undo unnecessary subscription null→undefined change
getHighestPrioritySubscription never throws (it catches internally and returns null), so the catch block in preprocessExecution is dead code. The null vs undefined distinction doesn't matter and the coercions added unnecessary complexity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4c78376 commit dff3f64

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/sim/lib/execution/preprocessing.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export async function preprocessExecution(
265265
}
266266

267267
// ========== STEP 4: Get Subscription ==========
268-
let userSubscription: SubscriptionInfo | undefined
268+
let userSubscription: SubscriptionInfo = null
269269
try {
270270
userSubscription = await getHighestPrioritySubscription(actorUserId)
271271
} catch (error) {
@@ -350,7 +350,7 @@ export async function preprocessExecution(
350350
const rateLimiter = new RateLimiter()
351351
rateLimitInfo = await rateLimiter.checkRateLimitWithSubscription(
352352
actorUserId,
353-
userSubscription ?? null,
353+
userSubscription,
354354
triggerType,
355355
false // not async
356356
)
@@ -419,7 +419,7 @@ export async function preprocessExecution(
419419
success: true,
420420
actorUserId,
421421
workflowRecord,
422-
userSubscription: userSubscription ?? null,
422+
userSubscription,
423423
rateLimitInfo,
424424
executionTimeout: {
425425
sync: getExecutionTimeout(plan, 'sync'),

0 commit comments

Comments
 (0)