Repository navigation
Drop empty and all-zero identifiers - #66
Open
jrosendahl-opt wants to merge 2 commits into
Open
jrosendahl-opt wants to merge 2 commits into
jrosendahl-opt wants to merge 2 commits into
Conversation
A typed identifier with a blank value was sent as "prefix:", and a blank Email or PhoneNumber was hashed, sending the SHA-256 of the empty string as if it were an ID. Drop both, as the iOS SDK now does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"00000000-0000-0000-0000-000000000000" is the placeholder Android and iOS return when the user has opted out or tracking isn't authorized, shared by every such device. Drop it, like an empty value, for the device GAID and for AppleIdfa, GoogleGaid, RokuRida, SamsungTifa and AmazonFireAfai. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
A typed identifier whose value was blank after normalization was sent as
prefix:(e.g.PostalCode(" ")→z:), and a blankEmailorPhoneNumberwas hashed, sendinge:e3b0c442…b855, the SHA-256 of the empty string, as if it were a real ID. All-zero device advertising IDs (00000000-0000-0000-0000-000000000000), the placeholder Android and iOS return when the user has opted out or tracking isn't authorized, were also sent when passed in, so opted-out devices could share one ID. The iOS SDK now drops these (branchfix/drop-empty-identifiers), and the same behaviour was requested for both SDKs.What Changed
IdentifiersEncoderdrops any typed identifier whose encoded value is empty, centrally in the helper every typed identifier goes through (postal code, IPs, device IDs, NetID, ID5, Utiq,Custom, including the visitor IDv).EmailandPhoneNumberare dropped when the value is empty after normalization (whitespace removed, lowercased), instead of hashing it.AppleIdfa,GoogleGaid,RokuRida,SamsungTifa,AmazonFireAfai) made only of0and-after normalization are dropped. IDs with only some zeros are kept.Hem/HashedPhoneNumberalready dropped blank values.Rawis unchanged here; #65 routes known raw types through the typed identifiers, so it gets these rules after a rebase. Dropped identifiers go nowhere: the encoder never adds them, foridentifyand targetingidsandhidsalike.How to Test
./gradlew testpasses (164 tests locally)Notes
For 1.3.0: not breaking, only junk values stop being sent. #62 and #65 edit the same encoder and will need a small rebase after this; merging this before #62 is easiest.
🤖 Generated with Claude Code