Add message_id to EmailReceipt and EmailEventData#123
Conversation
There was a problem hiding this comment.
No issues found across 5 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adding message_id property to EmailReceipt and EmailEventData models, with mock updates and tests. Low risk, additive change.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 5 files (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="tests/Resend.Webhooks.Tests/WebhookEventConverterTests.cs">
<violation number="1" location="tests/Resend.Webhooks.Tests/WebhookEventConverterTests.cs:44">
P1: The `EmailEventRoundtrip` test calls `expected.DataAs<EmailEventData>()` on the pre-serialization object rather than `actual.DataAs<EmailEventData>()` on the deserialized result. Since `expected.Data` was assigned `expectedEmail` directly, this reads back the original object instead of the roundtripped data — so the new `MessageId` assertion can never fail, regardless of whether `message_id` is correctly serialized or deserialized. Please change `expected.DataAs<EmailEventData>()` to `actual.DataAs<EmailEventData>()` to actually validate the roundtrip.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| Assert.Equal( expected.MomentCreated, actual.MomentCreated ); | ||
| Assert.Equal( expected.Data.GetType(), actual.Data.GetType() ); | ||
|
|
||
| var actualEmail = expected.DataAs<EmailEventData>(); |
There was a problem hiding this comment.
P1: The EmailEventRoundtrip test calls expected.DataAs<EmailEventData>() on the pre-serialization object rather than actual.DataAs<EmailEventData>() on the deserialized result. Since expected.Data was assigned expectedEmail directly, this reads back the original object instead of the roundtripped data — so the new MessageId assertion can never fail, regardless of whether message_id is correctly serialized or deserialized. Please change expected.DataAs<EmailEventData>() to actual.DataAs<EmailEventData>() to actually validate the roundtrip.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/Resend.Webhooks.Tests/WebhookEventConverterTests.cs, line 44:
<comment>The `EmailEventRoundtrip` test calls `expected.DataAs<EmailEventData>()` on the pre-serialization object rather than `actual.DataAs<EmailEventData>()` on the deserialized result. Since `expected.Data` was assigned `expectedEmail` directly, this reads back the original object instead of the roundtripped data — so the new `MessageId` assertion can never fail, regardless of whether `message_id` is correctly serialized or deserialized. Please change `expected.DataAs<EmailEventData>()` to `actual.DataAs<EmailEventData>()` to actually validate the roundtrip.</comment>
<file context>
@@ -1,174 +1,174 @@
+ Assert.Equal( expected.MomentCreated, actual.MomentCreated );
+ Assert.Equal( expected.Data.GetType(), actual.Data.GetType() );
+
+ var actualEmail = expected.DataAs<EmailEventData>();
+
+ Assert.Equal( expectedEmail.Subject, actualEmail.Subject );
</file context>
Dismissed because Cubic found issues in a newer review.
hermesresend
left a comment
There was a problem hiding this comment.
LGTM — nullable MessageId on both EmailReceipt and EmailEventData with JsonIgnore(WhenWritingNull) is the right call for backward compat. Bulk of the diff is CRLF→LF normalization; real changes are small and well-tested.
Co-authored-by: cpenned <cpenned@users.noreply.github.com>
b6f3abc to
a633bdc
Compare
Summary
Adds
message_idtyping to match the Resend API and Node.js SDK:EmailReceipt—GET /emails/:id(and list) responsesEmailEventData— email webhook payloadsReceivedEmailalready hadMessageIdfor the receiving API.Summary by cubic
Expose the RFC Message-ID on email receipts and webhook events in the .NET SDK to match the Resend API and Node.js SDK for easier cross-system correlation.
MessageId(maps tomessage_id) toEmailReceiptforGET /emails/:idand list responses.MessageIdtoEmailEventDatafor all email webhooks (e.g.,email.sent,email.delivered,email.received).Written for commit a633bdc. Summary will update on new commits.