@coralogix/react-native-plugin 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/CxSdk.podspec +3 -3
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/cxsdk/CxSdkModule.kt +8 -1
- package/index.cjs.js +5 -2
- package/index.esm.js +5 -2
- package/ios/CxSdk.swift +5 -1
- package/package.json +1 -1
- package/src/index.d.ts +1 -1
- package/src/model/CoralogixOtelWebType.d.ts +1 -1
package/CHANGELOG.md
CHANGED
package/CxSdk.podspec
CHANGED
|
@@ -16,9 +16,9 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
|
-
s.dependency 'Coralogix','2.
|
|
20
|
-
s.dependency 'CoralogixInternal','2.
|
|
21
|
-
s.dependency 'SessionReplay','2.
|
|
19
|
+
s.dependency 'Coralogix','2.7.0'
|
|
20
|
+
s.dependency 'CoralogixInternal','2.7.0'
|
|
21
|
+
s.dependency 'SessionReplay','2.7.0'
|
|
22
22
|
|
|
23
23
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
24
24
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
package/android/build.gradle
CHANGED
|
@@ -84,7 +84,7 @@ dependencies {
|
|
|
84
84
|
implementation "com.facebook.react:react-android"
|
|
85
85
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
86
86
|
|
|
87
|
-
implementation "com.coralogix:android-sdk:2.
|
|
87
|
+
implementation "com.coralogix:android-sdk:2.13.0"
|
|
88
88
|
|
|
89
89
|
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
|
|
90
90
|
testImplementation "org.mockito:mockito-core:5.12.0"
|
|
@@ -175,12 +175,19 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
|
|
|
175
175
|
}
|
|
176
176
|
}.orEmpty()
|
|
177
177
|
|
|
178
|
+
val customAttributes: Map<String, Any>? = details.getMap("data")
|
|
179
|
+
?.toStringAnyMap()
|
|
180
|
+
?.filterValues { it != null }
|
|
181
|
+
?.mapValues { it.value as Any }
|
|
182
|
+
?.takeIf { it.isNotEmpty() }
|
|
183
|
+
|
|
178
184
|
CoralogixRum.reportError(
|
|
179
185
|
CoralogixErrorDecorator(
|
|
180
186
|
errorType = errorType,
|
|
181
187
|
errorMessage = message,
|
|
182
188
|
errorStack = CoralogixStackTrace(parsedStackFrames),
|
|
183
|
-
isCrash = isCrash
|
|
189
|
+
isCrash = isCrash,
|
|
190
|
+
customAttributes = customAttributes
|
|
184
191
|
)
|
|
185
192
|
)
|
|
186
193
|
}
|
package/index.cjs.js
CHANGED
|
@@ -537,7 +537,7 @@ function stopJsRefreshRateSampler() {
|
|
|
537
537
|
appStateSub = null;
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
-
var version = "0.
|
|
540
|
+
var version = "0.6.0";
|
|
541
541
|
var pkg = {
|
|
542
542
|
version: version};
|
|
543
543
|
|
|
@@ -1187,7 +1187,7 @@ const CoralogixRum = {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
CxSdk.endTimeMeasure(name);
|
|
1189
1189
|
},
|
|
1190
|
-
reportError: (error, isCrash) => {
|
|
1190
|
+
reportError: (error, isCrash, data) => {
|
|
1191
1191
|
if (!isInited) {
|
|
1192
1192
|
logger.debug('CoralogixRum must be initiated before error reporting');
|
|
1193
1193
|
return;
|
|
@@ -1198,6 +1198,9 @@ const CoralogixRum = {
|
|
|
1198
1198
|
stack_trace: parseErrorStack(error),
|
|
1199
1199
|
is_crash: isCrash
|
|
1200
1200
|
};
|
|
1201
|
+
if (data && Object.keys(data).length > 0) {
|
|
1202
|
+
errorDetails.data = data;
|
|
1203
|
+
}
|
|
1201
1204
|
CxSdk.reportError(errorDetails);
|
|
1202
1205
|
}
|
|
1203
1206
|
};
|
package/index.esm.js
CHANGED
|
@@ -535,7 +535,7 @@ function stopJsRefreshRateSampler() {
|
|
|
535
535
|
appStateSub = null;
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
var version = "0.
|
|
538
|
+
var version = "0.6.0";
|
|
539
539
|
var pkg = {
|
|
540
540
|
version: version};
|
|
541
541
|
|
|
@@ -1185,7 +1185,7 @@ const CoralogixRum = {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
CxSdk.endTimeMeasure(name);
|
|
1187
1187
|
},
|
|
1188
|
-
reportError: (error, isCrash) => {
|
|
1188
|
+
reportError: (error, isCrash, data) => {
|
|
1189
1189
|
if (!isInited) {
|
|
1190
1190
|
logger.debug('CoralogixRum must be initiated before error reporting');
|
|
1191
1191
|
return;
|
|
@@ -1196,6 +1196,9 @@ const CoralogixRum = {
|
|
|
1196
1196
|
stack_trace: parseErrorStack(error),
|
|
1197
1197
|
is_crash: isCrash
|
|
1198
1198
|
};
|
|
1199
|
+
if (data && Object.keys(data).length > 0) {
|
|
1200
|
+
errorDetails.data = data;
|
|
1201
|
+
}
|
|
1199
1202
|
CxSdk.reportError(errorDetails);
|
|
1200
1203
|
}
|
|
1201
1204
|
};
|
package/ios/CxSdk.swift
CHANGED
|
@@ -226,11 +226,15 @@ class CxSdk: RCTEventEmitter {
|
|
|
226
226
|
let message = dictionary[Keys.errorMessage.rawValue] as? String ?? ""
|
|
227
227
|
let errorType = dictionary[Keys.errorType.rawValue] as? String ?? "5"
|
|
228
228
|
let isCrash = dictionary[Keys.isCrash.rawValue] as? Bool ?? false
|
|
229
|
+
// Pass `data` only when non-empty — an empty dict would surface
|
|
230
|
+
// `error_context.data = {}` on the emitted RUM event.
|
|
231
|
+
let customAttributes = (dictionary["data"] as? [String: Any]).flatMap { $0.isEmpty ? nil : $0 }
|
|
229
232
|
|
|
230
233
|
coralogixRum?.reportError(message: message,
|
|
231
234
|
stackTrace: stackTrace,
|
|
232
235
|
errorType: errorType,
|
|
233
|
-
isCrash: isCrash
|
|
236
|
+
isCrash: isCrash,
|
|
237
|
+
customAttributes: customAttributes)
|
|
234
238
|
resolve("reportError success")
|
|
235
239
|
}
|
|
236
240
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ interface CxSdkClient {
|
|
|
23
23
|
sendCustomMeasurement(measurement: CustomMeasurement): void;
|
|
24
24
|
startTimeMeasure(name: string, labels: Record<string, unknown>): void;
|
|
25
25
|
endTimeMeasure(name: string): void;
|
|
26
|
-
reportError(details: Record<string,
|
|
26
|
+
reportError(details: Record<string, unknown>): void;
|
|
27
27
|
reportNetworkRequest(details: NetworkRequestDetails): void;
|
|
28
28
|
shutdown(): Promise<boolean>;
|
|
29
29
|
sendCxSpanData(results: CxSpan[]): void;
|
|
@@ -54,7 +54,7 @@ export interface CoralogixOtelWebType extends SendLog {
|
|
|
54
54
|
* Unknown names are dropped silently by the native SDK.
|
|
55
55
|
*/
|
|
56
56
|
endTimeMeasure: (name: string) => void;
|
|
57
|
-
reportError: (error: Error, isCrash: boolean) => void;
|
|
57
|
+
reportError: (error: Error, isCrash: boolean, data?: Record<string, unknown>) => void;
|
|
58
58
|
/**
|
|
59
59
|
* Report a network request to the underlying Coralogix SDK
|
|
60
60
|
* @param details
|