diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f3a0f9..3430a1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ +# 4.0.3 - 20/11/2025 + +### Fix + +- Converts all persona values to strings in segment tracking. + + # 4.0.2 - 24/06/2025 ### Fix -Add information in visitor context: fs_users , fs_client , fs_version. +- Add information in visitor context: fs_users , fs_client , fs_version. # 4.0.1 - 18/04/2025 diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 3a02907..d951fac 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 7c56964..1dc6cf7 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 12.0 + 13.0 diff --git a/example/ios/Flutter/ephemeral/flutter_lldb_helper.py b/example/ios/Flutter/ephemeral/flutter_lldb_helper.py new file mode 100644 index 0000000..a88caf9 --- /dev/null +++ b/example/ios/Flutter/ephemeral/flutter_lldb_helper.py @@ -0,0 +1,32 @@ +# +# Generated file, do not edit. +# + +import lldb + +def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): + """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" + base = frame.register["x0"].GetValueAsAddress() + page_len = frame.register["x1"].GetValueAsUnsigned() + + # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the + # first page to see if handled it correctly. This makes diagnosing + # misconfiguration (e.g. missing breakpoint) easier. + data = bytearray(page_len) + data[0:8] = b'IHELPED!' + + error = lldb.SBError() + frame.GetThread().GetProcess().WriteMemory(base, data, error) + if not error.Success(): + print(f'Failed to write into {base}[+{page_len}]', error) + return + +def __lldb_init_module(debugger: lldb.SBDebugger, _): + target = debugger.GetDummyTarget() + # Caveat: must use BreakpointCreateByRegEx here and not + # BreakpointCreateByName. For some reasons callback function does not + # get carried over from dummy target for the later. + bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") + bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) + bp.SetAutoContinue(True) + print("-- LLDB integration loaded --") diff --git a/example/ios/Flutter/ephemeral/flutter_lldbinit b/example/ios/Flutter/ephemeral/flutter_lldbinit new file mode 100644 index 0000000..e3ba6fb --- /dev/null +++ b/example/ios/Flutter/ephemeral/flutter_lldbinit @@ -0,0 +1,5 @@ +# +# Generated file, do not edit. +# + +command script import --relative-to-command-file flutter_lldb_helper.py diff --git a/example/ios/Podfile b/example/ios/Podfile index eb8b0f9..728c145 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project - platform :ios, '12.0' + platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 9442052..cb623e0 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -33,11 +33,11 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 -PODFILE CHECKSUM: ce13d36744da294d67f8e460dbb7aed7c09bd7f4 +PODFILE CHECKSUM: 30517025a2fecca2d72dac25f08abb5b9a8f1a56 COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 48bb75e..8a8ff19 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -342,7 +342,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -423,7 +423,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -472,7 +472,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e67b280..fc5ae03 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> @@ -45,11 +46,13 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/example/lib/Providers/fs_data.dart b/example/lib/Providers/fs_data.dart index d73a97e..be76e49 100644 --- a/example/lib/Providers/fs_data.dart +++ b/example/lib/Providers/fs_data.dart @@ -68,7 +68,12 @@ class UserData extends ChangeNotifier { "testing_tracking_manager": true, "isQA": true, "fs_is_vip": true, - "customer": "spécial" + "customer": "spécial", + "condition1": "segment", + "bucketKeyFlutter": "Mercredi", + "numericKeyFlutter": true, + "floatKeyFlutter": 12.5, + "nullKeyFlutter": Null }; bool _hasConsented = true; bool _isAuthenticated = false; diff --git a/lib/hits/segment.dart b/lib/hits/segment.dart index 36d42ab..302cc54 100644 --- a/lib/hits/segment.dart +++ b/lib/hits/segment.dart @@ -10,8 +10,11 @@ class Segment extends BaseHit { @override Map get bodyTrack { var customBody = new Map(); - customBody.addAll({"s": persona, "t": typeOfEvent}); - // Add commun body + // Convert persona values to String + Map personaString = + persona.map((key, value) => MapEntry(key, value.toString())); + customBody.addAll({"s": personaString, "t": typeOfEvent}); + // Add common body customBody.addAll(super.communBodyTrack); return customBody; } diff --git a/lib/visitor/strategy/default_strategy.dart b/lib/visitor/strategy/default_strategy.dart index 5c61204..a154478 100644 --- a/lib/visitor/strategy/default_strategy.dart +++ b/lib/visitor/strategy/default_strategy.dart @@ -44,16 +44,22 @@ class DefaultStrategy implements IVisitor { String? exposedVisitor; if (Flagship.sharedInstance().getConfiguration()?.onVisitorExposed != null) { - exposedFlag = jsonEncode(ExposedFlag( - pModification.key, - pModification.value, - pModification.defaultValue, - FlagMetadata.withMap(pModification.toJsonInformation())) - .toJson()); + try { + exposedFlag = jsonEncode(ExposedFlag( + pModification.key, + pModification.value, + pModification.defaultValue, + FlagMetadata.withMap(pModification.toJsonInformation())) + .toJson()); - exposedVisitor = jsonEncode(VisitorExposed( - visitor.visitorId, visitor.anonymousId, visitor.getContext()) - .toJson()); + exposedVisitor = jsonEncode(VisitorExposed( + visitor.visitorId, visitor.anonymousId, visitor.getContext()) + .toJson()); + } catch (e) { + Flagship.logger(Level.ERROR, "Failed to encode exposure object: $e"); + exposedFlag = null; + exposedVisitor = null; + } } // Build the activate hit Activate activateHit = Activate( diff --git a/pubspec.yaml b/pubspec.yaml index e117d62..0281e99 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flagship description: Flutter SDK for Flagship Feature management & Experiment platform for modern engineering and product teams -version: 4.0.2 +version: 4.0.3 homepage: https://flagship.io environment: