Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

# 4.2.1-beta - 20/11/2025

- Converts all persona values to strings in segment tracking.

# 4.2.0-beta - 4/11/2025

Expand Down
6 changes: 5 additions & 1 deletion example/lib/Providers/fs_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ class UserData extends ChangeNotifier {
"testing_tracking_manager": true,
"isQA": true,
"fs_is_vip": true,
"condition1": "spécial"
"customer": "spécial",
"condition1": "segment",
"bucketKeyFlutter": "Mercredi",
"numericKeyFlutter": true,
"floatKeyFlutter": 12.5
};
bool _hasConsented = true;
bool _isAuthenticated = false;
Expand Down
2 changes: 1 addition & 1 deletion lib/flagship_version.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/// This file is automatically updated
const FlagshipVersion = "4.2.0-beta";
const FlagshipVersion = "4.2.1-beta";
7 changes: 5 additions & 2 deletions lib/hits/segment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ class Segment extends BaseHit {
@override
Map<String, Object> get bodyTrack {
var customBody = new Map<String, Object>();
customBody.addAll({"s": persona, "t": typeOfEvent});
// Add commun body
// Convert persona values to String
Map<String, String> personaString =
persona.map((key, value) => MapEntry(key, value.toString()));
customBody.addAll({"s": personaString, "t": typeOfEvent});
// Add common body
customBody.addAll(super.communBodyTrack);
return customBody;
}
Expand Down
13 changes: 8 additions & 5 deletions lib/visitor/strategy/default_strategy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ class DefaultStrategy implements IVisitor {
Flagship.logger(Level.INFO, " The campaign's flag already activated ");
return;
}

// When not duplicated
final String? flagJson =
exposedFlag != null ? jsonEncode(exposedFlag) : null;
final String? visitorJson =
exposedVisitor != null ? jsonEncode(exposedVisitor) : null;
String? flagJson;
String? visitorJson;
try {
flagJson = exposedFlag != null ? jsonEncode(exposedFlag) : null;
visitorJson = exposedVisitor != null ? jsonEncode(exposedVisitor) : null;
} catch (e) {
Flagship.logger(Level.ERROR, "Error encoding exposure data: $e");
}

final activateHit = Activate(
modification,
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: flagship
description: Flutter SDK for Flagship Feature management & Experiment platform for modern engineering and product teams
version: 4.2.0-beta
version: 4.2.1-beta
homepage: https://flagship.io

environment:
Expand Down