Skip to content

[AI-FSSDK] [FSSDK-12670] Block ODP identify event for single identifier#629

Open
jaeopt wants to merge 4 commits into
masterfrom
ai/jaeopt/FSSDK-12670-odp-event
Open

[AI-FSSDK] [FSSDK-12670] Block ODP identify event for single identifier#629
jaeopt wants to merge 4 commits into
masterfrom
ai/jaeopt/FSSDK-12670-odp-event

Conversation

@jaeopt
Copy link
Copy Markdown
Contributor

@jaeopt jaeopt commented May 26, 2026

Summary

Fixes the ODP identify event to only send when multiple valid identifiers exist. Previously, identify events were always sent even with a single identifier, which provided no linking value and generated unnecessary network traffic.

Changes

  • Changed ODPEventManager.identifyUser to accept a Map of identifiers and filter out null/empty values
  • Added guard to skip identify event when fewer than 2 valid identifiers remain
  • Updated Optimizely.identifyUser to construct identifier map internally while keeping backward-compatible String parameter

Jira Ticket

FSSDK-12670

Notes

Skip sending ODP identify event when fewer than 2 valid (non-null,
non-empty) identifiers exist. Changed ODPEventManager.identifyUser
to accept a Map<String, String> of identifiers and filter out
null/empty values before checking count.

Updated Optimizely.identifyUser to construct identifier map from
userId string and pass to ODPEventManager. Updated all related
tests to use Map-based API.
…compatibility

Keep old identifyUser(String) and identifyUser(String, String) signatures
as @deprecated wrappers that delegate to the new identifyUser(Map) method.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@Mat001 Mat001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. A few comments.

Additional comment:
Several tests use assertEquals(identifiers.size(), 2) (JUnit convention is assertEquals(expected, actual)). The new test identifyUserSendsWithThreeIdentifiers correctly uses assertEquals(3, eventIdentifiers.size()) but the updated identifyUserWithMultipleIdentifiers still has the args reversed: assertEquals(eventIdentifiers.size(), 2). Inconsistent within the same PR.

Comment thread core-api/src/main/java/com/optimizely/ab/odp/ODPEventManager.java
Comment thread core-api/src/main/java/com/optimizely/ab/odp/ODPEventManager.java
@jaeopt jaeopt requested a review from Mat001 May 27, 2026 16:41
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.

2 participants