fix: allow null contact first_name and last_name on webhook events - #140
Merged
Merged
Conversation
There was a problem hiding this comment.
cubic analysis
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Linked issue analysis
Linked issue: DEV-1625: Allow nullable contact first and last names in OpenAPI
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Contact first_name is represented as nullable in webhook event data | ContactEventData.FirstName was changed from string to string? and no longer uses default!. |
| ✅ | Contact last_name is represented as nullable in webhook event data | ContactEventData.LastName was changed from string to string? and no longer uses default!. |
Auto-approved: Fixes incorrect non-nullable deserialization to match the API contract and sibling Contact.cs, making two properties nullable with JSON omit-on-null. No operational tradeoff; the change only corrects wrong behavior.
Re-trigger cubic
Approval not submitted
This repository is configured to approve as @klotty, but that approval identity is unavailable.
Reconnect or verify the approval identity in repository settings.
cubic left this as a normal review comment instead of falling back to a Cubic App approval.
gabrielmfern
marked this pull request as ready for review
August 17, 2026 20:23
gabrielmfern
force-pushed
the
feature/dev-1625-nullable-contact-names
branch
from
August 17, 2026 20:26
31583fd to
f861081
Compare
gabrielmfern
marked this pull request as draft
August 17, 2026 20:27
gabrielmfern
marked this pull request as ready for review
August 18, 2026 17:23
gabrielmfern
marked this pull request as draft
August 18, 2026 17:47
gabrielmfern
marked this pull request as ready for review
August 18, 2026 17:47
gabrielmfern
force-pushed
the
feature/dev-1625-nullable-contact-names
branch
2 times, most recently
from
August 18, 2026 17:49
f95f783 to
83b2d83
Compare
gabrielmfern
marked this pull request as draft
August 18, 2026 17:49
gabrielmfern
marked this pull request as ready for review
August 18, 2026 17:52
gabrielmfern
force-pushed
the
feature/dev-1625-nullable-contact-names
branch
from
August 18, 2026 18:46
83b2d83 to
b8a6b63
Compare
Both were declared string with = default!, which suppressed the nullable warning and let a null land in a property every consumer treats as non-null. Contact.cs in the same solution already uses string?. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gabrielmfern
force-pushed
the
feature/dev-1625-nullable-contact-names
branch
from
August 24, 2026 19:13
b8a6b63 to
9765238
Compare
dielduarte
approved these changes
Aug 24, 2026
This was referenced Aug 24, 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.
The response side of this SDK is already correct:
Contact.csdeclares both names asstring?. OnlyResend.Webhooks.ContactEventDatalagged, where they were:Nullable reference types are enabled in this project, but System.Text.Json does not enforce those annotations, so
"first_name": nulldeserializes without throwing. The= default!then suppresses the compiler warning that would have caught it. The result is anullsitting in a property the compiler and every consumer treat as non-null, which surfaces as aNullReferenceExceptionat the call site rather than at decode. A silent wrong answer instead of a loud failure.Changed to
string?, matchingContact.csin the sibling package.Not a breaking change
The diff is two lines and annotation-only:
stringandstring?are the same runtime type,System.String. Nullability lives inNullableAttributemetadata, so the IL signature is unchanged and already-compiled consumer assemblies keep working untouched.The one visible effect is that consumers who read these properties into a non-nullable
stringwill see a nullable warning (CS8600/CS8602) where they previously saw none. That warning is the point: it marks a spot where anullfrom the API could already have caused aNullReferenceExceptionat runtime. Builds still succeed by default.Payload shape, confirmed against the monorepo
These keys can be absent, null, or a string. The producer schema at
packages/inngest/src/schemas/contacts.ts:104declaresfirstName: z.string().nullish()(Zod forstring | null | undefined), andapps/background-jobs/src/inngest/functions/webhooks/contact-events-webhook.ts:91forwards the value to Svix uncoalesced, soundefineddrops the key during serialization whilenullsurvives. Thecontact.createdfixture inWebhookOutOfOrderTests.csshows the absent case, with adataobject carrying onlyid,created_at,updated_at,email, andunsubscribed.string?collapses all three states tonull, which is all C# can express, so no further distinction is needed here. The equivalent Node and Python types did need to spell out both halves.Verification
Builds clean with 0 warnings. All 11 tests in
Resend.Webhooks.Testspass.No test added. The existing suite has no contact-webhook null coverage to extend, and a test asserting only that a nullable property accepts null would restate the type. Say the word if you want one.
Related
Spec fix in resend/resend-openapi#91.
Ref DEV-1625
Version bump
Sets
Directory.Build.propsto 0.9.1. That value had drifted badly: it read0.7.0while the latest tag isv0.9.0.It is only a fallback for local builds. The published version comes from the git tag, since
cicd/release.shderivesVERSIONfromrefs/tags/v*and passes-p:Version=${VERSION}to everybuild,publish, andpack, which overrides the props value. So the real release still depends on taggingv0.9.1; this just stops the local default from lying.This repo normally bumps in a separate
chore:PR, so drop that commit if you would rather keep the split.