fix: parse raw body Buffer in Vercel webhook controller#27384
Merged
ThyMinimalDev merged 1 commit intomainfrom Jan 29, 2026
Merged
fix: parse raw body Buffer in Vercel webhook controller#27384ThyMinimalDev merged 1 commit intomainfrom
ThyMinimalDev merged 1 commit intomainfrom
Conversation
Co-Authored-By: morgan@cal.com <morgan@cal.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
volnei
approved these changes
Jan 29, 2026
Contributor
E2E results are ready! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a bug where the Vercel webhook endpoint was returning 200 OK but not actually triggering the trigger.dev promotion.
Root cause: The
RawBodyMiddlewareprovides the request body as aBufferfor signature verification. However, the controller was trying to accesspayload.typedirectly on the Buffer, which is alwaysundefined. This caused the checkpayload.type !== "deployment.promoted"to always be true, returning early with{ status: "ignored" }without calling the trigger.dev API.Fix: The controller now properly parses the raw Buffer into JSON before checking the event type. It also handles the test environment case where the body may already be a parsed object.
How should this be tested?
Environment variables required:
VERCEL_PROMOTE_WEBHOOK_SECRET- webhook signature verificationTRIGGER_SECRET_KEY- bearer token for trigger.dev APITRIGGER_VERSION- deployment version to promoteMandatory Tasks (DO NOT REMOVE)
Human Review Checklist
Link to Devin run
https://app.devin.ai/sessions/0531a7a6f6d6442e92e73eb9accc9adc
Requested by
@ThyMinimalDev