Skip to content

Commit 23d69d1

Browse files
committed
address review comments
1 parent 69cd0fd commit 23d69d1

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

apps/sim/lib/webhooks/processor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ export async function queueWebhookExecution(
10381038
}
10391039
}
10401040

1041-
const headers = Object.fromEntries(request.headers.entries())
1041+
const { 'x-sim-idempotency-key': _, ...headers } = Object.fromEntries(request.headers.entries())
10421042

10431043
// For Microsoft Teams Graph notifications, extract unique identifiers for idempotency
10441044
if (
@@ -1216,7 +1216,8 @@ export async function queueWebhookExecution(
12161216
}
12171217

12181218
if (foundWebhook.provider === 'generic' && providerConfig.responseMode === 'custom') {
1219-
const statusCode = Number(providerConfig.responseStatusCode) || 200
1219+
const rawCode = Number(providerConfig.responseStatusCode) || 200
1220+
const statusCode = rawCode >= 100 && rawCode <= 599 ? rawCode : 200
12201221
const responseBody = (providerConfig.responseBody as string | undefined)?.trim()
12211222

12221223
if (!responseBody) {

apps/sim/lib/workflows/comparison/compare.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ describe('hasWorkflowChanged', () => {
433433
expect(hasWorkflowChanged(state1, state2)).toBe(true)
434434
})
435435

436-
it.concurrent('should detect subBlock type changes', () => {
436+
it.concurrent('should ignore subBlock type changes', () => {
437437
const state1 = createWorkflowState({
438438
blocks: {
439439
block1: createBlock('block1', {
@@ -448,7 +448,7 @@ describe('hasWorkflowChanged', () => {
448448
}),
449449
},
450450
})
451-
expect(hasWorkflowChanged(state1, state2)).toBe(true)
451+
expect(hasWorkflowChanged(state1, state2)).toBe(false)
452452
})
453453

454454
it.concurrent('should handle null/undefined subBlock values consistently', () => {

apps/sim/triggers/generic/webhook.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ export const genericWebhookTrigger: TriggerConfig = {
6767
{ label: 'Default', id: 'default' },
6868
{ label: 'Custom', id: 'custom' },
6969
],
70+
defaultValue: 'default',
7071
mode: 'trigger',
7172
},
7273
{
7374
id: 'responseStatusCode',
7475
title: 'Response Status Code',
7576
type: 'short-input',
76-
placeholder: '200',
77-
description: 'HTTP status code to return to the webhook caller.',
77+
placeholder: '200 (default)',
78+
description:
79+
'HTTP status code (100–599) to return to the webhook caller. Defaults to 200 if empty or invalid.',
7880
required: false,
7981
mode: 'trigger',
8082
condition: { field: 'responseMode', value: 'custom' },

0 commit comments

Comments
 (0)