From 498c18e391837df0cafd253f83dbe5b4d358993f Mon Sep 17 00:00:00 2001 From: ijunaid Date: Fri, 1 Nov 2024 21:25:07 +0500 Subject: [PATCH 1/3] Fixed visibility and previous name segmentation if no segmentation is provided --- Countly.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Countly.m b/Countly.m index 3b61f6e6..7cf1d60f 100644 --- a/Countly.m +++ b/Countly.m @@ -905,6 +905,8 @@ - (void)recordEvent:(NSString *)key segmentation:(NSDictionary *)segmentation co BOOL isReservedEvent = [self isReservedEvent:key]; NSMutableDictionary *filteredSegmentations = segmentation.cly_filterSupportedDataTypes; + if(filteredSegmentations == nil) + filteredSegmentations = NSMutableDictionary.new; // If the event is not reserved, assign the previous event ID and Name to the current event's PEID property, or an empty string if previousEventID is nil. Then, update previousEventID to the current event's ID. if (!isReservedEvent) @@ -941,7 +943,8 @@ - (NSDictionary*) processSegmentation:(NSMutableDictionary *) segmentation event if(CountlyCommon.sharedInstance.enableVisibiltyTracking) { segmentation[kCountlyVisibility] = @([self isAppInForeground]); } - return segmentation; + + return segmentation.count == 0 ? nil : segmentation; } - (BOOL)isAppInForeground { From dd5814cfa6d5d130b4d506e33e2eaeb484bd9758 Mon Sep 17 00:00:00 2001 From: ijunaid Date: Fri, 1 Nov 2024 21:40:18 +0500 Subject: [PATCH 2/3] Added changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b563c7b8..569c2042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## xx.xx.xx +* Mitigated an issue with experimental visibility tracking and previous name recording, ensuring they’re included when no segmentation is provided in event or view recording. + ## 24.7.5 * Mitigated an issue with content action json parsing due to json encoding * Mitigated an issue where pausing a view resulted in a '0' view duration. From 93a5dcd1ca38ec6dbdbe8dd00733b2791cf20f06 Mon Sep 17 00:00:00 2001 From: ijunaid Date: Fri, 1 Nov 2024 21:43:02 +0500 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 569c2042..7de7e5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## xx.xx.xx -* Mitigated an issue with experimental visibility tracking and previous name recording, ensuring they’re included when no segmentation is provided in event or view recording. +* Mitigated an issue with experimental visibility tracking and previous name recording, ensuring they’re included even when no segmentation is provided in event or view recording. ## 24.7.5 * Mitigated an issue with content action json parsing due to json encoding