Skip to content

Commit 9e7772e

Browse files
committed
fix(workflow): let an unresolvable webhook URL fail loudly
Reverts the guard added earlier in this PR. A blank row titled "Webhook URL" is a worse outcome than a crash: it explains nothing, and the value is one a user copies into a third-party provider, so any substitute — a guessed page origin, an empty string — is a URL that provider accepts and then never delivers to. The read can no longer come back empty from the hydration race this PR fixes, so reaching it at all means the deployment has no application base URL, which breaks webhook registration and callbacks regardless. The error boundary now reports what it caught, so the throw names its own cause instead of surfacing as an unexplained fallback.
1 parent 99fee82 commit 9e7772e

1 file changed

Lines changed: 7 additions & 16 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
TypeNumber,
1717
Wrench,
1818
} from '@sim/emcn/icons'
19-
import { createLogger } from '@sim/logger'
2019
import {
2120
BLOCK_DIMENSIONS,
2221
CanvasSentenceView,
@@ -120,8 +119,6 @@ import { useWorkflowStore } from '@/stores/workflows/workflow/store'
120119
import { formatParameterLabel } from '@/tools/params'
121120
import { TRIGGER_REGISTRY } from '@/triggers/registry'
122121

123-
const logger = createLogger('WorkflowBlock')
124-
125122
/** Stable empty object to avoid creating new references */
126123
const EMPTY_SUBBLOCK_VALUES = {} as Record<string, any>
127124

@@ -503,19 +500,13 @@ const SubBlockRow = memo(function SubBlockRow({
503500
if (!subBlock?.id?.startsWith('webhookUrlDisplay') || !blockId) {
504501
return null
505502
}
506-
/* `getBaseUrl` throws by design when no application base URL is configured,
507-
and this runs during render — so an unguarded call takes the entire editor
508-
down through the canvas error boundary over one read-only field. A URL this
509-
card cannot resolve is a blank field, never a dead canvas. */
510-
let baseUrl: string
511-
try {
512-
baseUrl = getBaseUrl()
513-
} catch (error) {
514-
logger.warn('Cannot render the webhook URL: no application base URL is configured', {
515-
error,
516-
})
517-
return null
518-
}
503+
/* Deliberately unguarded. `getBaseUrl` throws when no application base URL is
504+
configured, and that is the right outcome here: this value gets copied into
505+
a third-party provider, so a guessed origin would hand the user a URL that
506+
provider accepts and then never delivers to, and a blank row explains
507+
nothing. The error boundary reports what it caught, so the throw names its
508+
own cause. */
509+
const baseUrl = getBaseUrl()
519510
const triggerPath = allSubBlockValues?.triggerPath?.value as string | undefined
520511
return triggerPath
521512
? `${baseUrl}/api/webhooks/trigger/${triggerPath}`

0 commit comments

Comments
 (0)