You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(audience): make identityType mandatory on Identify and Alias
CDP requires identityType on every identify / alias event so it can
match records to the correct identity namespace during data deletion.
Enforce the invariant through the type system end to end:
- `Identify(userId, identityType, traits?)` — identityType is
non-nullable. The null/empty warn-and-drop block is gone; the type
signature no longer lies about optionality.
- `Alias(fromId, fromType, toId, toType)` — fromType and toType are
non-nullable. Same block removed.
- `MessageBuilder.Identify` — identityType parameter is non-nullable
and always emitted; the conditional that omitted an empty field is
gone so the wire shape cannot drift.
- `IdentityType.ToLowercaseString()` — casting to an out-of-range
enum value now throws `ArgumentOutOfRangeException` rather than
returning null. A silent null used to leak through to a dropped
event; now the programmer error fails loud at the call site.
Tests repointed: invalid-enum-cast cases assert the throw, and
MessageBuilder tests that passed `null` for identityType now pass a
valid value since the parameter is no longer nullable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments