-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* SDKKey validation updated to handle proxy and new key format * Comparators rework Removed:IS ONE OF, IS NOT ONE OF Changed: CONTAINS, DOES_NOT_CONTAIN Added: DATE_BEFORE, DATE_AFTER, HASHED_EQUALS, HASHED_NOT_EQUALS, HASHED_STARTS_WITH, HASHED_ENDS_WITH, HASHED_ARRAY_CONTAINS, HASHED_ARRAY_NOT_CONTAINS * Fix comparators names * Fix comparator names and add new comparator * v6 and models added * Implement evaluatePrerequisiteFlagCondition and added v6 tests * Fix comparator and other errors * Added segments impl and test * Rename ComparisonCondition to UserCondition * Added logs to new code * Evaluation logger * Evaluation logs and tests finished * Logs NumberFormat updated and DateUTC fixed * Remove TODOs * EvaluateLogger depends on LogLevel * v5 and v6 sdkKey updates * EvaluationLoggerTurnOffTest updated with LogLevel checks * Added attributeValueFrom user helper methods. (no date yet) * Format code * Fix matrix test v5vsV6. Add remoteJson to tests * Detekt fixes * Ktlint fixes * Add docs * Fix list truncation * Date double value format fix. Cannot convert to Long because it's not milliseconds * Fix JS test errors. Lint and detekt problems. * Added text comparators. Updated segments evaluation. Updated tests. * Unicode test and fixes added * Small fix and reduce logged info in tests * Evaluator warning fixes * Format * Fix failing JS tests * Remove println * Added tests and small fixes. CCUser handle Any values * JS number settingtype added to handle JS number conversion. * Fix JS Evaluation fails because of cache message * Update 1103 error message * Fix circular dependency missing remove. * Rename Comparator to USerComparator. Fix user attribute override. Set evaluateConditions default result to true. Fix variationIDTests json. Fix getKeyAndValue method to handle targetRule percentage options as well. * Fix getKeyAndValue targeting rule if. Add exception to evaluatePercentageOptions if sum is not 100%. * Move configSalt validation from deserialization. * update processHashedStartEndsWithCompare handle sliced String * Update trim and refactor process methods. * Accept NaN * Added extra segment and prerequisite tests * Error message fixes * SDK key validation LOCAL_ONLY fix * Code format * Fix httpEngine in test * klint fix * Added missing PrerequisiteFlag Override Test * Add trim test Fix user value version trim * Add trim test Fix user value version trim * Fix user toString use simple json. Fix comparatorsTests. * Fix Array and List convert to String to use json. * Add specialCharacter test * Refactor LogHelper * Platform based double format WIP * Set stringbuilder lineseparator as default * Lint fixes * Fixes after merge. Exclude native format test. * Change DataSource setting to config. Fix override test. Fix missing segment and configSalt mapping. * JS platform send agent and etag info in the request query params. * Remove expected NumberFormatter class. Now just the doubleToString method expected and implemented. * Fix date conversions * Fix log double format. Now only the native platform is different from the expected. * NSNumberFormatter added (not tested) * lint fix * fix imports * Added darwinTest module * Try to fix darwin number formatter * Type validation updated and some test added * lint fix * Try to fix formatter * Update NumberFormatter.kt * darwin test fix * darwin test fix * darwin test fix * Fix test after merge. Move EvaluateLogger to a new file. * Value type and setting type validation fixed. getAnyValue and getAnyValueDetails check allowed types. Missing hooks and error logging added. getAnyValue and getAnyValueDetails allow null defaultValue. Fix tests based on changes and add some type validation tests. * Fix tests * Fix darwin test * Update version to 3.0.0 * Fixes on model based on code review * Fixes based on code review * Fixes based on code review * Fix based on code review * Refactor getValue/getAnyValue and getValueDetails/getAnyValueDetails to have a consistent behavior with other SDKs (#27) * Hashed length trim added * Fixes based on review * Add analysis to PR checks * Detekt and lint fixes * SemVer fix. Lint fix * Added when fix * Add tests * klint fix * detekt fix * Add more test * Fix testGetValueDetailsValidTypes * Fix test error * Moved Utils method to internal object * Detekt fix * Lint fix * Rename Utils file to Constants and internal object Utils to Helpers * Added FlagValueSerializer tests * Update fetcher param test to check http/2 headers. * Added getKeyAndValue tests --------- Co-authored-by: Peter Csajtai <peter.csajtai@outlook.com> Co-authored-by: adams85 <31276480+adams85@users.noreply.github.com>
- Loading branch information
1 parent
3769a53
commit 136f7ae
Showing
113 changed files
with
36,370 additions
and
1,022 deletions.
There are no files selected for viewing
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
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
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
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.configcat | ||
|
||
import java.text.DecimalFormat | ||
import java.text.DecimalFormatSymbols | ||
import java.util.* | ||
import kotlin.math.abs | ||
|
||
internal actual fun doubleToString(doubleToString: Double): String { | ||
// Handle Double.NaN, Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY | ||
if (doubleToString.isNaN() || doubleToString.isInfinite()) { | ||
return doubleToString.toString() | ||
} | ||
|
||
// To get similar result between different SDKs the Double value format is modified. | ||
// Between 1e-6 and 1e21 we don't use scientific-notation. Over these limits scientific-notation used but the | ||
// ExponentSeparator replaced with "e" and "e+". | ||
// "." used as decimal separator in all cases. | ||
val abs = abs(doubleToString) | ||
val fmt = | ||
if (1e-6 <= abs && abs < 1e21) DecimalFormat("#.#################") else DecimalFormat("#.#################E0") | ||
val symbols = DecimalFormatSymbols.getInstance(Locale.UK) | ||
if (abs > 1) { | ||
symbols.exponentSeparator = "e+" | ||
} else { | ||
symbols.exponentSeparator = "e" | ||
} | ||
fmt.decimalFormatSymbols = symbols | ||
return fmt.format(doubleToString) | ||
} | ||
|
||
internal actual fun formatDoubleForLog(doubleToFormat: Double): String { | ||
val decimalFormat = DecimalFormat("0.#####") | ||
decimalFormat.decimalFormatSymbols = DecimalFormatSymbols.getInstance(Locale.UK) | ||
return decimalFormat.format(doubleToFormat) | ||
} |
10 changes: 10 additions & 0 deletions
10
src/androidMain/kotlin/com/configcat/fetch/HttpRequestBuilder.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.configcat.fetch | ||
|
||
import io.ktor.client.request.* | ||
|
||
internal actual fun httpRequestBuilder( | ||
configCatUserAgent: String, | ||
eTag: String | ||
): HttpRequestBuilder { | ||
return commonHttpRequestBuilder(configCatUserAgent, eTag) | ||
} |
7 changes: 7 additions & 0 deletions
7
src/androidMain/kotlin/com/configcat/override/SettingConverter.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.configcat.override | ||
|
||
import com.configcat.model.Setting | ||
|
||
internal actual fun convertToSetting(value: Any): Setting { | ||
return commonConvertToSetting(value) | ||
} |
Oops, something went wrong.