Skip to content

fix(growth): accept Resend's current webhook payload shape - #989

Merged
blove merged 2 commits into
mainfrom
blove/resend-webhook-message-id
Sep 3, 2026
Merged

fix(growth): accept Resend's current webhook payload shape#989
blove merged 2 commits into
mainfrom
blove/resend-webhook-message-id

Conversation

@blove

@blove blove commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The canary fulfilment on 2026-09-03 was delivered by Resend, but its job stayed at delivery_status = submitted and no delivery.* webhook activity reached Neon. Signed replays against production showed why: the parser's closed key set rejects data.message_id, which Resend now includes, and it also rejects null for broadcast_id/template_id, which transactional mail carries. Every real event was answered 400.

Change (libs/growth/src/lib/webhooks.ts): allow message_id as bounded text and null for 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 growth passes (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

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
blove enabled auto-merge (squash) September 3, 2026 18:55
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 3, 2026 7:14pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit baed931 into main Sep 3, 2026
31 checks passed
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