@coralogix/react-native-plugin 0.19.0 → 0.19.1
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 +15 -0
- package/CxSdk.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/cxsdk/CxSdkModule.kt +6 -1
- package/android/src/test/kotlin/com/cxsdk/ReportErrorSourceBridgeTest.kt +35 -0
- package/index.cjs.js +43 -17
- package/index.esm.js +43 -17
- package/ios/CxSdk.swift +3 -1
- package/package.json +1 -1
- package/src/consts.d.ts +0 -1
- package/src/instrumentations/error/ErrorInstrumentation.d.ts +4 -3
- package/src/model/Types.d.ts +9 -2
- package/src/instrumentations/error/error.enums.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 0.19.1 (2026-11-19)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- `event_context.source` is now set only on errors, logs and network requests, and on an error it says how the error was caught (`captured` for `reportError`, `console` for `console.error`, `code` for uncaught errors, `crash` for fatal ones, `anr` for ANRs), so queries that filter errors on `source: console` may return fewer results.
|
|
6
|
+
|
|
7
|
+
### ⬆️ Dependency Updates
|
|
8
|
+
|
|
9
|
+
- Native iOS SDK bumped to **2.24.2** and native Android SDK to **2.28.1**.
|
|
10
|
+
|
|
1
11
|
## 0.19.0 (2026-11-17)
|
|
2
12
|
|
|
3
13
|
### 🚀 Features
|
|
@@ -5,6 +15,11 @@
|
|
|
5
15
|
- Sensitive URL parameters are now masked by default. In every reported URL, including network requests and the URLs inside error messages, the values of parameters such as `code`, `state`, `access_token`, `password` or `api_key`, JWTs and URL credentials are replaced with `[REDACTED]`. This changes the data you see for existing apps. Masking can't be turned off.
|
|
6
16
|
- New `urlMasking` option: `params` masks more parameter names, and `mode` (`'mask'`, `'maskAll'` or `'dropQuery'`) chooses how much of the query is masked.
|
|
7
17
|
|
|
18
|
+
### 🩹 Fixes
|
|
19
|
+
|
|
20
|
+
- When the app moves to the background, a life-cycle event is now sent with the session's error, view and action counts.
|
|
21
|
+
- On Android, fixed a crash from native memory growth in apps that use their own `Resources` implementation, such as an over-the-air translation library.
|
|
22
|
+
|
|
8
23
|
### ⬆️ Dependency Updates
|
|
9
24
|
|
|
10
25
|
- Native iOS SDK bumped to **2.24.1** and native Android SDK to **2.28.0**, which do the masking.
|
package/CxSdk.podspec
CHANGED
|
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
|
|
|
26
26
|
# stay on that version while SPM moves ahead of it.
|
|
27
27
|
#
|
|
28
28
|
# scripts/check-ios-sdk-pins.sh keeps the two versions consistent.
|
|
29
|
-
cx_ios_sdk_version = '2.24.
|
|
29
|
+
cx_ios_sdk_version = '2.24.2'
|
|
30
30
|
cx_ios_sdk_products = ['Coralogix', 'CoralogixInternal', 'SessionReplay']
|
|
31
31
|
cx_ios_sdk_frozen_file = File.join(__dir__, 'ios', 'COCOAPODS_FROZEN_SDK_VERSION')
|
|
32
32
|
cx_ios_sdk_pod_version =
|
package/android/build.gradle
CHANGED
|
@@ -91,7 +91,7 @@ dependencies {
|
|
|
91
91
|
// reportUserInteraction reads instead of reimplementing the SDK's mask rule here.
|
|
92
92
|
// 2.25.0 adds CoralogixRum.networkRequestSampling() and the traceparent echo fields on
|
|
93
93
|
// NetworkRequestDetails, which the JS traceparent flag depends on.
|
|
94
|
-
implementation "com.coralogix:android-sdk:2.28.
|
|
94
|
+
implementation "com.coralogix:android-sdk:2.28.1"
|
|
95
95
|
|
|
96
96
|
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
|
|
97
97
|
testImplementation "org.mockito:mockito-core:5.12.0"
|
|
@@ -232,7 +232,8 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
|
|
|
232
232
|
isCrash = isCrash,
|
|
233
233
|
customAttributes = customAttributes,
|
|
234
234
|
labels = eventLabels
|
|
235
|
-
)
|
|
235
|
+
),
|
|
236
|
+
toErrorSource(details)
|
|
236
237
|
)
|
|
237
238
|
}
|
|
238
239
|
|
|
@@ -1116,6 +1117,10 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
|
|
|
1116
1117
|
companion object {
|
|
1117
1118
|
const val NAME = "CxSdk"
|
|
1118
1119
|
|
|
1120
|
+
/** How JS caught the error; the native SDK falls back to `captured` when it is null. */
|
|
1121
|
+
internal fun toErrorSource(details: ReadableMap): String? =
|
|
1122
|
+
if (details.hasKey("source") && !details.isNull("source")) details.getString("source") else null
|
|
1123
|
+
|
|
1119
1124
|
// Matches the iOS bridge's rejection code for the same failure.
|
|
1120
1125
|
private const val MASK_VIEW_ERROR = "MASK_VIEW_ERROR"
|
|
1121
1126
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
package com.cxsdk
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableMap
|
|
4
|
+
import org.mockito.ArgumentMatchers.anyString
|
|
5
|
+
import org.mockito.Mockito.mock
|
|
6
|
+
import org.mockito.Mockito.`when`
|
|
7
|
+
import kotlin.test.Test
|
|
8
|
+
import kotlin.test.assertEquals
|
|
9
|
+
import kotlin.test.assertNull
|
|
10
|
+
|
|
11
|
+
class ReportErrorSourceBridgeTest {
|
|
12
|
+
|
|
13
|
+
/** A ReadableMap holding exactly [entries], as `ErrorInstrumentation` sends them. */
|
|
14
|
+
private fun readableMap(vararg entries: Pair<String, String?>): ReadableMap {
|
|
15
|
+
val values = entries.toMap()
|
|
16
|
+
val map = mock(ReadableMap::class.java)
|
|
17
|
+
`when`(map.hasKey(anyString())).thenAnswer { values.containsKey(it.arguments[0]) }
|
|
18
|
+
`when`(map.isNull(anyString())).thenAnswer { values[it.arguments[0]] == null }
|
|
19
|
+
`when`(map.getString(anyString())).thenAnswer { values[it.arguments[0]] }
|
|
20
|
+
return map
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Test
|
|
24
|
+
fun `each JS source reaches the native SDK unchanged`() {
|
|
25
|
+
for (source in listOf("captured", "console", "code", "crash")) {
|
|
26
|
+
assertEquals(source, CxSdkModule.toErrorSource(readableMap("source" to source)))
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Test
|
|
31
|
+
fun `a missing or null source leaves the native fallback in charge`() {
|
|
32
|
+
assertNull(CxSdkModule.toErrorSource(readableMap("error_message" to "boom")))
|
|
33
|
+
assertNull(CxSdkModule.toErrorSource(readableMap("source" to null)))
|
|
34
|
+
}
|
|
35
|
+
}
|
package/index.cjs.js
CHANGED
|
@@ -39,6 +39,15 @@ let CoralogixEventType = /*#__PURE__*/function (CoralogixEventType) {
|
|
|
39
39
|
CoralogixEventType["NAVIGATION"] = "navigation";
|
|
40
40
|
return CoralogixEventType;
|
|
41
41
|
}({});
|
|
42
|
+
let EventSource = /*#__PURE__*/function (EventSource) {
|
|
43
|
+
EventSource["CAPTURED"] = "captured";
|
|
44
|
+
EventSource["CONSOLE"] = "console";
|
|
45
|
+
EventSource["CODE"] = "code";
|
|
46
|
+
EventSource["CRASH"] = "crash";
|
|
47
|
+
EventSource["ANR"] = "anr";
|
|
48
|
+
EventSource["FETCH"] = "fetch";
|
|
49
|
+
return EventSource;
|
|
50
|
+
}({});
|
|
42
51
|
let CoralogixLogSeverity = /*#__PURE__*/function (CoralogixLogSeverity) {
|
|
43
52
|
CoralogixLogSeverity[CoralogixLogSeverity["Debug"] = 1] = "Debug";
|
|
44
53
|
CoralogixLogSeverity[CoralogixLogSeverity["Verbose"] = 2] = "Verbose";
|
|
@@ -81,6 +90,11 @@ const MESSAGE_LIMIT = 1024;
|
|
|
81
90
|
// The `console.error` handler installed by this module, so a repeated `enable()` can tell
|
|
82
91
|
// our own handler apart from anyone else's and leave it in place.
|
|
83
92
|
let installedConsoleError;
|
|
93
|
+
|
|
94
|
+
// True while the global handler hands an error to React Native's default handler, which logs
|
|
95
|
+
// it through `console.error` in release builds too. That echo is the error we just reported
|
|
96
|
+
// with its own source, so the `console.error` wrapper must not report it again as `console`.
|
|
97
|
+
let forwardingToDefaultHandler = false;
|
|
84
98
|
const getCircularReplacer = () => {
|
|
85
99
|
const seen = new WeakSet();
|
|
86
100
|
return (_key, value) => {
|
|
@@ -123,45 +137,48 @@ class CoralogixErrorInstrumentation extends instrumentation.InstrumentationBase
|
|
|
123
137
|
const previousConsoleError = typeof console.error === 'function' ? console.error : () => undefined;
|
|
124
138
|
const onConsoleError = (...params) => {
|
|
125
139
|
previousConsoleError.apply(console, params);
|
|
126
|
-
|
|
140
|
+
if (!forwardingToDefaultHandler) {
|
|
141
|
+
this.report(params, EventSource.CONSOLE);
|
|
142
|
+
}
|
|
127
143
|
};
|
|
128
144
|
installedConsoleError = onConsoleError;
|
|
129
145
|
console.error = onConsoleError;
|
|
130
146
|
}
|
|
131
|
-
report(arg,
|
|
147
|
+
report(arg, source) {
|
|
132
148
|
if (Array.isArray(arg)) {
|
|
133
149
|
if (arg.length === 0) {
|
|
134
150
|
return;
|
|
135
151
|
}
|
|
136
152
|
}
|
|
137
153
|
if (arg instanceof Error) {
|
|
138
|
-
this.reportError(arg,
|
|
154
|
+
this.reportError(arg, source);
|
|
139
155
|
} else if (typeof arg === 'string') {
|
|
140
|
-
this.reportString(arg,
|
|
156
|
+
this.reportString(arg, source);
|
|
141
157
|
} else if (Array.isArray(arg)) {
|
|
142
158
|
// if any arguments are Errors then add the stack trace even though the message is handled differently
|
|
143
159
|
const firstError = arg.find(x => x instanceof Error);
|
|
144
160
|
const message = arg.map(msg => typeof msg === 'string' ? msg : this.parseErrorObject(msg)).join(' ');
|
|
145
|
-
this.reportString(message,
|
|
161
|
+
this.reportString(message, source, firstError);
|
|
146
162
|
} else {
|
|
147
|
-
this.reportString(typeof arg === 'string' ? arg : this.getPossibleEventMessage(arg),
|
|
163
|
+
this.reportString(typeof arg === 'string' ? arg : this.getPossibleEventMessage(arg), source);
|
|
148
164
|
}
|
|
149
165
|
}
|
|
150
|
-
reportError(error,
|
|
151
|
-
const errorDetails = this.buildErrorDetails(error, error.message,
|
|
166
|
+
reportError(error, source) {
|
|
167
|
+
const errorDetails = this.buildErrorDetails(error, error.message, source);
|
|
152
168
|
CxSdk.reportError(errorDetails);
|
|
153
169
|
}
|
|
154
|
-
reportString(message,
|
|
170
|
+
reportString(message, source, firstError) {
|
|
155
171
|
const truncatedMessage = message == null ? void 0 : message.substring(0, MESSAGE_LIMIT);
|
|
156
|
-
const errorDetails = this.buildErrorDetails(firstError, truncatedMessage,
|
|
172
|
+
const errorDetails = this.buildErrorDetails(firstError, truncatedMessage, source);
|
|
157
173
|
CxSdk.reportError(errorDetails);
|
|
158
174
|
}
|
|
159
|
-
buildErrorDetails(error, errorMessage,
|
|
175
|
+
buildErrorDetails(error, errorMessage, source) {
|
|
160
176
|
return {
|
|
161
177
|
error_type: (error == null ? void 0 : error.name) || 'CONSOLE',
|
|
162
178
|
error_message: errorMessage || '',
|
|
163
179
|
stack_trace: error ? parseErrorStack(error) : [],
|
|
164
|
-
is_crash:
|
|
180
|
+
is_crash: source === EventSource.CRASH,
|
|
181
|
+
source
|
|
165
182
|
};
|
|
166
183
|
}
|
|
167
184
|
getPossibleEventMessage(event) {
|
|
@@ -182,18 +199,26 @@ class CoralogixErrorInstrumentation extends instrumentation.InstrumentationBase
|
|
|
182
199
|
enable() {
|
|
183
200
|
const defaultHandler = ErrorUtils.getGlobalHandler();
|
|
184
201
|
ErrorUtils.setGlobalHandler((error, isFatal) => {
|
|
185
|
-
this.report(error, isFatal);
|
|
202
|
+
this.report(error, isFatal ? EventSource.CRASH : EventSource.CODE);
|
|
186
203
|
if (!defaultHandler) {
|
|
187
204
|
return;
|
|
188
205
|
}
|
|
206
|
+
const forward = () => {
|
|
207
|
+
forwardingToDefaultHandler = true;
|
|
208
|
+
try {
|
|
209
|
+
defaultHandler(error, isFatal);
|
|
210
|
+
} finally {
|
|
211
|
+
forwardingToDefaultHandler = false;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
189
214
|
if (isFatal) {
|
|
190
215
|
// In release builds the default handler terminates the app (RCTFatal),
|
|
191
216
|
// killing any crash event still queued in the native batch processor —
|
|
192
217
|
// flush it out first. waitForFatalErrorFlush never rejects and is
|
|
193
218
|
// time-capped, so the handover is guaranteed.
|
|
194
|
-
waitForFatalErrorFlush().catch(() => undefined).finally(
|
|
219
|
+
waitForFatalErrorFlush().catch(() => undefined).finally(forward);
|
|
195
220
|
} else {
|
|
196
|
-
|
|
221
|
+
forward();
|
|
197
222
|
}
|
|
198
223
|
});
|
|
199
224
|
this.listenToConsoleError();
|
|
@@ -1104,7 +1129,7 @@ function stopJsRefreshRateSampler() {
|
|
|
1104
1129
|
appStateSub = null;
|
|
1105
1130
|
}
|
|
1106
1131
|
|
|
1107
|
-
var version = "0.19.
|
|
1132
|
+
var version = "0.19.1";
|
|
1108
1133
|
var pkg = {
|
|
1109
1134
|
version: version};
|
|
1110
1135
|
|
|
@@ -2353,7 +2378,8 @@ const CoralogixRum = {
|
|
|
2353
2378
|
error_type: error.name,
|
|
2354
2379
|
error_message: error.message,
|
|
2355
2380
|
stack_trace: parseErrorStack(error),
|
|
2356
|
-
is_crash: isCrash
|
|
2381
|
+
is_crash: isCrash,
|
|
2382
|
+
source: EventSource.CAPTURED
|
|
2357
2383
|
};
|
|
2358
2384
|
if (data && Object.keys(data).length > 0) {
|
|
2359
2385
|
errorDetails.data = data;
|
package/index.esm.js
CHANGED
|
@@ -37,6 +37,15 @@ let CoralogixEventType = /*#__PURE__*/function (CoralogixEventType) {
|
|
|
37
37
|
CoralogixEventType["NAVIGATION"] = "navigation";
|
|
38
38
|
return CoralogixEventType;
|
|
39
39
|
}({});
|
|
40
|
+
let EventSource = /*#__PURE__*/function (EventSource) {
|
|
41
|
+
EventSource["CAPTURED"] = "captured";
|
|
42
|
+
EventSource["CONSOLE"] = "console";
|
|
43
|
+
EventSource["CODE"] = "code";
|
|
44
|
+
EventSource["CRASH"] = "crash";
|
|
45
|
+
EventSource["ANR"] = "anr";
|
|
46
|
+
EventSource["FETCH"] = "fetch";
|
|
47
|
+
return EventSource;
|
|
48
|
+
}({});
|
|
40
49
|
let CoralogixLogSeverity = /*#__PURE__*/function (CoralogixLogSeverity) {
|
|
41
50
|
CoralogixLogSeverity[CoralogixLogSeverity["Debug"] = 1] = "Debug";
|
|
42
51
|
CoralogixLogSeverity[CoralogixLogSeverity["Verbose"] = 2] = "Verbose";
|
|
@@ -79,6 +88,11 @@ const MESSAGE_LIMIT = 1024;
|
|
|
79
88
|
// The `console.error` handler installed by this module, so a repeated `enable()` can tell
|
|
80
89
|
// our own handler apart from anyone else's and leave it in place.
|
|
81
90
|
let installedConsoleError;
|
|
91
|
+
|
|
92
|
+
// True while the global handler hands an error to React Native's default handler, which logs
|
|
93
|
+
// it through `console.error` in release builds too. That echo is the error we just reported
|
|
94
|
+
// with its own source, so the `console.error` wrapper must not report it again as `console`.
|
|
95
|
+
let forwardingToDefaultHandler = false;
|
|
82
96
|
const getCircularReplacer = () => {
|
|
83
97
|
const seen = new WeakSet();
|
|
84
98
|
return (_key, value) => {
|
|
@@ -121,45 +135,48 @@ class CoralogixErrorInstrumentation extends InstrumentationBase {
|
|
|
121
135
|
const previousConsoleError = typeof console.error === 'function' ? console.error : () => undefined;
|
|
122
136
|
const onConsoleError = (...params) => {
|
|
123
137
|
previousConsoleError.apply(console, params);
|
|
124
|
-
|
|
138
|
+
if (!forwardingToDefaultHandler) {
|
|
139
|
+
this.report(params, EventSource.CONSOLE);
|
|
140
|
+
}
|
|
125
141
|
};
|
|
126
142
|
installedConsoleError = onConsoleError;
|
|
127
143
|
console.error = onConsoleError;
|
|
128
144
|
}
|
|
129
|
-
report(arg,
|
|
145
|
+
report(arg, source) {
|
|
130
146
|
if (Array.isArray(arg)) {
|
|
131
147
|
if (arg.length === 0) {
|
|
132
148
|
return;
|
|
133
149
|
}
|
|
134
150
|
}
|
|
135
151
|
if (arg instanceof Error) {
|
|
136
|
-
this.reportError(arg,
|
|
152
|
+
this.reportError(arg, source);
|
|
137
153
|
} else if (typeof arg === 'string') {
|
|
138
|
-
this.reportString(arg,
|
|
154
|
+
this.reportString(arg, source);
|
|
139
155
|
} else if (Array.isArray(arg)) {
|
|
140
156
|
// if any arguments are Errors then add the stack trace even though the message is handled differently
|
|
141
157
|
const firstError = arg.find(x => x instanceof Error);
|
|
142
158
|
const message = arg.map(msg => typeof msg === 'string' ? msg : this.parseErrorObject(msg)).join(' ');
|
|
143
|
-
this.reportString(message,
|
|
159
|
+
this.reportString(message, source, firstError);
|
|
144
160
|
} else {
|
|
145
|
-
this.reportString(typeof arg === 'string' ? arg : this.getPossibleEventMessage(arg),
|
|
161
|
+
this.reportString(typeof arg === 'string' ? arg : this.getPossibleEventMessage(arg), source);
|
|
146
162
|
}
|
|
147
163
|
}
|
|
148
|
-
reportError(error,
|
|
149
|
-
const errorDetails = this.buildErrorDetails(error, error.message,
|
|
164
|
+
reportError(error, source) {
|
|
165
|
+
const errorDetails = this.buildErrorDetails(error, error.message, source);
|
|
150
166
|
CxSdk.reportError(errorDetails);
|
|
151
167
|
}
|
|
152
|
-
reportString(message,
|
|
168
|
+
reportString(message, source, firstError) {
|
|
153
169
|
const truncatedMessage = message == null ? void 0 : message.substring(0, MESSAGE_LIMIT);
|
|
154
|
-
const errorDetails = this.buildErrorDetails(firstError, truncatedMessage,
|
|
170
|
+
const errorDetails = this.buildErrorDetails(firstError, truncatedMessage, source);
|
|
155
171
|
CxSdk.reportError(errorDetails);
|
|
156
172
|
}
|
|
157
|
-
buildErrorDetails(error, errorMessage,
|
|
173
|
+
buildErrorDetails(error, errorMessage, source) {
|
|
158
174
|
return {
|
|
159
175
|
error_type: (error == null ? void 0 : error.name) || 'CONSOLE',
|
|
160
176
|
error_message: errorMessage || '',
|
|
161
177
|
stack_trace: error ? parseErrorStack(error) : [],
|
|
162
|
-
is_crash:
|
|
178
|
+
is_crash: source === EventSource.CRASH,
|
|
179
|
+
source
|
|
163
180
|
};
|
|
164
181
|
}
|
|
165
182
|
getPossibleEventMessage(event) {
|
|
@@ -180,18 +197,26 @@ class CoralogixErrorInstrumentation extends InstrumentationBase {
|
|
|
180
197
|
enable() {
|
|
181
198
|
const defaultHandler = ErrorUtils.getGlobalHandler();
|
|
182
199
|
ErrorUtils.setGlobalHandler((error, isFatal) => {
|
|
183
|
-
this.report(error, isFatal);
|
|
200
|
+
this.report(error, isFatal ? EventSource.CRASH : EventSource.CODE);
|
|
184
201
|
if (!defaultHandler) {
|
|
185
202
|
return;
|
|
186
203
|
}
|
|
204
|
+
const forward = () => {
|
|
205
|
+
forwardingToDefaultHandler = true;
|
|
206
|
+
try {
|
|
207
|
+
defaultHandler(error, isFatal);
|
|
208
|
+
} finally {
|
|
209
|
+
forwardingToDefaultHandler = false;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
187
212
|
if (isFatal) {
|
|
188
213
|
// In release builds the default handler terminates the app (RCTFatal),
|
|
189
214
|
// killing any crash event still queued in the native batch processor —
|
|
190
215
|
// flush it out first. waitForFatalErrorFlush never rejects and is
|
|
191
216
|
// time-capped, so the handover is guaranteed.
|
|
192
|
-
waitForFatalErrorFlush().catch(() => undefined).finally(
|
|
217
|
+
waitForFatalErrorFlush().catch(() => undefined).finally(forward);
|
|
193
218
|
} else {
|
|
194
|
-
|
|
219
|
+
forward();
|
|
195
220
|
}
|
|
196
221
|
});
|
|
197
222
|
this.listenToConsoleError();
|
|
@@ -1102,7 +1127,7 @@ function stopJsRefreshRateSampler() {
|
|
|
1102
1127
|
appStateSub = null;
|
|
1103
1128
|
}
|
|
1104
1129
|
|
|
1105
|
-
var version = "0.19.
|
|
1130
|
+
var version = "0.19.1";
|
|
1106
1131
|
var pkg = {
|
|
1107
1132
|
version: version};
|
|
1108
1133
|
|
|
@@ -2351,7 +2376,8 @@ const CoralogixRum = {
|
|
|
2351
2376
|
error_type: error.name,
|
|
2352
2377
|
error_message: error.message,
|
|
2353
2378
|
stack_trace: parseErrorStack(error),
|
|
2354
|
-
is_crash: isCrash
|
|
2379
|
+
is_crash: isCrash,
|
|
2380
|
+
source: EventSource.CAPTURED
|
|
2355
2381
|
};
|
|
2356
2382
|
if (data && Object.keys(data).length > 0) {
|
|
2357
2383
|
errorDetails.data = data;
|
package/ios/CxSdk.swift
CHANGED
|
@@ -378,7 +378,9 @@ class CxSdk: RCTEventEmitter {
|
|
|
378
378
|
errorType: errorType,
|
|
379
379
|
isCrash: isCrash,
|
|
380
380
|
customAttributes: customAttributes,
|
|
381
|
-
labels: labels
|
|
381
|
+
labels: labels,
|
|
382
|
+
// How JS caught the error; the native SDK falls back to `captured` when nil.
|
|
383
|
+
source: dictionary[Keys.source.rawValue] as? String)
|
|
382
384
|
resolve("reportError success")
|
|
383
385
|
}
|
|
384
386
|
|
package/package.json
CHANGED
package/src/consts.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { EventSource } from '../../model/Types';
|
|
2
3
|
export declare const getCircularReplacer: () => ((key: any, value: any) => undefined | any);
|
|
3
4
|
export interface CoralogixErrorInstrumentationConfig extends InstrumentationConfig {
|
|
4
5
|
ignoreErrors?: Array<string | RegExp>;
|
|
@@ -7,10 +8,10 @@ export declare class CoralogixErrorInstrumentation extends InstrumentationBase {
|
|
|
7
8
|
constructor(config: CoralogixErrorInstrumentationConfig);
|
|
8
9
|
init(): void;
|
|
9
10
|
private listenToConsoleError;
|
|
10
|
-
protected report(arg: string | Error | Event | Array<any>,
|
|
11
|
+
protected report(arg: string | Error | Event | Array<any>, source: EventSource): void;
|
|
11
12
|
parseErrorObject: (obj: any) => string;
|
|
12
|
-
protected reportError(error: Error,
|
|
13
|
-
protected reportString(message: string,
|
|
13
|
+
protected reportError(error: Error, source: EventSource): void;
|
|
14
|
+
protected reportString(message: string, source: EventSource, firstError?: Error): void;
|
|
14
15
|
private buildErrorDetails;
|
|
15
16
|
protected getPossibleEventMessage(event: any): string;
|
|
16
17
|
enable(): void;
|
package/src/model/Types.d.ts
CHANGED
|
@@ -78,10 +78,12 @@ export declare enum CoralogixEventType {
|
|
|
78
78
|
NAVIGATION = "navigation"
|
|
79
79
|
}
|
|
80
80
|
export declare enum EventSource {
|
|
81
|
+
CAPTURED = "captured",
|
|
81
82
|
CONSOLE = "console",
|
|
82
|
-
FETCH = "fetch",
|
|
83
83
|
CODE = "code",
|
|
84
|
-
|
|
84
|
+
CRASH = "crash",
|
|
85
|
+
ANR = "anr",
|
|
86
|
+
FETCH = "fetch"
|
|
85
87
|
}
|
|
86
88
|
export declare enum CoralogixLogSeverity {
|
|
87
89
|
Debug = 1,
|
|
@@ -93,6 +95,11 @@ export declare enum CoralogixLogSeverity {
|
|
|
93
95
|
}
|
|
94
96
|
export interface EventContext {
|
|
95
97
|
type: CoralogixEventType;
|
|
98
|
+
/**
|
|
99
|
+
* Set only on `error`, `log` and `network-request` events; absent on every
|
|
100
|
+
* other type. Typed as required to match the browser SDK and keep existing
|
|
101
|
+
* `beforeSend` code compiling, so check it before use.
|
|
102
|
+
*/
|
|
96
103
|
source: EventSource;
|
|
97
104
|
severity: CoralogixLogSeverity;
|
|
98
105
|
}
|