Post-merge hardening: CLI verbose null-guard (#117) + out-of-order webhook test (#118)#129
Merged
Merged
Conversation
…bhook test #117 made EmailMessage.From nullable, but EmailSendCommand's --verbose branch dereferenced message.From.Email unconditionally, throwing NRE on a template send that omits from. Null-guard it. #118 fixed out-of-order webhook deserialization but the repo had no test for it. Add WebhookOutOfOrderTests covering the real type-last email ordering, contact created_at-first ordering, and malformed envelopes (duplicate/missing/unknown properties).
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds a null-guard for CLI verbose mode and adds webhook deserialization tests. Low risk, isolated changes.
Re-trigger cubic
This was referenced Jul 9, 2026
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.
Two small hardening follow-ups found during release QA.
CLI
--verbosenull-guard (regression from #117)#117 made
EmailMessage.From/Subjectnullable so hosted-template sends can omit them. ButEmailSendCommand's--verbosebranch didmessage.From.Emailunconditionally → NullReferenceException whenfromis omitted (exactly the template-send case #117 enables). Guarded it. Verified:email send --verbosewithfromomitted now prints output and completes instead of crashing.Out-of-order webhook regression test (guards #118)
#118 made
WebhookEventConverterparsetype/created_at/datain any order, but the repo had no test for it — existing tests round-trip through the SDK's own writer, which always emitstypefirst, so they'd pass even on the pre-#118 converter. AddedWebhookOutOfOrderTests:typelast (the real Resend/staging ordering, confirmed live during QA)created_atfirsttype, missingdata, unknown property) →JsonExceptionVerification
Build + Resend.Webhooks.Tests on .NET 8: 11/11 pass; CLI builds and the verbose path was exercised with
fromomitted.Summary by cubic
Hardens the CLI and webhook handling after recent changes. Prevents a verbose-mode crash on template sends and adds tests to ensure out-of-order webhook envelopes are parsed correctly.
email send --verbosewhenfromis omitted (template sends).typelast, contactcreated_atfirst) and ensure malformed payloads throwJsonException.Written for commit dfe7a5c. Summary will update on new commits.