Skip to content

feat(audience): warn and drop Identify()/Alias() calls with a malformed passport id#817

Merged
nattb8 merged 1 commit into
mainfrom
feat/validate-passport-id
Jul 10, 2026
Merged

feat(audience): warn and drop Identify()/Alias() calls with a malformed passport id#817
nattb8 merged 1 commit into
mainfrom
feat/validate-passport-id

Conversation

@nattb8

@nattb8 nattb8 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Studios sometimes call Identify() or Alias() with IdentityType.Passport but pass their own internal user id instead of a real Passport id, and today nothing catches it, so bad data silently flows into the audience pipeline. This rejects the call (no event sent, UserId untouched) and logs a warning when the id doesn't match the shape Passport actually issues (connection|id or a bare UUID), so studios see the mistake immediately during local testing instead of finding it in the data warehouse later.

Test plan

  • Unit tests covering: malformed passport id warns and drops the call (no event enqueued, UserId stays null) for both Identify() and Alias() (either side); valid pipe-form/UUID/whitespace-padded ids and non-passport identity types never warn or drop
  • Unit tests confirming a whitespace-padded valid passport id is stored and sent trimmed, not with the padding intact (the id that's validated and the id that's stored/sent must match)
  • Sample-app PlayMode test exercising the Identify() rejection through the UI, and fixed existing sample-app tests (Identify and Alias) that used non-Passport-shaped ids under the default Passport identity type
  • dotnet build src/Audience.Build/Audience.Tests/Audience.Tests.csproj succeeds with no new warnings
  • dotnet test src/Audience.Build/Audience.Tests/Audience.Tests.csproj passes (375 tests, 0 failed)

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Audience SDK — Build Size

Platform SDK Size Change
Android 0.37 / 20.00 MB +0.01 MB
Windows 0.16 / 20.00 MB +0.00 MB
iOS 8.54 / 20.00 MB +0.03 MB
macOS 0.92 / 20.00 MB +0.02 MB

SDK Size = build minus empty app. Change = vs baseline. Fails if any platform exceeds its absolute size limit.

@nattb8 nattb8 force-pushed the feat/validate-passport-id branch from 1960016 to 32600c5 Compare July 9, 2026 23:52
@nattb8 nattb8 changed the title feat(audience): warn when Identify() passport id is malformed feat(audience): warn and drop Identify() calls with a malformed passport id Jul 9, 2026
@nattb8 nattb8 force-pushed the feat/validate-passport-id branch 2 times, most recently from a634604 to 6be0f9f Compare July 10, 2026 01:20
@nattb8 nattb8 changed the title feat(audience): warn and drop Identify() calls with a malformed passport id feat(audience): warn and drop Identify()/Alias() calls with a malformed passport id Jul 10, 2026
@nattb8 nattb8 marked this pull request as ready for review July 10, 2026 01:25
@nattb8 nattb8 requested review from a team as code owners July 10, 2026 01:25
@nattb8 nattb8 force-pushed the feat/validate-passport-id branch from 6be0f9f to c11b09e Compare July 10, 2026 01:30
…ed passport id

Studios sometimes call Identify() or Alias() with IdentityType.Passport
but pass their own internal user id instead of a real Passport id,
which silently pollutes downstream analytics. Reject the call (no-op,
no event sent) and log a warning when the id doesn't look like a
Passport id, using the same connection|id or UUID shape Passport
actually issues. Also adds sample-app coverage for the new behaviour.
@nattb8 nattb8 force-pushed the feat/validate-passport-id branch from c11b09e to bac4b2f Compare July 10, 2026 01:48
@nattb8 nattb8 merged commit e197b80 into main Jul 10, 2026
39 checks passed
@nattb8 nattb8 deleted the feat/validate-passport-id branch July 10, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants