Skip to content

Post-merge hardening: CLI verbose null-guard (#117) + out-of-order webhook test (#118)#129

Merged
felipefreitag merged 1 commit into
mainfrom
chore/qa-hardening
Jul 9, 2026
Merged

Post-merge hardening: CLI verbose null-guard (#117) + out-of-order webhook test (#118)#129
felipefreitag merged 1 commit into
mainfrom
chore/qa-hardening

Conversation

@felipefreitag

@felipefreitag felipefreitag commented Jul 9, 2026

Copy link
Copy Markdown
Member

Two small hardening follow-ups found during release QA.

CLI --verbose null-guard (regression from #117)

#117 made EmailMessage.From/Subject nullable so hosted-template sends can omit them. But EmailSendCommand's --verbose branch did message.From.Email unconditionally → NullReferenceException when from is omitted (exactly the template-send case #117 enables). Guarded it. Verified: email send --verbose with from omitted now prints output and completes instead of crashing.

Out-of-order webhook regression test (guards #118)

#118 made WebhookEventConverter parse type/created_at/data in any order, but the repo had no test for it — existing tests round-trip through the SDK's own writer, which always emits type first, so they'd pass even on the pre-#118 converter. Added WebhookOutOfOrderTests:

  • email event with type last (the real Resend/staging ordering, confirmed live during QA)
  • contact event with created_at first
  • malformed envelopes (duplicate type, missing data, unknown property) → JsonException

Verification

Build + Resend.Webhooks.Tests on .NET 8: 11/11 pass; CLI builds and the verbose path was exercised with from omitted.


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.

  • Bug Fixes
    • CLI: Prevent NRE in email send --verbose when from is omitted (template sends).
    • Webhooks: Add regression tests for out-of-order envelopes (email type last, contact created_at first) and ensure malformed payloads throw JsonException.

Written for commit dfe7a5c. Summary will update on new commits.

Review in cubic

…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).

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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