Skip to content

fix(workflow): derive the webhook URL only where a sub-block shows one - #6758

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/workflow-error-boundary
Aug 16, 2026
Merged

fix(workflow): derive the webhook URL only where a sub-block shows one#6758
waleedlatif1 merged 1 commit into
stagingfrom
fix/workflow-error-boundary

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • sub-block.tsx:485 mounts useWebhookManagement for every sub-block in the editor panel, and the hook derived a webhook URL for all of them. getBaseUrl() throws when NEXT_PUBLIC_APP_URL reads empty, so a missing deployment value took down the entire workflow route instead of the single webhook field that needed the URL.
  • The hook already gates its query and its sub-block store writes on useWebhookUrl (queryEnabled, line 131). The derived URL was the one value ignoring that flag; it now agrees with the rest of the hook.
  • No caller can observe the change: short-input.tsx:219,341 already read it as useWebhookUrl && webhookManagement.webhookUrl, the copy button renders only when config.showCopyButton && config.useWebhookUrl (sub-block.tsx:1209), and slack-setup-wizard.tsx:92 passes useWebhookUrl: true. The value is never read inside the hook itself.

Type of Change

  • Bug fix

Testing

Typecheck clean; hooks/, stores/, and app/workspace suites pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 16, 2026 1:10am

Request Review

@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Single conditional in a hook memo with no API or auth changes; existing UI already gates reads on the same flag.

Overview
Fixes a workflow editor crash when NEXT_PUBLIC_APP_URL is unset: useWebhookManagement is mounted for every sub-block in the panel, and webhookUrl used to always call getBaseUrl(), which throws without that env var—so unrelated fields could take down the whole route.

webhookUrl is now derived only when useWebhookUrl is true (returns '' otherwise), matching how the hook already gates its query and store sync. Callers that show the URL already check useWebhookUrl before reading the value, so behavior for webhook fields is unchanged.

Reviewed by Cursor Bugbot for commit 000bec4. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR prevents webhook URL derivation for sub-blocks that do not display a webhook URL, avoiding unnecessary getBaseUrl() failures when deployment configuration is absent.

  • Returns an empty URL while useWebhookUrl is disabled.
  • Includes useWebhookUrl in the memo dependency list.
  • Preserves URL generation for webhook-enabled callers.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/hooks/use-webhook-management.ts Gates webhook URL derivation consistently with the hook’s existing query and consumer behavior; no blocking issue was found.

Reviews (2): Last reviewed commit: "fix(workflow): derive the webhook URL on..." | Re-trigger Greptile

Comment thread apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/error/index.tsx Outdated
Comment thread apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/error/index.tsx Outdated
@waleedlatif1
waleedlatif1 force-pushed the fix/workflow-error-boundary branch from 7874ec1 to 80dbf57 Compare August 16, 2026 01:06
`sub-block.tsx` mounts `useWebhookManagement` for every sub-block in the editor
panel, and `getBaseUrl()` throws when NEXT_PUBLIC_APP_URL reads empty, so a
missing deployment value took down the whole workflow route instead of the one
webhook field. The hook already gates its query and store writes on
`useWebhookUrl`; the URL now agrees.
@waleedlatif1
waleedlatif1 force-pushed the fix/workflow-error-boundary branch from 80dbf57 to 000bec4 Compare August 16, 2026 01:10
@waleedlatif1 waleedlatif1 changed the title fix(workflow): stop the editor panel crashing the whole workflow route fix(workflow): derive the webhook URL only where a sub-block shows one Aug 16, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 000bec4. Configure here.

@waleedlatif1
waleedlatif1 merged commit 57611bd into staging Aug 16, 2026
31 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/workflow-error-boundary branch August 16, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant