fix(growth): accept Resend's current webhook payload shape - #989
Merged
Conversation
Every real Resend webhook was answered 400, so delivery state never left "submitted" even though Resend reported the mail delivered. The parser enforces a closed key set pinned to the SDK 6.10 types, but Resend's wire payload now carries data.message_id, and transactional mail sends null broadcast_id and template_id. Any of those failed the closed validation. Allow message_id as bounded text and null for the optional ids. Unknown keys are still rejected so the schema stays closed. Verified against production with signed replays before the change (400) and the parser tests after it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
blove
enabled auto-merge (squash)
September 3, 2026 18:55
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Contributor
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.
The canary fulfilment on 2026-09-03 was delivered by Resend, but its job stayed at
delivery_status = submittedand nodelivery.*webhook activity reached Neon. Signed replays against production showed why: the parser's closed key set rejectsdata.message_id, which Resend now includes, and it also rejectsnullforbroadcast_id/template_id, which transactional mail carries. Every real event was answered 400.Change (
libs/growth/src/lib/webhooks.ts): allowmessage_idas bounded text andnullfor the two optional ids. Unknown keys are still rejected.Tests: the documented Resend payload shape now applies a delivered event; an unknown key (
headers) still fails closed.Verification:
nx run-many -t lint,test -p growthpasses (41 webhook tests); the website webhook route spec passes (10).After deploy, Resend's retries of the failed deliveries should start landing; the canary's own status was already set by a replay.
🤖 Generated with Claude Code