feat(audience-sdk)!: drop Identify/Alias string-identityType overloads (SDK-271)#723
Merged
ImmutableJeffrey merged 1 commit intoApr 30, 2026
Conversation
nattb8
previously approved these changes
Apr 30, 2026
b899f54 to
4051a6b
Compare
4abf62e to
38357db
Compare
The Audience backend accepts only the closed IdentityType enum. The string-identityType overloads on Identify and Alias were vestigial: anything outside the enum gets rejected at validation, and studios with a proprietary system already have IdentityType.Custom as the escape hatch. Removes the overloads to match the TS SDK shape and reduce footguns. BREAKING CHANGE: callers of Identify(string, string, ...) or Alias(string, string, string, string) must migrate to the IdentityType overload. Direct mapping: "steam" -> IdentityType.Steam, "passport" -> IdentityType.Passport, etc., per IdentityTypeExtensions.ToLowercaseString. - ImmutableAudience.cs: consolidates each pair into the IdentityType overload, calling .ToLowercaseString() inline at the MessageBuilder call site. Drops the two string overloads and their wrappers. - ImmutableAudienceTests.cs: migrates four test calls from string to enum form (Identify and Alias). dotnet test: 274 passed, 0 failed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38357db to
f8e0fa7
Compare
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.
Summary
Removes the two
IdentifyandAliasoverloads onImmutableAudiencethat take an identity type as a plain string. Studios now have only the overloads that take the typedIdentityTypeenum.Before
After
Studios with a custom identity provider that isn't in the enum should use
IdentityType.Custom.Why
The Audience backend's
IdentityTypeis a closed enum. Anything outside the enum is rejected with a 4xx at validation. The string overloads looked like an extensibility point but producedAudienceErrorCode.ValidationRejectedfor any value not already in the enum. The TypeScript Audience SDK never exposed these overloads. This change brings Unity in line and removes a way for studios to accidentally ship events the backend will reject.Implementation
ImmutableAudience.Identify(string, IdentityType, Dictionary?)andImmutableAudience.Alias(string, IdentityType, string, IdentityType)now contain the validation, lock, and enqueue logic directly. The wire-format conversion (.ToLowercaseString()) happens inline at theMessageBuilderboundary.ImmutableAudienceTests.csmigrated to the enum form.Breaking change
feat!:conventional-commit prefix. Studios calling the string overloads must migrate per the table above.PR stack
mainautomatically.dotnet testpasses (274 / 274; 1 pre-existing skip).Linear: SDK-271