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
feat(audience-consent): add CanTrack and CanIdentify predicates on ConsentLevel (SDK-226)
Centralise the consent rules behind two extension predicates and adopt
them at every internal gate site that previously inlined the rule.
ConsentLevelExtensions stays internal: same convention as
IdentityTypeExtensions, no external caller today, and a future PR can
promote when one lands.
Predicates:
CanTrack returns level != None.
Fail-open on out-of-range casts so an unrecognised value
still tracks, matching the gate shape every other call
site already uses.
CanIdentify returns level == Full.
Fail-closed on out-of-range casts. Identify and Alias
must not leak PII under uncertain consent.
Adoption:
ImmutableAudience.cs (5 sites): Identify gate, Alias gate, the
private static CanTrack body, Enqueue's drain-time recheck closure,
FireGameLaunch early return.
Identity.cs (1 site): GetOrCreate's null-on-no-consent guard.
Test coverage in Tests/Runtime/ConsentLevelTests.cs pins each enum
value against both predicates plus the out-of-range cast for both
fail policies, so a future change that flips either default breaks
the build loudly.
SDK-143 originally scoped the full consent infrastructure (state
machine, persistence, side effects, server sync, gates). The state
machine, persistence, side effects, and server sync shipped under
SDK-119, SDK-142, and SDK-147. SDK-226 was carved out for the
remaining slice this commit delivers.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments