Updating webhook data fields#112
Conversation
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 4/5
- This PR is likely safe to merge, with a minor serialization risk rather than a clear merge-blocker.
- In
src/Resend.Webhooks/EmailEventData.cs, nullable webhook fields may be emitted as explicitnullvalues becauseJsonIgnoreCondition.WhenWritingNullwas not applied, which can alter downstream JSON shape expectations. - Given the issue’s moderate-low severity (4/10) and focused scope to one model file, the overall regression risk appears limited.
- Pay close attention to
src/Resend.Webhooks/EmailEventData.cs- ensure nullable webhook properties don’t unintentionally change payload contracts by serializing as null.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/Resend.Webhooks/EmailEventData.cs">
<violation number="1" location="src/Resend.Webhooks/EmailEventData.cs:31">
P2: Nullable webhook fields were added without `JsonIgnoreCondition.WhenWritingNull`, so they can serialize as explicit nulls and change the emitted JSON shape.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/Resend.Webhooks/EmailEventData.cs">
<violation number="1" location="src/Resend.Webhooks/EmailEventData.cs:71">
P1: `Suppressed` is typed as `EmailFailedData`, but the webhook payload and the newly added `EmailSuppressedData` model indicate it should use `EmailSuppressedData` instead.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Auto-approved: Low-risk additive change: adds optional fields and new model classes to webhook data payloads. All new fields are omitted when null via JsonIgnore, preserving backward compatibility. No logic changes,
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Auto-approved: Adding optional fields to webhook models that match the latest Resend API schema is backward-compatible and low-risk; all new fields are nullable and ignored when null, so existing deserialization remains unaffected.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Auto-approved: These changes add optional fields to existing webhook data models to support new Resend schema fields, with all new properties marked as nullable and ignored when null, ensuring backward compatibility and minimal risk.
Re-trigger cubic
Start work on #105. Added some fields to the email event data payload object and the audience id to contact event data.
Creating as a draft as there is more info needed to complete this (see #105 for discussion).
Summary by cubic
Update webhook payload models to match the latest Resend schema. Email events add inbound fields (
bcc,cc,message_id,attachments) and new metadata (broadcast_id,template_id,tags,failed.reason,suppressed.{message,type},bounce.diagnosticCode), and contact events addaudience_id; all new fields are optional and ignored when null via JsonIgnore, andsuppressed.typeis fixed.Written for commit c55cc55. Summary will update on new commits.