Skip to content

Commit 50f35b5

Browse files
authored
Merge pull request #393 from Countly/staging
Staging 24.4.1
2 parents a0f571c + 7f87055 commit 50f35b5

35 files changed

+649
-128
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## 24.4.1
2+
* Added support for Feedback Widget terms and conditions
3+
* Added six new configuration options under the 'sdkInternalLimits' interface of 'CountlyConfig':
4+
* 'setMaxKeyLength' for limiting the maximum size of all user provided string keys
5+
* 'setMaxValueSize' for limiting the size of all values in user provided segmentation key-value pairs
6+
* 'setMaxSegmentationValues' for limiting the max amount of user provided segmentation key-value pair count in one event
7+
* 'setMaxBreadcrumbCount' for limiting the max amount of breadcrumbs that can be recorded before the oldest one is deleted
8+
* 'setMaxStackTraceLinesPerThread' for limiting the max amount of stack trace lines to be recorded per thread
9+
* 'setMaxStackTraceLineLength' for limiting the max characters allowed per stack trace lines
10+
11+
* Android Specific Changes:
12+
* ! Minor breaking change ! Introduced SDK internal limits
13+
* Mitigated an issue where the session duration could have been calculated wrongly after a device ID change without merge
14+
* Mitigated an issue where a session could have continued after a device ID change without merge
15+
16+
* iOS Specific Changes:
17+
* Mitigated an issue where internal limits were not being applied to some values
18+
* Mitigated an issue where SDK limits could affect internal keys
19+
* Mitigated an issue that enabled recording reserved events
20+
* Mitigated an issue where timed events could have no ID
21+
* Mitigated an issue where the request queue could overflow while sending a request
22+
* Removed timestamps from crash breadcrumbs
23+
24+
* Updated the underlying Android SDK version to 24.4.1
25+
* Updated the underlying iOS SDK version to 24.4.1
26+
127
## 24.4.0
228
* ! Minor breaking change ! Tracking of foreground and background time for APM is disabled by default
329

Countly.d.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,44 @@ declare module "countly-sdk-react-native-bridge/CountlyConfig" {
11291129
setAppStartTimestampOverride(timestamp: number): CountlyConfigApm;
11301130
}
11311131

1132+
class CountlyConfigSDKInternalLimits {
1133+
/**
1134+
* Limits the maximum size of all string keys
1135+
* @param keyLengthLimit - maximum char size of all string keys (default 128 chars)
1136+
*/
1137+
setMaxKeyLength(keyLengthLimit: number) : CountlyConfigSDKInternalLimits;
1138+
1139+
/**
1140+
* Limits the size of all values in segmentation key-value pairs
1141+
* @param valueSizeLimit - the maximum char size of all values in our key-value pairs (default 256 chars)
1142+
*/
1143+
setMaxValueSize(valueSizeLimit: number) : CountlyConfigSDKInternalLimits;
1144+
1145+
/**
1146+
* Limits the max amount of custom segmentation in one event
1147+
* @param segmentationAmountLimit - the maximum amount of custom segmentation in one event (default 100 key-value pairs)
1148+
*/
1149+
setMaxSegmentationValues(segmentationAmountLimit: number) : CountlyConfigSDKInternalLimits;
1150+
1151+
/**
1152+
* Limits the max amount of breadcrumbs that can be recorded before the oldest one is deleted
1153+
* @param breadcrumbCountLimit - the maximum amount of breadcrumbs that can be recorded before the oldest one is deleted (default 100)
1154+
*/
1155+
setMaxBreadcrumbCount(breadcrumbCountLimit: number) : CountlyConfigSDKInternalLimits;
1156+
1157+
/**
1158+
* Limits the max amount of stack trace lines to be recorded per thread
1159+
* @param stackTraceLinesPerThreadLimit - maximum amount of stack trace lines to be recorded per thread (default 30)
1160+
*/
1161+
setMaxStackTraceLinesPerThread(stackTraceLinesPerThreadLimit: number) : CountlyConfigSDKInternalLimits;
1162+
1163+
/**
1164+
* Limits the max characters allowed per stack trace lines. Also limits the crash message length
1165+
* @param stackTraceLineLengthLimit - maximum length of each stack trace line (default 200)
1166+
*/
1167+
setMaxStackTraceLineLength(stackTraceLineLengthLimit: number) : CountlyConfigSDKInternalLimits;
1168+
}
1169+
11321170
/**
11331171
*
11341172
* Config object for Countly Init
@@ -1146,6 +1184,10 @@ declare module "countly-sdk-react-native-bridge/CountlyConfig" {
11461184
* getter for CountlyConfigApm instance that is used to access CountlyConfigApm methods
11471185
*/
11481186
apm: CountlyConfigApm;
1187+
/**
1188+
* getter for CountlySDKLimits instance that is used to access CountlyConfigSDKInternalLimits methods
1189+
*/
1190+
sdkInternalLimits: CountlyConfigSDKInternalLimits;
11491191

