Skip to content

fix(gmail-webhook): gmail credential injection issue with webhook block#865

Merged
icecrasher321 merged 1 commit intostagingfrom
fix/gmail-webhook
Aug 4, 2025
Merged

fix(gmail-webhook): gmail credential injection issue with webhook block#865
icecrasher321 merged 1 commit intostagingfrom
fix/gmail-webhook

Conversation

@icecrasher321
Copy link
Collaborator

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

  • Bug fix

Testing

Tested by using ngrok + manually triggering gmail polling job.

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
Copy link

vercel bot commented Aug 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 10:10pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Aug 4, 2025 10:10pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

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:

  1. Webhook Block Configuration (webhook.ts): Adds a new gmailCredential OAuth 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, requiring gmail.modify and gmail.labels OAuth scopes for proper API access.

  2. Webhook Component (webhook.tsx): Refactors the Gmail credential handling to use the useSubBlockValue hook instead of an inline ToolCredentialSelector component. 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

Edit Code Review Bot Settings | Greptile

@icecrasher321 icecrasher321 merged commit f3880ad into staging Aug 4, 2025
5 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/gmail-webhook branch August 6, 2025 02:01
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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