Skip to content

Conversation

@typotter
Copy link
Collaborator

@typotter typotter commented Jan 9, 2026

Eppo Internal:

🎟️ Fixes related to v4.0.0 SDK migration
πŸ“œ Design Doc: N/A

Motivation and Context

The Android SDK needs to be upgraded to use sdk-common-jvm:4.0.0-SNAPSHOT, which includes breaking changes to the BaseEppoClient constructor signature and requires the format field in configuration JSON. Without this upgrade, the Android SDK cannot use the latest core library.

Description

This PR migrates the Android SDK to be compatible with sdk-common-jvm:4.0.0-SNAPSHOT. The migration addresses two key changes:

1. BaseEppoClient Constructor Signature Change (EppoClient.java:52)

The v4.0.0-SNAPSHOT constructor removed the deprecated host parameter:

  • Before (v3): apiKey, sdkName, sdkVersion, host, apiBaseUrl, ...
  • After (v4): apiKey, sdkName, sdkVersion, apiBaseUrl, ...

Solution: Use fallback logic apiBaseUrl != null ? apiBaseUrl : host to maintain backward compatibility with code using the deprecated .host() builder method.

2. Configuration Format Field Requirement (EppoClientTest.java:712)

v4.0.0 requires a format field in configuration JSON:

  • "format": "CLIENT" for obfuscated/hashed flag keys
  • "format": "SERVER" for plain/unobfuscated keys

Solution: Added "format": "CLIENT" to the pre-seeded cache test data in testDifferentCacheFilesPerKey().

How has this been documented?

Code Comments:

  • The constructor fallback logic is self-documenting
  • Test data format field matches production configuration format

No external documentation changes required as these are internal implementation changes that maintain API compatibility. The public SDK API remains unchanged.

How has this been tested?

Unit Tests: βœ… All passing (100%)

./gradlew test
BUILD SUCCESSFUL

Integration Tests: βœ… All 23/23 passing (100%)

./gradlew eppo:connectedCheck
BUILD SUCCESSFUL
Starting 23 tests on Medium_Phone_API_36.0(AVD) - 16
Medium_Phone_API_36.0(AVD) - 16 Tests 23/23 completed. (0 skipped) (0 failed)

Test Coverage Includes:

  1. βœ… Client initialization with deprecated .host() method (backward compatibility)
  2. βœ… Client initialization with .apiBaseUrl() method
  3. βœ… Offline mode with pre-seeded cache
  4. βœ… Multiple API keys with different cache files (testDifferentCacheFilesPerKey)
  5. βœ… Configuration change listeners
  6. βœ… Assignment evaluation for all variation types (boolean, numeric, string, JSON)

All existing functionality works correctly with the new v4.0.0-SNAPSHOT core library.

@typotter typotter marked this pull request as ready for review January 9, 2026 16:38
runTestCases();
}

@Test
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

getTypedAssignment was protected level and only used by the test suite in the android sdk to test graceful degredation. graceful mode is fully tested (and implemented) in the common sdk, so these tests are redundant.

@typotter typotter requested a review from aarsilv January 9, 2026 16:46
@typotter typotter marked this pull request as draft January 9, 2026 16:47
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