fix(webhooks): centralize the path-delivery rule for trigger providers - #6428
Conversation
Fold the internal- and polling-provider exclusions into acceptsPathWebhookDelivery so the generic per-webhook path route has one predicate deciding which providers it serves, instead of the route body re-deriving it. Widen isPollingWebhookProvider to accept a nullable provider, matching isInternalTriggerProvider, and drop the resulting `?? ''` at both call sites. Regression coverage is sourced from the trigger registries so a newly added internal or polling trigger is covered automatically.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview That helper now returns false for internal triggers (
Reviewed by Cursor Bugbot for commit b476db4. Configure here. |
Greptile SummaryThe PR centralizes generic webhook-path eligibility so internal, polling, and provider-owned ingress routes are rejected by one predicate. It also makes polling-provider detection nullable and expands registry-driven route coverage.
Confidence Score: 5/5The PR appears safe to merge, with no actionable regressions identified in the centralized provider-delivery classification or nullable helper change. Current internal and polling providers do not require generic path delivery, registry-based tests enforce that classification, and nullable workspace-fork filtering remains behaviorally unchanged.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/webhooks/providers/index.ts | Centralizes path-delivery eligibility by excluding internal, polling, and provider-ingress-only providers without introducing an import cycle. |
| apps/sim/app/api/webhooks/trigger/[path]/route.ts | Replaces duplicated route-level exclusions with the centralized provider predicate while preserving rejection behavior. |
| apps/sim/app/api/webhooks/trigger/[path]/route.test.ts | Derives rejection cases from both provider registries and verifies neither queue nor resolved-target dispatch occurs. |
| apps/sim/triggers/constants.ts | Widens polling-provider detection to nullable input while retaining false for null and unchanged behavior for strings. |
| apps/sim/ee/workspace-forking/lib/copy/deploy-bridge.ts | Removes redundant null coercion now that the polling-provider helper directly accepts nullable database values. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Inbound generic webhook path] --> B[Resolve webhook rows by path]
B --> C{acceptsPathWebhookDelivery}
C -->|Internal provider| D[Reject with 404]
C -->|Polling provider| D
C -->|Provider-owned ingress| D
C -->|Generic path provider| E[Verify provider authentication]
E --> F[Dispatch resolved webhook target]
Reviews (1): Last reviewed commit: "fix(webhooks): centralize the path-deliv..." | Re-trigger Greptile
Summary
acceptsPathWebhookDelivery, so one predicate decides which providers the generic per-webhook path route serves instead of the route body re-deriving itisPollingWebhookProviderto accept a nullable provider, matchingisInternalTriggerProvider, and drop the resulting?? ''at both call sitesType of Change
Testing
bun run type-check,bun run lint,check:api-validation:strict,check:boundaries, andcheck:trigger-block-cyclepass. Webhook, trigger, and workspace-forking suites pass (923 tests); verified the added coverage fails when the rule is removed.Checklist