Merged
Conversation
aarsilv
approved these changes
Aug 23, 2024
Contributor
aarsilv
left a comment
There was a problem hiding this comment.
🧹
The updated core library is much better about interface type (vs concrete) declaration as well
hbordersTwitch
pushed a commit
to hbordersTwitch/android-sdk
that referenced
this pull request
Sep 3, 2025
leoromanovsky
added a commit
that referenced
this pull request
Feb 3, 2026
* feat: add obfuscation utilities and precomputed DTOs Add the foundational data structures and utilities for the precomputed client feature: - ObfuscationUtils: MD5 hashing for flag key obfuscation - PrecomputedFlag: DTO for precomputed flag assignments - PrecomputedBandit: DTO for precomputed bandit assignments - PrecomputedConfigurationResponse: Wire protocol response parsing - BanditResult: Result container for bandit action lookups - MissingSubjectKeyException: Validation exception Includes comprehensive unit tests for serialization round-trips and MD5 hash consistency. * perf: optimize MD5 hex conversion with lookup table Replace Integer.toHexString() with a pre-computed hex character lookup table for byte-to-hex conversion. This avoids creating intermediate String objects for each byte, reducing allocations. Mirrors optimization from iOS SDK PR #91/#93. * perf: add md5HexPrefix for efficient partial hash Add md5HexPrefix() method that only converts the bytes needed for a given prefix length, avoiding unnecessary work when only a prefix is required (e.g., cache file naming uses first 8 chars). Includes unrolled loop for the common 4-byte (8 hex char) case to help compiler optimization, following iOS SDK PR #93 approach.
leoromanovsky
added a commit
that referenced
this pull request
Feb 3, 2026
* feat: add obfuscation utilities and precomputed DTOs Add the foundational data structures and utilities for the precomputed client feature: - ObfuscationUtils: MD5 hashing for flag key obfuscation - PrecomputedFlag: DTO for precomputed flag assignments - PrecomputedBandit: DTO for precomputed bandit assignments - PrecomputedConfigurationResponse: Wire protocol response parsing - BanditResult: Result container for bandit action lookups - MissingSubjectKeyException: Validation exception Includes comprehensive unit tests for serialization round-trips and MD5 hash consistency. * perf: optimize MD5 hex conversion with lookup table Replace Integer.toHexString() with a pre-computed hex character lookup table for byte-to-hex conversion. This avoids creating intermediate String objects for each byte, reducing allocations. Mirrors optimization from iOS SDK PR #91/#93. * perf: add md5HexPrefix for efficient partial hash Add md5HexPrefix() method that only converts the bytes needed for a given prefix length, avoiding unnecessary work when only a prefix is required (e.g., cache file naming uses first 8 chars). Includes unrolled loop for the common 4-byte (8 hex char) case to help compiler optimization, following iOS SDK PR #93 approach. * refactor: extract BaseCacheFile for reuse Extract common file caching functionality from ConfigCacheFile into a new BaseCacheFile base class. This enables reuse for the upcoming precomputed configuration cache without code duplication. - Add BaseCacheFile with common read/write/delete operations - Refactor ConfigCacheFile to extend BaseCacheFile - No functional changes to existing behavior * feat: add precomputed configuration storage Add the storage layer for precomputed flag configurations: - PrecomputedCacheFile: Disk cache file extending BaseCacheFile - PrecomputedConfigurationStore: In-memory + disk storage with async save/load operations and proper thread synchronization - Updates in-memory config even if disk write fails for resilience Also adds test data files to Makefile for integration testing. Includes unit tests for cache operations and failure scenarios. * style: apply spotless formatting * fix: address PR #239 feedback - Return null consistently in loadConfigFromCache for both file-not-found and read-error cases - Use static EMPTY singleton in PrecomputedConfigurationResponse.empty() - Use Collections.singletonMap() in getEnvironment() for memory efficiency
leoromanovsky
added a commit
that referenced
this pull request
Feb 4, 2026
* feat: add obfuscation utilities and precomputed DTOs Add the foundational data structures and utilities for the precomputed client feature: - ObfuscationUtils: MD5 hashing for flag key obfuscation - PrecomputedFlag: DTO for precomputed flag assignments - PrecomputedBandit: DTO for precomputed bandit assignments - PrecomputedConfigurationResponse: Wire protocol response parsing - BanditResult: Result container for bandit action lookups - MissingSubjectKeyException: Validation exception Includes comprehensive unit tests for serialization round-trips and MD5 hash consistency. * perf: optimize MD5 hex conversion with lookup table Replace Integer.toHexString() with a pre-computed hex character lookup table for byte-to-hex conversion. This avoids creating intermediate String objects for each byte, reducing allocations. Mirrors optimization from iOS SDK PR #91/#93. * perf: add md5HexPrefix for efficient partial hash Add md5HexPrefix() method that only converts the bytes needed for a given prefix length, avoiding unnecessary work when only a prefix is required (e.g., cache file naming uses first 8 chars). Includes unrolled loop for the common 4-byte (8 hex char) case to help compiler optimization, following iOS SDK PR #93 approach. * refactor: extract BaseCacheFile for reuse Extract common file caching functionality from ConfigCacheFile into a new BaseCacheFile base class. This enables reuse for the upcoming precomputed configuration cache without code duplication. - Add BaseCacheFile with common read/write/delete operations - Refactor ConfigCacheFile to extend BaseCacheFile - No functional changes to existing behavior * feat: add precomputed configuration storage Add the storage layer for precomputed flag configurations: - PrecomputedCacheFile: Disk cache file extending BaseCacheFile - PrecomputedConfigurationStore: In-memory + disk storage with async save/load operations and proper thread synchronization - Updates in-memory config even if disk write fails for resilience Also adds test data files to Makefile for integration testing. Includes unit tests for cache operations and failure scenarios. * style: apply spotless formatting * fix: address PR #239 feedback - Return null consistently in loadConfigFromCache for both file-not-found and read-error cases - Use static EMPTY singleton in PrecomputedConfigurationResponse.empty() - Use Collections.singletonMap() in getEnvironment() for memory efficiency * feat: add EppoPrecomputedClient Add the main precomputed client implementation with: - Server-side precomputed flag assignments with instant lookups - Support for all flag types: string, boolean, integer, numeric, JSON - Bandit action support with attribute decoding - Builder pattern with extensive configuration options - Offline mode with initial configuration support - Background polling with configurable interval and jitter - Assignment and bandit logging with deduplication caches - Graceful error handling mode The client fetches precomputed assignments from the edge endpoint, eliminating client-side flag evaluation overhead. Includes comprehensive instrumented tests covering: - All flag type assignments - Assignment logging and deduplication - Bandit actions - Offline mode - SDK test data integration * perf: use md5HexPrefix for cache file naming * fix: address PR review feedback for EppoPrecomputedClient - Make polling fields volatile for thread safety - Return user's default value on parse failure instead of hardcoded 0 - Extract magic string to NO_ACTION_CACHE_KEY constant - Fix banditActions serialization to match JS SDK wire format - Add comments for hash length and jitter calculation - Rename misleading test to testNonGracefulModeCanBeConfigured * feat: derive precomputed client base URL from SDK key Extract environment prefix from SDK key to automatically construct the correct edge endpoint URL (e.g., https://5qhpgd.fs-edge-assignment.eppo.cloud). This removes the need for users to manually configure the base URL. * chore: remove self-evident comments in UtilsTest Address PR review feedback by removing redundant inline comments that simply restated what the test assertions already conveyed.
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.
Description
AsyncTask(deprecated) withExecutors.newSingleThreadExecutor()BufferedWriteris closed