fix: allow null content_id in inbound email attachments#255
Conversation
Resend sends content_id: null for regular file attachments (e.g. mp3s). Only inline attachments have a string content_id. The Zod schema was rejecting these payloads with a 400 error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA schema validation change to allow null values for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
content_id: nullfor regular file attachments (mp3s, etc.) — only inline attachments (embedded images) have a stringcontent_idvalidateInboundEmailEventwas rejecting these payloads with a 400 error, preventing the webhook from processing emails with file attachmentscontent_id: z.string()tocontent_id: z.string().nullable()to accept null valuesTest plan
validateInboundEmailEvent.test.tswith 4 tests covering: no attachments, string content_id, null content_id, and invalid payload🤖 Generated with Claude Code
Summary by CodeRabbit