From 7f9b4c559e8f1b8267a818b3552dad4a07dafc74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20R=C4=B1za=20Kat?= Date: Thu, 26 Sep 2024 18:03:34 +0300 Subject: [PATCH] Updates --- CHANGELOG.md | 15 +++++++++++---- Countly.d.ts | 2 +- CountlyConfig.js | 2 +- Utils.js | 36 ++++++++++++++++++------------------ 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3f93183..5c697b90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,19 @@ ## 24.4.1 * Added support for Feedback Widget terms and conditions - -* Android: - * ! Minor breaking change ! Mitigated an issue where internal SDK limits did not apply +* Added six new configuration options under the 'sdkInternalLimits' interface of 'CountlyConfig': + * 'setMaxKeyLength' for limiting the maximum size of all user provided string keys + * 'setMaxValueSize' for limiting the size of all values in user provided segmentation key-value pairs + * 'setMaxSegmentationValues' for limiting the max amount of user provided segmentation key-value pair count in one event + * 'setMaxBreadcrumbCount' for limiting the max amount of breadcrumbs that can be recorded before the oldest one is deleted + * 'setMaxStackTraceLinesPerThread' for limiting the max amount of stack trace lines to be recorded per thread + * 'setMaxStackTraceLineLength' for limiting the max characters allowed per stack trace lines + +* Android Specific Changes: + * ! Minor breaking change ! Introduced SDK internal limits * Mitigated an issue where the session duration could have been calculated wrongly after a device ID change without merge * Mitigated an issue where a session could have continued after a device ID change without merge -* iOS: +* iOS Specific Changes: * Mitigated an issue where internal limits were not being applied to some values * Mitigated an issue where SDK limits could affect internal keys * Mitigated an issue that enabled recording reserved events diff --git a/Countly.d.ts b/Countly.d.ts index e09052ec..dd8d12c3 100644 --- a/Countly.d.ts +++ b/Countly.d.ts @@ -1187,7 +1187,7 @@ declare module "countly-sdk-react-native-bridge/CountlyConfig" { /** * getter for CountlySDKLimits instance that is used to access CountlyConfigSDKInternalLimits methods */ - limits: CountlyConfigSDKInternalLimits; + sdkInternalLimits: CountlyConfigSDKInternalLimits; /** * Method to set the server url diff --git a/CountlyConfig.js b/CountlyConfig.js index 1ebd368d..5ef6c516 100644 --- a/CountlyConfig.js +++ b/CountlyConfig.js @@ -29,7 +29,7 @@ class CountlyConfig { return this._countlyConfigApmInstance; } - get limits() { + get sdkInternalLimits() { return this._countlyConfigSDKLimitsInstance; } diff --git a/Utils.js b/Utils.js index e32bb3e1..37c7592a 100644 --- a/Utils.js +++ b/Utils.js @@ -135,46 +135,46 @@ function configToJson(config) { json.attributionValues = config.attributionValues; } // Limits ----------------------------------------------- - if (config.limits.maxKeyLength) { - if (config.limits.maxKeyLength < 1) { + if (config.sdkInternalLimits.maxKeyLength) { + if (config.sdkInternalLimits.maxKeyLength < 1) { L.w(`configToJson, Provided value for maxKeyLength is invalid!`) } else { - json.maxKeyLength = config.limits.maxKeyLength; + json.maxKeyLength = config.sdkInternalLimits.maxKeyLength; } } - if (config.limits.maxValueSize) { - if (config.limits.maxValueSize < 1) { + if (config.sdkInternalLimits.maxValueSize) { + if (config.sdkInternalLimits.maxValueSize < 1) { L.w(`configToJson, Provided value for maxValueSize is invalid!`) } else { - json.maxValueSize = config.limits.maxValueSize; + json.maxValueSize = config.sdkInternalLimits.maxValueSize; } } - if (config.limits.maxSegmentationValues) { - if (config.limits.maxSegmentationValues < 1) { + if (config.sdkInternalLimits.maxSegmentationValues) { + if (config.sdkInternalLimits.maxSegmentationValues < 1) { L.w(`configToJson, Provided value for maxSegmentationValues is invalid!`) } else { - json.maxSegmentationValues = config.limits.maxSegmentationValues; + json.maxSegmentationValues = config.sdkInternalLimits.maxSegmentationValues; } } - if (config.limits.maxBreadcrumbCount) { - if (config.limits.maxBreadcrumbCount < 1) { + if (config.sdkInternalLimits.maxBreadcrumbCount) { + if (config.sdkInternalLimits.maxBreadcrumbCount < 1) { L.w(`configToJson, Provided value for maxBreadcrumbCount is invalid!`) } else { - json.maxBreadcrumbCount = config.limits.maxBreadcrumbCount; + json.maxBreadcrumbCount = config.sdkInternalLimits.maxBreadcrumbCount; } } - if (config.limits.maxStackTraceLinesPerThread) { - if (config.limits.maxStackTraceLinesPerThread < 1) { + if (config.sdkInternalLimits.maxStackTraceLinesPerThread) { + if (config.sdkInternalLimits.maxStackTraceLinesPerThread < 1) { L.w(`configToJson, Provided value for maxStackTraceLinesPerThread is invalid!`) } else { - json.maxStackTraceLinesPerThread = config.limits.maxStackTraceLinesPerThread; + json.maxStackTraceLinesPerThread = config.sdkInternalLimits.maxStackTraceLinesPerThread; } } - if (config.limits.maxStackTraceLineLength) { - if (config.limits.maxStackTraceLineLength < 1) { + if (config.sdkInternalLimits.maxStackTraceLineLength) { + if (config.sdkInternalLimits.maxStackTraceLineLength < 1) { L.w(`configToJson, Provided value for maxStackTraceLineLength is invalid!`) } else { - json.maxStackTraceLineLength = config.limits.maxStackTraceLineLength; + json.maxStackTraceLineLength = config.sdkInternalLimits.maxStackTraceLineLength; } } // Limits End --------------------------------------------