@@ -17,19 +17,19 @@ const DeviceIdType = {
1717function 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 }
0 commit comments