11501192
/**
11511193
* Method to set the server url

CountlyConfig.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { initialize } from "./Logger.js";
22
import CountlyConfigApm from "./lib/configuration_interfaces/countly_config_apm.js";
3+
import CountlyConfigSDKInternalLimits from "./lib/configuration_interfaces/countly_config_limits.js";
34
/**
45
* Countly SDK React Native Bridge
56
* https://github.com/Countly/countly-sdk-react-native-bridge
@@ -18,6 +19,7 @@ class CountlyConfig {
1819
this.serverURL = serverURL;
1920
this.appKey = appKey;
2021
this._countlyConfigApmInstance = new CountlyConfigApm();
22+
this._countlyConfigSDKLimitsInstance = new CountlyConfigSDKInternalLimits();
2123
}
2224

2325
/**
@@ -27,6 +29,10 @@ class CountlyConfig {
2729
return this._countlyConfigApmInstance;
2830
}
2931

32+
get sdkInternalLimits() {
33+
return this._countlyConfigSDKLimitsInstance;
34+
}
35+
3036
/**
3137
* Method to set the server url
3238
*

CountlyReactNative.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'CountlyReactNative'
3-
s.version = '24.4.0'
3+
s.version = '24.4.1'
44
s.license = {
55
:type => 'COMMUNITY',
66
:text => <<-LICENSE

Utils.js

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ const DeviceIdType = {
1717
function intToDeviceIDType(deviceIdType) {
1818
let result = null;
1919
switch (deviceIdType) {
20-
case 10101:
21-
result = DeviceIdType.SDK_GENERATED;
22-
break;
23-
case 20202:
24-
result = DeviceIdType.DEVELOPER_SUPPLIED;
25-
break;
26-
case 30303:
27-
result = DeviceIdType.TEMPORARY_ID;
28-
break;
29-
default:
30-
L.e("_getDeviceIdType, " + `unexpected deviceIdType [${deviceIdType}] from native side`);
31-
result = DeviceIdType.SDK_GENERATED;
32-
break;
20+
case 10101:
21+
result = DeviceIdType.SDK_GENERATED;
22+
break;
23+
case 20202:
24+
result = DeviceIdType.DEVELOPER_SUPPLIED;
25+
break;
26+
case 30303:
27+
result = DeviceIdType.TEMPORARY_ID;
28+
break;
29+
default:
30+
L.e("_getDeviceIdType, " + `unexpected deviceIdType [${deviceIdType}] from native side`);
31+
result = DeviceIdType.SDK_GENERATED;
32+
break;
3333
}
3434
L.d(`_getDeviceIdType, DeviceIDType: ${result}`);
3535
return result;
@@ -134,6 +134,50 @@ function configToJson(config) {
134134
if (config.attributionValues) {
135135
json.attributionValues = config.attributionValues;
136136
}
137+
// Limits -----------------------------------------------
138+
if (config.sdkInternalLimits.maxKeyLength) {
139+
if (config.sdkInternalLimits.maxKeyLength < 1) {
140+
L.w(`configToJson, Provided value for maxKeyLength is invalid!`)
141+
} else {
142+
json.maxKeyLength = config.sdkInternalLimits.maxKeyLength;
143+
}
144+
}
145+
if (config.sdkInternalLimits.maxValueSize) {
146+
if (config.sdkInternalLimits.maxValueSize < 1) {
147+
L.w(`configToJson, Provided value for maxValueSize is invalid!`)
148+
} else {
149+
json.maxValueSize = config.sdkInternalLimits.maxValueSize;
150+
}
151+
}
152+
if (config.sdkInternalLimits.maxSegmentationValues) {
153+
if (config.sdkInternalLimits.maxSegmentationValues < 1) {
154+
L.w(`configToJson, Provided value for maxSegmentationValues is invalid!`)
155+
} else {
156+
json.maxSegmentationValues = config.sdkInternalLimits.maxSegmentationValues;
157+
}
158+
}
159+
if (config.sdkInternalLimits.maxBreadcrumbCount) {
160+
if (config.sdkInternalLimits.maxBreadcrumbCount < 1) {
161+
L.w(`configToJson, Provided value for maxBreadcrumbCount is invalid!`)
162+
} else {
163+
json.maxBreadcrumbCount = config.sdkInternalLimits.maxBreadcrumbCount;
164+
}
165+
}
166+
if (config.sdkInternalLimits.maxStackTraceLinesPerThread) {
167+
if (config.sdkInternalLimits.maxStackTraceLinesPerThread < 1) {
168+
L.w(`configToJson, Provided value for maxStackTraceLinesPerThread is invalid!`)
169+
} else {
170+
json.maxStackTraceLinesPerThread = config.sdkInternalLimits.maxStackTraceLinesPerThread;
171+
}
172+
}
173+
if (config.sdkInternalLimits.maxStackTraceLineLength) {
174+
if (config.sdkInternalLimits.maxStackTraceLineLength < 1) {
175+
L.w(`configToJson, Provided value for maxStackTraceLineLength is invalid!`)
176+
} else {
177+
json.maxStackTraceLineLength = config.sdkInternalLimits.maxStackTraceLineLength;
178+
}
179+
}
180+
// Limits End --------------------------------------------
137181
} catch (err) {
138182
L.e(`configToJson, Exception occured during converting config to json.${err.toString()}`);
139183
}

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ repositories {
4141

4242
dependencies {
4343
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
44-
implementation 'ly.count.android:sdk:24.4.0'
44+
implementation 'ly.count.android:sdk:24.4.1'
4545

4646
// Import the BoM for the Firebase platform
4747
// The BoM version of 28.4.2 is the newest release that will target firebase-messaging version 22

android/src/main/java/ly/count/android/sdk/react/CountlyReactNative.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public String toString() {
8989
public class CountlyReactNative extends ReactContextBaseJavaModule implements LifecycleEventListener {
9090

9191
public static final String TAG = "CountlyRNPlugin";
92-
private String COUNTLY_RN_SDK_VERSION_STRING = "24.4.0";
92+
private String COUNTLY_RN_SDK_VERSION_STRING = "24.4.1";
9393
private String COUNTLY_RN_SDK_NAME = "js-rnb-android";
9494

9595
private static final CountlyConfig config = new CountlyConfig();
@@ -235,6 +235,26 @@ private void populateConfig(JSONObject _config) {
235235
config.setRecordAppStartTime(_config.getBoolean("enableApm"));
236236
}
237237
// APM END --------------------------------------------
238+
// Limits -----------------------------------------------
239+
if(_config.has("maxKeyLength")) {
240+
config.sdkInternalLimits.setMaxKeyLength(_config.getInt("maxKeyLength"));
241+
}
242+
if(_config.has("maxValueSize")) {
243+
config.sdkInternalLimits.setMaxValueSize(_config.getInt("maxValueSize"));
244+
}
245+
if(_config.has("maxSegmentationValues")) {
246+
config.sdkInternalLimits.setMaxSegmentationValues(_config.getInt("maxSegmentationValues"));
247+
}
248+
if(_config.has("maxBreadcrumbCount")) {
249+
config.sdkInternalLimits.setMaxBreadcrumbCount(_config.getInt("maxBreadcrumbCount"));
250+
}
251+
if(_config.has("maxStackTraceLinesPerThread")) {
252+
config.sdkInternalLimits.setMaxStackTraceLinesPerThread(_config.getInt("maxStackTraceLinesPerThread"));
253+
}
254+
if(_config.has("maxStackTraceLineLength")) {
255+
config.sdkInternalLimits.setMaxStackTraceLineLength(_config.getInt("maxStackTraceLineLength"));
256+
}
257+
// Limits End -------------------------------------------
238258
if (_config.has("crashReporting")) {
239259
config.enableCrashReporting();
240260
}

example/CountlyRNExample/Configuration.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,13 @@ const countlyConfig = new CountlyConfig(COUNTLY_SERVER_KEY, COUNTLY_APP_KEY).set
3030
// .enableManualAppLoadedTrigger()
3131
// .setAppStartTimestampOverride(11223344);
3232

33+
// Countly SDK Limits ========================================
34+
// countlyConfig.limits
35+
// .setMaxKeyLength()
36+
// .setMaxValueSize()
37+
// .setMaxSegmentationValues()
38+
// .setMaxBreadcrumbCount()
39+
// .setMaxStackTraceLineLength()
40+
// .setMaxStackTraceLinesPerThread();
41+
3342
export default countlyConfig;

ios/src/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 24.4.1
2+
* Added support for Feedback Widget terms and conditions
3+
4+
* Mitigated an issue where SDK limits could affect internal keys
5+
* Mitigated an issue that enabled recording reserved events
6+
* Mitigated an issue where timed events could have no ID
7+
* Mitigated an issue where internal limits were not being applied to some values
8+
* Mitigated an issue where the request queue could overflow while sending a request
9+
10+
* Removed timestamps from crash breadcrumbs
11+
112
## 24.4.0
213
* Added `attemptToSendStoredRequests` method to combine all events in event queue into a request and attempt to process stored requests
314
* Added the iOS privacy manifest to the Countly SDK

ios/src/Countly-PL.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Countly-PL'
3-
s.version = '24.4.0'
3+
s.version = '24.4.1'
44
s.license = { :type => 'MIT', :file => 'LICENSE' }
55
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
66
s.homepage = 'https://github.com/Countly/countly-sdk-ios'

0 commit comments

Comments
 (0)