-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add caching logic to Growthbook repositories #114
Merged
Merged
Conversation
This file contains 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
…hing-enable # Conflicts: # lib/src/main/java/growthbook/sdk/java/GBFeaturesRepository.java # lib/src/main/java/growthbook/sdk/java/NativeJavaGbFeatureRepository.java # lib/src/main/java/growthbook/sdk/java/multiusermode/GrowthBookClient.java # lib/src/test/java/growthbook/sdk/java/GBFeaturesRepositoryRefreshingTest.java # lib/src/test/java/growthbook/sdk/java/GBFeaturesRepositoryTest.java # lib/src/test/java/growthbook/sdk/java/multiusermode/GrowthBookClientTest.java
vazarkevych
added a commit
that referenced
this pull request
Feb 3, 2025
* SDK version was updated * LocalGbFeatureRepository (#101) * LocalGbFeatureRepository was added * Code cleanup * Error fix --------- Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> * IGBFeaturesRepository implementation based on java.net.HttpURLConnection (#100) Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> * Constants interface was removed * Docs were updated (#103) Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> * Changes from comment * Changes to enable Multi Context Support (#106) * changes for multi context sdk * remove debug statements * handle empty attributes for force * remove debug statements * fix javadoc comments * support attributes as a string * add GrowthBookMultiUser details * remove debug statements * add feature refresh callbacks * remove debug statements * fix incorrect example value in README.md * remove obsolete files * deprecate encKey * deprecate encKey * Use global context at instance level * LRU cache for tracking experiments * Changes from comment * reset stackContext for eval in old instance * rename GNMultiUser to GBClient * add unit tests * fix parent cond evaluation * changes for multi context sdk * remove debug statements * handle empty attributes for force * remove debug statements * fix javadoc comments * support attributes as a string * add GrowthBookMultiUser details * remove debug statements * add feature refresh callbacks * remove debug statements * fix incorrect example value in README.md * remove obsolete files * deprecate encKey * deprecate encKey * Use global context at instance level * LRU cache for tracking experiments * reset stackContext for eval in old instance * rename GNMultiUser to GBClient * add unit tests * fix parent cond evaluation --------- Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> * fix trackdata in evaluation process, add remote eval feature, fix tests add test for LocalGbFeatureRepository and NativeJavaGbFeatureRepository; add ability to pass requestBody for madhu variant of GBClient; fix test, add remote eval feature to new flow of initialize GB * fix logic of subscriptions; add subscriptions to GBClient; (#113) add experiment parameter to callback Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> * update guava dependency (#111) Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> * fix logic of subscriptions; add subscriptions to GBClient; add experiment parameter to callback * Manual forced feature (#108) * add ability to evaluate manual force feature * fix logic of subscriptions; add subscriptions to GBClient; add experiment parameter to callback * initialize dependencies through constructors in main classes, remove getter and setter for forcedFeatureValues in GBClient, fix test * add setter and getter for attributeOverrides, make assigned experiments final, fix initialising savedGroups and attributeOverrides through setter and constructors --------- Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> * remove FeatureEvalContext.java, remove from AssignedExperiment objects of experiment and result, replace them with key, inExperiment variable and variationId, fix fireSubscriptions function * replace map as request body with specific Payload class and configure this payload object with data from Options, fix logic of getting forceVariation and forceFeatureValues from global context and user context, fix test * make fetchFeatures and fetchForRemoteEval public to be able to refresh features, remove Payload field from GrowthBookClient, rename payload to RequestBodyForRemoteEval, add setters for global: attributes, forceFeatures, forceVariations, add refresh functions, fix test and reorganize code * add tests for remote eval * Improvements for Remote Evaluation (#109) * fix trackdata in evaluation process, add remote eval feature, fix tests add test for LocalGbFeatureRepository and NativeJavaGbFeatureRepository; add ability to pass requestBody for madhu variant of GBClient; fix test, add remote eval feature to new flow of initialize GB * fix logic of subscriptions; add subscriptions to GBClient; add experiment parameter to callback * remove FeatureEvalContext.java, remove from AssignedExperiment objects of experiment and result, replace them with key, inExperiment variable and variationId, fix fireSubscriptions function * replace map as request body with specific Payload class and configure this payload object with data from Options, fix logic of getting forceVariation and forceFeatureValues from global context and user context, fix test * make fetchFeatures and fetchForRemoteEval public to be able to refresh features, remove Payload field from GrowthBookClient, rename payload to RequestBodyForRemoteEval, add setters for global: attributes, forceFeatures, forceVariations, add refresh functions, fix test and reorganize code --------- Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> Co-authored-by: Volodymyr Nazarkevych <volodymyr.nazarkevych@kevychsoulutions.com> Co-authored-by: Volodymyr Nazarkevych <volodymyr.nazarkevych@kevychsoulutions.com> * pass requestBodyForRemoteEval to refreshForRemoteEval function, update README.md * fix Readme explanation for functions * fix import * Add caching logic to Growthbook repositories (#114) * Add caching logic to GBFeaturesRepository and NativeJavaGbFeatureRepository * Add test for CachingManager and add caching logic for GBFeaturesRepository * improve caching in NativeJavaGbFeatureRepository to reduce double fetching from cache * fix code * fix conflicts after merge release 0.9.92 to feature/caching enable branch --------- Co-authored-by: Volodymyr Nazarkevych <volodymyr.nazarkevych@kevychsoulutions.com> * fix tests * comment shouldHandleLargeContent test * comment shouldThrowExceptionWhenReadingFails test * Fix evaluating force property in rule when rule is JsonObject and defined as null (#112) * fix evaluating force property in rule when rule is JsonObject and defined as null * replace hasForceProperty logic with wrapper to distinguish if force field is present in response or not --------- Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> * Throw exception on HTTP errors (#115) * Throw exception on HTTP errors Adds a new FeatureFetchErrorCode called HTTP_RESPONSE_ERROR that is used on non-200 HTTP status codes and also logs the server response. One of the common instances this happens is when you use a wrong SDK key. They were previously mangled into FeatureFetchErrorCode.CONFIGURATION_ERROR with a very non-descriptive message of "No features found". * Fix conflicts after adding caching logic, update mergeMaps function, add a new constructor to GBFeaturesRepository, and refine onSuccess logic based on client feedback. --------- Co-authored-by: Volodymyr Nazarkevych <volodymyr.nazarkevych@kevychsoulutions.com> --------- Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com> Co-authored-by: Madhu Chavva <46016208+madhuchavva@users.noreply.github.com> Co-authored-by: Volodymyr Nazarkevych <mykyta.salohub@kevychsolutions.com> Co-authored-by: Volodymyr Nazarkevych <volodymyr.nazarkevych@kevychsoulutions.com> Co-authored-by: Martin Thurau <martin.thurau@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Add caching logic to Growthbook repositories to improve performance and enable the ability to retrieve feature JSON data from the cache.