Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

selectedTriggerId still being checked even if not in webhook mode

Type of Change

  • Bug fix

Testing

Tested manually

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 Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 9, 2026 6:21pm

Request Review

@icecrasher321 icecrasher321 changed the title fix(triggers): id resolution for tools with trigger mode fix(triggers): id resolution for tools with trigger mode + external subscription Feb 9, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 9, 2026

Greptile Overview

Greptile Summary

Fixed a bug in the resolveTriggerId function where selectedTriggerId and storedTriggerId fields were being checked before verifying that the block has triggerMode enabled. This caused incorrect trigger ID resolution for tool blocks (e.g., Stripe, Typeform) that support triggers but are not currently in trigger mode.

The fix reorders the logic to:

  • First check if the block is a dedicated trigger block (category === triggers)
  • Early return if triggerMode is not enabled
  • Only then check trigger-specific fields like selectedTriggerId and storedTriggerId

This ensures trigger ID resolution only happens for blocks that are actually in trigger mode or are dedicated trigger blocks.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is a straightforward logic reordering that adds proper guard conditions. It correctly handles the edge case where tool blocks with trigger capabilities were incorrectly attempting trigger ID resolution when not in trigger mode. The change is localized, maintains backward compatibility for actual trigger blocks, and follows a clear defensive programming pattern.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/deploy.ts Fixed trigger ID resolution to check triggerMode before accessing trigger-specific fields, preventing incorrect resolution for tool blocks not in trigger mode

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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321 icecrasher321 merged commit c749229 into staging Feb 9, 2026
12 checks passed
@icecrasher321 icecrasher321 deleted the fix/trigger-id-resolution branch February 9, 2026 18:28
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