Skip to content

Commit f88926a

Browse files
authored
fix(webhooks): return empty 200 for Slack to close modals cleanly (#3492)
* fix(webhooks): return empty 200 for Slack to close modals cleanly * fix(webhooks): add clarifying comment on Slack error path trade-off
1 parent 690b47a commit f88926a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

apps/sim/lib/webhooks/processor.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,12 @@ export async function queueWebhookExecution(
11661166
})
11671167
}
11681168

1169+
// Slack requires an empty 200 for interactive payloads (view_submission, block_actions, etc.)
1170+
// A JSON body like {"message":"..."} is not a recognized response format and causes modal errors
1171+
if (foundWebhook.provider === 'slack') {
1172+
return new NextResponse(null, { status: 200 })
1173+
}
1174+
11691175
// Twilio Voice requires TwiML XML response
11701176
if (foundWebhook.provider === 'twilio_voice') {
11711177
const providerConfig = (foundWebhook.providerConfig as Record<string, any>) || {}
@@ -1211,6 +1217,12 @@ export async function queueWebhookExecution(
12111217
)
12121218
}
12131219

1220+
if (foundWebhook.provider === 'slack') {
1221+
// Return empty 200 to avoid Slack showing an error dialog to the user,
1222+
// even though processing failed. The error is already logged above.
1223+
return new NextResponse(null, { status: 200 })
1224+
}
1225+
12141226
if (foundWebhook.provider === 'twilio_voice') {
12151227
const errorTwiml = `<?xml version="1.0" encoding="UTF-8"?>
12161228
<Response>

0 commit comments

Comments
 (0)