-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(copilot): fix webhook triggers unsaving in new diff store #2096
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryFixes webhook triggers becoming unsaved when using the new diff store by adding server-side webhook persistence during workflow saves and improved 404 handling in the webhook management hook. Key Changes:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Frontend
participant SubBlockStore
participant WorkflowAPI
participant WebhookAPI
participant Database
User->>Frontend: Edit workflow with webhook triggers
Frontend->>SubBlockStore: Store webhookId, triggerId, triggerConfig
User->>Frontend: Save workflow
Frontend->>WorkflowAPI: PUT /api/workflows/[id]/state
WorkflowAPI->>Database: Save workflow state to normalized tables
WorkflowAPI->>WorkflowAPI: syncWorkflowWebhooks()
loop For each block with webhookId
WorkflowAPI->>Database: Check if webhook exists
alt Webhook exists
WorkflowAPI->>Database: Update webhook if needed (workflowId, blockId, path)
else Webhook missing (404)
WorkflowAPI->>Database: Recreate webhook with stored metadata
WorkflowAPI->>WorkflowAPI: Log webhook recreation
end
end
WorkflowAPI-->>Frontend: Success response
Note over User,Database: Hook's updateWebhook now handles 404 by recreating
User->>Frontend: Update webhook config later
Frontend->>WebhookAPI: PATCH /api/webhooks/[id]
alt Webhook found
WebhookAPI->>Database: Update providerConfig
WebhookAPI-->>Frontend: Success
else Webhook not found (404)
WebhookAPI-->>Frontend: 404 error
Frontend->>Frontend: useWebhookManagement detects 404
Frontend->>SubBlockStore: Clear webhookId
Frontend->>WebhookAPI: POST /api/webhooks (recreate)
WebhookAPI->>Database: Insert new webhook
Frontend->>SubBlockStore: Store new webhookId
end
|
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.
Tested with schedules, webhooks. Code organization makes sense.
* Fix copilot trigger unsave * Fix for schedules * fix lint * hide schedule save subblock from preview --------- Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
Summary
Copilot re-creates blocks which cascade deletes webhook configs. This takes a snapshot of the webhook + schedule config and recreates it.
Type of Change
Testing
Tested with @icecrasher321
Checklist