@luciq/react-native 19.1.0 → 19.2.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 +14 -0
- package/android/native.gradle +1 -1
- package/android/src/main/java/ai/luciq/reactlibrary/ArgsRegistry.java +1 -0
- package/dist/native/NativeConstants.d.ts +1 -0
- package/dist/utils/Enums.d.ts +2 -1
- package/dist/utils/Enums.js +1 -0
- package/dist/utils/XhrNetworkInterceptor.js +31 -11
- package/ios/RNLuciq/ArgsRegistry.m +2 -1
- package/ios/native.rb +1 -1
- package/package.json +1 -1
- package/src/native/NativeConstants.ts +1 -0
- package/src/utils/Enums.ts +1 -0
- package/src/utils/XhrNetworkInterceptor.ts +32 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [19.2.1](https://github.com/luciqai/luciq-reactnative-sdk/compare/v19.2.1...19.1.0)
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add support for handling aborted and canceled Axios network requests. ([#36](https://github.com/luciqai/luciq-reactnative-sdk/pull/36))
|
|
8
|
+
|
|
9
|
+
- Add new UserConsentActionType - noAutomaticBugGrouping. ([#20](https://github.com/luciqai/luciq-reactnative-sdk/pull/20))
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Bump Luciq iOS SDK to v19.4.0 ([#29](https://github.com/luciqai/luciq-reactnative-sdk/pull/29)). [See release notes](https://github.com/luciqai/Luciq-iOS-sdk/releases/tag/19.4.0).
|
|
14
|
+
|
|
15
|
+
- Bump Luciq Android SDK to v19.2.1 ([#29](https://github.com/luciqai/luciq-reactnative-sdk/pull/29)). [See release notes](https://github.com/luciqai/Luciq-Android-sdk/releases/tag/v19.2.1).
|
|
16
|
+
|
|
3
17
|
## [19.1.0](https://github.com/luciqai/luciq-reactnative-sdk/compare/v19.1.0...19.0.0)
|
|
4
18
|
|
|
5
19
|
### Added
|
package/android/native.gradle
CHANGED
|
@@ -153,6 +153,7 @@ final class ArgsRegistry {
|
|
|
153
153
|
put("dropAutoCapturedMedia", ai.luciq.bug.userConsent.ActionType.DROP_AUTO_CAPTURED_MEDIA);
|
|
154
154
|
put("dropLogs", ai.luciq.bug.userConsent.ActionType.DROP_LOGS);
|
|
155
155
|
put("noChat", ai.luciq.bug.userConsent.ActionType.NO_CHAT);
|
|
156
|
+
put("noAutomaticBugGrouping", ai.luciq.bug.userConsent.ActionType.NO_AUTOMATIC_BUG_GROUPING);
|
|
156
157
|
}};
|
|
157
158
|
|
|
158
159
|
static final ArgsMap<Integer> sdkLogLevels = new ArgsMap<Integer>() {{
|
package/dist/utils/Enums.d.ts
CHANGED
package/dist/utils/Enums.js
CHANGED
|
@@ -20,6 +20,7 @@ export var userConsentActionType;
|
|
|
20
20
|
userConsentActionType[userConsentActionType["dropAutoCapturedMedia"] = constants.dropAutoCapturedMedia] = "dropAutoCapturedMedia";
|
|
21
21
|
userConsentActionType[userConsentActionType["dropLogs"] = constants.dropLogs] = "dropLogs";
|
|
22
22
|
userConsentActionType[userConsentActionType["noChat"] = constants.noChat] = "noChat";
|
|
23
|
+
userConsentActionType[userConsentActionType["noAutomaticBugGrouping"] = constants.noAutomaticBugGrouping] = "noAutomaticBugGrouping";
|
|
23
24
|
})(userConsentActionType || (userConsentActionType = {}));
|
|
24
25
|
/**
|
|
25
26
|
* The event used to invoke the feedback form.
|
|
@@ -159,6 +159,8 @@ export default {
|
|
|
159
159
|
if (this._hasError) {
|
|
160
160
|
cloneNetwork.errorCode = clientErrorCode;
|
|
161
161
|
cloneNetwork.errorDomain = 'ClientError';
|
|
162
|
+
cloneNetwork.responseCode = 0;
|
|
163
|
+
cloneNetwork.contentType = 'text/plain';
|
|
162
164
|
// @ts-ignore
|
|
163
165
|
const _response = this._response;
|
|
164
166
|
cloneNetwork.requestBody =
|
|
@@ -168,25 +170,32 @@ export default {
|
|
|
168
170
|
if (typeof _response === 'string' && _response.length > 0) {
|
|
169
171
|
cloneNetwork.errorDomain = _response;
|
|
170
172
|
}
|
|
173
|
+
cloneNetwork.responseBody = `ERROR: ${cloneNetwork.errorDomain}`;
|
|
171
174
|
// @ts-ignore
|
|
172
175
|
}
|
|
173
176
|
else if (this._timedOut) {
|
|
174
177
|
cloneNetwork.errorCode = clientErrorCode;
|
|
175
|
-
cloneNetwork.errorDomain = '
|
|
178
|
+
cloneNetwork.errorDomain = 'timeout';
|
|
179
|
+
cloneNetwork.responseCode = 0;
|
|
180
|
+
cloneNetwork.contentType = 'text/plain';
|
|
181
|
+
cloneNetwork.responseBody = `ERROR: ${cloneNetwork.errorDomain}`;
|
|
176
182
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
183
|
+
// Only set response body if not already set by error handlers
|
|
184
|
+
if (!cloneNetwork.errorDomain) {
|
|
185
|
+
if (this.response) {
|
|
186
|
+
if (this.responseType === 'blob') {
|
|
187
|
+
const responseText = await new Response(this.response).text();
|
|
188
|
+
cloneNetwork.responseBody = responseText;
|
|
189
|
+
}
|
|
190
|
+
else if (['text', '', 'json'].includes(this.responseType)) {
|
|
191
|
+
cloneNetwork.responseBody = JSON.stringify(this.response);
|
|
192
|
+
}
|
|
181
193
|
}
|
|
182
|
-
else
|
|
183
|
-
cloneNetwork.responseBody =
|
|
194
|
+
else {
|
|
195
|
+
cloneNetwork.responseBody = '';
|
|
196
|
+
cloneNetwork.contentType = 'text/plain';
|
|
184
197
|
}
|
|
185
198
|
}
|
|
186
|
-
else {
|
|
187
|
-
cloneNetwork.responseBody = '';
|
|
188
|
-
cloneNetwork.contentType = 'text/plain';
|
|
189
|
-
}
|
|
190
199
|
cloneNetwork.requestBodySize = cloneNetwork.requestBody.length;
|
|
191
200
|
if (cloneNetwork.responseBodySize === 0 && cloneNetwork.responseBody) {
|
|
192
201
|
cloneNetwork.responseBodySize = cloneNetwork.responseBody.length;
|
|
@@ -234,6 +243,17 @@ export default {
|
|
|
234
243
|
};
|
|
235
244
|
this.addEventListener('progress', downloadUploadProgressCallback);
|
|
236
245
|
this.upload.addEventListener('progress', downloadUploadProgressCallback);
|
|
246
|
+
// Handler for abort events (works with fetch, Axios, and any XHR-based requests)
|
|
247
|
+
this.addEventListener('abort', () => {
|
|
248
|
+
if (!isInterceptorEnabled) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
cloneNetwork.duration = Date.now() - cloneNetwork.startTime;
|
|
252
|
+
cloneNetwork.responseCode = 0;
|
|
253
|
+
cloneNetwork.errorCode = clientErrorCode;
|
|
254
|
+
cloneNetwork.errorDomain = 'cancelled';
|
|
255
|
+
cloneNetwork.responseBody = `ERROR: ${cloneNetwork.errorDomain}`;
|
|
256
|
+
});
|
|
237
257
|
}
|
|
238
258
|
cloneNetwork.startTime = Date.now();
|
|
239
259
|
const traceparent = await getTraceparentHeader(cloneNetwork);
|
|
@@ -120,7 +120,8 @@
|
|
|
120
120
|
return @{
|
|
121
121
|
@"dropAutoCapturedMedia": @(LCQConsentActionDropAutoCapturedMedia),
|
|
122
122
|
@"dropLogs": @(LCQConsentActionDropLogs),
|
|
123
|
-
@"noChat": @(LCQConsentActionNoChat)
|
|
123
|
+
@"noChat": @(LCQConsentActionNoChat),
|
|
124
|
+
@"noAutomaticBugGrouping": @(LCQConsentActionNoAutomaticBugGrouping),
|
|
124
125
|
};
|
|
125
126
|
}
|
|
126
127
|
+ (ArgsDictionary *) extendedBugReportStates {
|
package/ios/native.rb
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luciq/react-native",
|
|
3
3
|
"description": "Luciq is the Agentic Observability Platform built for Mobile.",
|
|
4
|
-
"version": "19.1
|
|
4
|
+
"version": "19.2.1",
|
|
5
5
|
"author": "Luciq (https://luciq.ai)",
|
|
6
6
|
"repository": "github:luciqai/luciq-reactnative-sdk",
|
|
7
7
|
"homepage": "https://www.luciq.ai/platforms/react-native",
|
package/src/utils/Enums.ts
CHANGED
|
@@ -231,7 +231,8 @@ export default {
|
|
|
231
231
|
if (this._hasError) {
|
|
232
232
|
cloneNetwork.errorCode = clientErrorCode;
|
|
233
233
|
cloneNetwork.errorDomain = 'ClientError';
|
|
234
|
-
|
|
234
|
+
cloneNetwork.responseCode = 0;
|
|
235
|
+
cloneNetwork.contentType = 'text/plain';
|
|
235
236
|
// @ts-ignore
|
|
236
237
|
const _response = this._response;
|
|
237
238
|
cloneNetwork.requestBody =
|
|
@@ -243,22 +244,30 @@ export default {
|
|
|
243
244
|
cloneNetwork.errorDomain = _response;
|
|
244
245
|
}
|
|
245
246
|
|
|
247
|
+
cloneNetwork.responseBody = `ERROR: ${cloneNetwork.errorDomain}`;
|
|
248
|
+
|
|
246
249
|
// @ts-ignore
|
|
247
250
|
} else if (this._timedOut) {
|
|
248
251
|
cloneNetwork.errorCode = clientErrorCode;
|
|
249
|
-
cloneNetwork.errorDomain = '
|
|
252
|
+
cloneNetwork.errorDomain = 'timeout';
|
|
253
|
+
cloneNetwork.responseCode = 0;
|
|
254
|
+
cloneNetwork.contentType = 'text/plain';
|
|
255
|
+
cloneNetwork.responseBody = `ERROR: ${cloneNetwork.errorDomain}`;
|
|
250
256
|
}
|
|
251
257
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
+
// Only set response body if not already set by error handlers
|
|
259
|
+
if (!cloneNetwork.errorDomain) {
|
|
260
|
+
if (this.response) {
|
|
261
|
+
if (this.responseType === 'blob') {
|
|
262
|
+
const responseText = await new Response(this.response).text();
|
|
263
|
+
cloneNetwork.responseBody = responseText;
|
|
264
|
+
} else if (['text', '', 'json'].includes(this.responseType)) {
|
|
265
|
+
cloneNetwork.responseBody = JSON.stringify(this.response);
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
cloneNetwork.responseBody = '';
|
|
269
|
+
cloneNetwork.contentType = 'text/plain';
|
|
258
270
|
}
|
|
259
|
-
} else {
|
|
260
|
-
cloneNetwork.responseBody = '';
|
|
261
|
-
cloneNetwork.contentType = 'text/plain';
|
|
262
271
|
}
|
|
263
272
|
|
|
264
273
|
cloneNetwork.requestBodySize = cloneNetwork.requestBody.length;
|
|
@@ -310,6 +319,18 @@ export default {
|
|
|
310
319
|
};
|
|
311
320
|
this.addEventListener('progress', downloadUploadProgressCallback);
|
|
312
321
|
this.upload.addEventListener('progress', downloadUploadProgressCallback);
|
|
322
|
+
|
|
323
|
+
// Handler for abort events (works with fetch, Axios, and any XHR-based requests)
|
|
324
|
+
this.addEventListener('abort', () => {
|
|
325
|
+
if (!isInterceptorEnabled) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
cloneNetwork.duration = Date.now() - cloneNetwork.startTime;
|
|
329
|
+
cloneNetwork.responseCode = 0;
|
|
330
|
+
cloneNetwork.errorCode = clientErrorCode;
|
|
331
|
+
cloneNetwork.errorDomain = 'cancelled';
|
|
332
|
+
cloneNetwork.responseBody = `ERROR: ${cloneNetwork.errorDomain}`;
|
|
333
|
+
});
|
|
313
334
|
}
|
|
314
335
|
|
|
315
336
|
cloneNetwork.startTime = Date.now();
|