fix(gmail-webhook): gmail credential injection issue with webhook block#865
fix(gmail-webhook): gmail credential injection issue with webhook block#865icecrasher321 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Greptile Summary
This PR fixes a Gmail credential injection bug in the webhook block configuration by moving Gmail credential management from the webhook provider config system to the established sub-block architecture. The changes ensure Gmail credentials are properly persisted and injected when using Gmail webhook triggers.
The fix involves two main components:
-
Webhook Block Configuration (
webhook.ts): Adds a newgmailCredentialOAuth input sub-block that appears conditionally when 'gmail' is selected as the webhook provider. This sub-block follows the same pattern as the Gmail block, requiringgmail.modifyandgmail.labelsOAuth scopes for proper API access. -
Webhook Component (
webhook.tsx): Refactors the Gmail credential handling to use theuseSubBlockValuehook instead of an inlineToolCredentialSelectorcomponent. The component now retrieves the Gmail credential ID from the sub-block store and injects it into the webhook configuration during save operations.
This change aligns Gmail webhook credential management with the codebase's established sub-block pattern used throughout the application. Previously, Gmail credentials were handled separately through the webhook provider config, which created a disconnect when credentials existed but weren't properly connected via the webhook block itself. The sub-block system ensures consistent credential persistence and injection across workflow execution, matching the architecture used by other OAuth-enabled blocks in the platform.
Confidence score: 4/5
- This PR addresses a specific architectural inconsistency with minimal risk of breaking existing functionality
- Score reflects well-isolated changes that follow established patterns and fix a clear bug in credential management
- Pay close attention to the webhook component changes to ensure proper credential flow integration
2 files reviewed, no comments
Summary
Gmail credential should have been persisted + injected using subblock system -- not through webhook provider config.
This previously affected the case where credentials already existed but were not actually connected via a webhook block itself.
Type of Change
Testing
Tested by using ngrok + manually triggering gmail polling job.
Checklist