Skip to content

Commit 60610b7

Browse files
waleedlatif1claude
andcommitted
fix(webhooks): remove duplicate generic file processing from webhook-execution
The generic provider's processInputFiles handler already handles file[] field processing via the handler.processInputFiles call. The hardcoded block from staging was incorrectly preserved during rebase, causing double processing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8bcf450 commit 60610b7

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

apps/sim/background/webhook-execution.ts

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { AsyncExecutionCorrelation } from '@/lib/core/async-jobs/types'
77
import { createTimeoutAbortController, getTimeoutErrorMessage } from '@/lib/core/execution-limits'
88
import { IdempotencyService, webhookIdempotency } from '@/lib/core/idempotency'
99
import { generateId } from '@/lib/core/utils/uuid'
10-
import { processExecutionFiles } from '@/lib/execution/files'
1110
import { preprocessExecution } from '@/lib/execution/preprocessing'
1211
import { LoggingSession } from '@/lib/logs/execution/logging-session'
1312
import { buildTraceSpans } from '@/lib/logs/execution/trace-spans/trace-spans'
@@ -429,52 +428,6 @@ async function executeWebhookJobInternal(
429428
}
430429
}
431430

432-
// Process generic webhook files based on inputFormat
433-
if (input && payload.provider === 'generic' && payload.blockId && blocks[payload.blockId]) {
434-
try {
435-
const triggerBlock = blocks[payload.blockId]
436-
437-
if (triggerBlock?.subBlocks?.inputFormat?.value) {
438-
const inputFormat = triggerBlock.subBlocks.inputFormat.value as unknown as Array<{
439-
name: string
440-
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'file[]'
441-
}>
442-
443-
const fileFields = inputFormat.filter((field) => field.type === 'file[]')
444-
445-
if (fileFields.length > 0 && typeof input === 'object' && input !== null) {
446-
const executionContext = {
447-
workspaceId,
448-
workflowId: payload.workflowId,
449-
executionId,
450-
}
451-
452-
for (const fileField of fileFields) {
453-
const fieldValue = input[fileField.name]
454-
455-
if (fieldValue && typeof fieldValue === 'object') {
456-
const uploadedFiles = await processExecutionFiles(
457-
fieldValue,
458-
executionContext,
459-
requestId,
460-
payload.userId
461-
)
462-
463-
if (uploadedFiles.length > 0) {
464-
input[fileField.name] = uploadedFiles
465-
logger.info(
466-
`[${requestId}] Successfully processed ${uploadedFiles.length} file(s) for field: ${fileField.name}`
467-
)
468-
}
469-
}
470-
}
471-
}
472-
}
473-
} catch (error) {
474-
logger.error(`[${requestId}] Error processing generic webhook files:`, error)
475-
}
476-
}
477-
478431
logger.info(`[${requestId}] Executing workflow for ${payload.provider} webhook`)
479432

480433
const metadata: ExecutionMetadata = {

0 commit comments

Comments
 (0)