feat: Update Java OpenFeature user ID mapping #176
Merged
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.
Summary
Adds support for
userIdfield in OpenFeature Provider for Java Server SDK to match behavior across all DevCycle SDKs and OpenFeature providers.Changes
• Enhanced
DevCycleUser.fromEvaluationContext()to supportuserIdas a fallback user ID source• Implemented correct priority order:
targetingKey→user_id→userId• Added type safety validation for all user ID fields (must be strings)
• Ensured all potential user ID fields are excluded from custom data
• Added comprehensive test coverage for new functionality
Test Coverage
• Priority order validation across all user ID sources
• Custom data exclusion for all user ID fields
• Type safety with non-string values
• Fallback behavior when higher priority fields are missing
Compatibility
✅ Fully backward compatible - no breaking changes
✅ All existing tests continue to pass
✅ Matches behavior of web, iOS, and Android OpenFeature providers
Resolves consistency across DevCycle SDKs per internal discussion.
Open Background Agent:
Web · Cursor
[Slack Thread](https://taplytics.slack.com/archives/C02DU5GTB6U/p1752872862815949%3Fthread_ts=1752872862.815949