-
Notifications
You must be signed in to change notification settings - Fork 3k
improvement(useWebhookUrl): GET api/webhook is called when useWebhookUrl:true #2451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement(useWebhookUrl): GET api/webhook is called when useWebhookUrl:true #2451
Conversation
…enerateurl function when the useWebhookurl flag is true
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryFixed unnecessary webhook API calls during block re-rendering by adding a Key changes:
Issue found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant ShortInput
participant TriggerSave
participant useWebhookManagement
participant API
participant SubBlockStore
Note over ShortInput,TriggerSave: Components using webhook management
ShortInput->>useWebhookManagement: call hook with useWebhookUrl=false
Note over useWebhookManagement: useWebhookUrl is false
useWebhookManagement->>useWebhookManagement: Skip loadWebhookOrGenerateUrl()
useWebhookManagement-->>ShortInput: Return webhook state (no API call)
TriggerSave->>useWebhookManagement: call hook with useWebhookUrl=true
Note over useWebhookManagement: useWebhookUrl is true
useWebhookManagement->>SubBlockStore: Set loading state
useWebhookManagement->>API: GET /api/webhooks?workflowId&blockId
API-->>useWebhookManagement: Return webhook data
useWebhookManagement->>SubBlockStore: Store webhookId, triggerPath, triggerConfig
useWebhookManagement->>SubBlockStore: Mark as checked
useWebhookManagement-->>TriggerSave: Return webhook state with URL
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
icecrasher321
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the reasoning.
Summary
The issue where the re rendering blocks specially when they go in and out of focus makes a call for GET api/webhooks irrespective of whether a webhookurl has been set for the workflow.
The fix was to make sure loadwebhookorgenerateurl function only gets called when useWebhookUrl is set true.
Type of Change
Testing
Tested manually by looking at server logs.
Checklist
Screenshots/Videos