Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

  • Simplify Idempotency service to only check known headers
  • Generic Webhook variable references fixes

Type of Change

  • Bug fix

Testing

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 Sep 19, 2025

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

Project Deployment Preview Comments Updated (UTC)
sim Ready Ready Preview Comment Sep 19, 2025 4:18am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Sep 19, 2025 4:18am

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 implements two main changes to the webhook system: idempotency simplification and generic webhook variable fixes.

Idempotency Simplification: The PR fundamentally changes how webhook deduplication works by moving from a complex payload-based hashing system to a headers-only approach. Previously, the system would create deterministic hashes from webhook payloads after filtering out volatile fields like timestamps - a complex process that was error-prone across different webhook providers. Now, the IdempotencyService.createWebhookIdempotencyKey method only examines standard webhook headers (webhook-id, x-webhook-id, x-shopify-webhook-id, x-github-delivery, x-event-id) and falls back to generating random UUIDs when no header is found. This change affects multiple files: the service itself (lib/idempotency/service.ts), webhook execution handlers (background/webhook-execution.ts, app/api/webhooks/trigger/[path]/route.ts), and the module exports (lib/idempotency/index.ts).

Generic Webhook Changes: The PR addresses issues with generic webhook processing in two ways. First, it adds special handling in formatWebhookInput to return raw request bodies for generic webhooks instead of applying provider-specific formatting. Second, it removes all predefined output variables from the generic webhook trigger configuration (triggers/generic/webhook.ts), moving from static output definitions to what appears to be runtime variable resolution.

The changes integrate with the existing webhook processing pipeline by maintaining the same execution flow while simplifying the underlying idempotency mechanism. The idempotency service continues to work with the existing Redis-based deduplication system and logging infrastructure, but now relies on more predictable header-based identification rather than complex payload analysis.

Confidence score: 2/5

  • This PR introduces significant behavioral changes that could break existing webhook integrations, particularly for generic webhooks that may lose access to expected variables
  • Score reflects concerns about the removal of predefined output variables and the fundamental change in deduplication behavior for webhooks without standard headers
  • Pay close attention to apps/sim/triggers/generic/webhook.ts and test thoroughly with existing workflows that depend on webhook variables

7 files reviewed, 4 comments

Edit Code Review Bot Settings | Greptile

@icecrasher321 icecrasher321 merged commit 04922fe into staging Sep 19, 2025
6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/idempotency-webhooks branch September 25, 2025 22:40
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