Skip to content

Commit

Permalink
Merge pull request #25 from growthbook/feature/changelog-3.9.6
Browse files Browse the repository at this point in the history
Fixed issue with fallback attribute ignoring when needed
  • Loading branch information
vazarkevych authored Oct 3, 2024
2 parents 44ba844 + fb9b980 commit a4cd7a7
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 3.9.6
- Fixed issue with fallback attribute ignoring when needed.

# 3.9.5
- Add subscription logic
- Fix issue with null handling
Expand Down
4 changes: 2 additions & 2 deletions lib/src/Utils/gb_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ class GBUtils {
// Retrieve fallbackAttributeAndValue and fallbackKey
final fallbackAttributeAndValue = getHashAttribute(
context: context,
attr: null,
fallback: expFallBackAttribute,
attr: expFallBackAttribute,
fallback: null,
attributeOverrides: attributeOverrides,
);

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: growthbook_sdk_flutter
description: An open-source feature flagging and experimentation platform that makes it simple to alter features and execute A/B testing.
version: 3.9.5
version: 3.9.6
homepage: https://github.com/alippo-com/GrowthBook-SDK-Flutter
repository: https://github.com/growthbook/growthbook-flutter

Expand Down
66 changes: 66 additions & 0 deletions test/test_cases/test_case.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7715,6 +7715,72 @@ const String gbTestCases = r'''
}
}
],
[
"upgrades a sticky bucket doc from a fallbackAttribute to a hashAttribute",
{
"attributes": {
"id": "i123",
"anonymousId": "ses123",
"foo": "bar",
"country": "USA"
},
"features": {
"exp1": {
"defaultValue": "control",
"rules": [
{
"key": "feature-exp",
"seed": "feature-exp",
"hashAttribute": "id",
"fallbackAttribute": "anonymousId",
"hashVersion": 2,
"bucketVersion": 0,
"condition": { "country": "USA" },
"variations": ["control", "red", "blue"],
"meta": [{ "key": "0" }, { "key": "1" }, { "key": "2" }],
"coverage": 1,
"weights": [0.3334, 0.3333, 0.3333],
"phase": "0"
}
]
}
}
},
[
{
"attributeName": "anonymousId",
"attributeValue": "ses123",
"assignments": {
"feature-exp__0": "1"
}
}
],
"exp1",
{
"bucket": 0.9943,
"featureId": "exp1",
"hashAttribute": "id",
"hashUsed": true,
"hashValue": "i123",
"inExperiment": true,
"key": "1",
"stickyBucketUsed": true,
"value": "red",
"variationId": 1
},
{
"anonymousId||ses123": {
"assignments": { "feature-exp__0": "1" },
"attributeName": "anonymousId",
"attributeValue": "ses123"
},
"id||i123": {
"assignments": { "feature-exp__0": "1" },
"attributeName": "id",
"attributeValue": "i123"
}
}
],
[
"favors a sticky bucket doc based on hashAttribute over fallbackAttribute",
{
Expand Down

0 comments on commit a4cd7a7

Please sign in to comment.