Skip to content

Drop identifiers that are empty after normalization - #99

Open
jrosendahl-opt wants to merge 1 commit into
masterfrom
fix/drop-empty-identifiers
Open

jrosendahl-opt wants to merge 1 commit into
masterfrom
fix/drop-empty-identifiers

Conversation

@jrosendahl-opt

@jrosendahl-opt jrosendahl-opt commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Why

An identifier whose value is empty once normalized was still sent:

The Android SDK is getting the same rule.

Goes in 1.4.0.

What Changed

  • Source: OptableIdentifierEncoder.eid returns an empty string when nothing is left after the type prefix, so the identifier is dropped. This covers every type at once.
  • Source: email and phoneNumber return an empty string instead of hashing an empty value.
  • Source: targeting hids skip empty identifiers, as ids and identify already did, instead of sending an empty hid=. [BREAKING] Add OptableIdentifier.raw for pre-encoded identifiers #98 makes the same one-line change; the two merge cleanly.

How to Test

  • bundle exec fastlane tests passes (ran the suite on an iPhone 17 Pro simulator)
  • New tests: every typed identifier with a blank value encodes to ""; empty Email and phone number are never hashed; targeting id/hid drop a blank identifier

Notes

🤖 Generated with Claude Code

An identifier whose value normalizes to nothing, like .postalCode("   ")
or .custom(2, ""), was sent as a bare "prefix:". .emailAddress("") and
.phoneNumber(" ") were worse: they sent the SHA256 of an empty string,
which looks like a real ID. All of these now encode to an empty string
and are dropped from identify and targeting.

Targeting hids now skip empty identifiers, as ids already did, instead
of sending an empty hid=.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jrosendahl-opt
jrosendahl-opt requested review from a team as code owners November 10, 2026 02:20
jrosendahl-opt added a commit that referenced this pull request Nov 10, 2026
An unknown type with a whitespace-only value, like "xyz:   ", was sent as
given. It's now dropped, matching #99, which drops typed identifiers that
are empty after normalization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jrosendahl-opt jrosendahl-opt changed the title Drop identifiers that are empty after normalization [BREAKING] Drop identifiers that are empty after normalization Nov 10, 2026
@jrosendahl-opt jrosendahl-opt changed the title [BREAKING] Drop identifiers that are empty after normalization Drop identifiers that are empty after normalization Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant