Skip to content

fix(gmail-poller): resolve OAuth credential provider aliases#5770

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/gmail-poller-credential-lookup
Jul 20, 2026
Merged

fix(gmail-poller): resolve OAuth credential provider aliases#5770
waleedlatif1 merged 1 commit into
stagingfrom
fix/gmail-poller-credential-lookup

Conversation

@j15z

@j15z j15z commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Canonicalize Gmail trigger service IDs before deploy-time credential lookup
  • Add regression coverage for provider aliases and workspace credential isolation

Type of Change

  • Bug fix

Testing

  • 93 focused tests passed
  • App type-check passed
  • bun run lint passed
  • bun run check:api-validation:strict passed

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 Jul 20, 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 Jul 20, 2026 6:43pm

Request Review

@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Small, targeted change at deploy credential validation with regression test; no new auth paths or data model changes.

Overview
Fixes Gmail (and similar) trigger deploy failures where valid workspace OAuth credentials were rejected because deploy compared the trigger’s service ID (e.g. gmail) directly to credential.providerId in the database (e.g. google-email).

resolveTriggerCredentialId now runs the trigger serviceId through getProviderIdFromServiceId before the DB lookup, so aliases resolve to the canonical OAuth provider ID while workspace, type, and credential reference checks stay the same.

The function is exported for unit tests, with a new test that asserts a gmail service ID queries providerId google-email.

Reviewed by Cursor Bugbot for commit 3943e5e. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes deploy-time OAuth credential lookup for Gmail triggers. The main changes are:

  • Maps trigger service aliases to canonical provider IDs before querying credentials.
  • Preserves workspace, credential type, credential ID, and account ID filters.
  • Adds focused tests for Gmail alias resolution.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • Unknown service IDs retain the previous identity lookup behavior.
  • Workspace and OAuth credential isolation remain unchanged.

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/deploy.ts Canonicalizes OAuth service IDs before credential lookup without weakening workspace or credential constraints.
apps/sim/lib/webhooks/deploy.test.ts Adds focused coverage for Gmail provider alias resolution and the credential query predicates.

Reviews (1): Last reviewed commit: "fix(gmail-poller): resolve OAuth credent..." | Re-trigger Greptile

@j15z
j15z force-pushed the fix/gmail-poller-credential-lookup branch from e78ec79 to 3943e5e Compare July 20, 2026 18:43
@j15z
j15z requested a review from waleedlatif1 July 20, 2026 19:33
@waleedlatif1
waleedlatif1 merged commit 031a295 into staging Jul 20, 2026
19 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/gmail-poller-credential-lookup branch July 20, 2026 20:18
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.

2 participants