Skip to content
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1ddc5e3
feat(example): add apm screen (#1141)
abdelhamid-f-nasser Jul 17, 2024
0222c64
fix(android): resolve an OOM in network logs (#1244)
a7medev Jul 18, 2024
635cd47
fix(android): APM network logging(#1253)
kholood-ea Jul 23, 2024
61e1f3f
feat/support-capture-client-error-in-xhr-requests
ahmedAlaaInstabug Jul 24, 2024
50bc3be
feat/support-capture-client-error-in-xhr-requests
ahmedAlaaInstabug Jul 24, 2024
9b23d7a
fix: Pr comments
ahmedAlaaInstabug Jul 29, 2024
99ce7c8
fix: Pr comments
ahmedAlaaInstabug Jul 29, 2024
d8d43eb
fix: Pr comments
ahmedAlaaInstabug Jul 30, 2024
5864aac
fix: Pr comments
ahmedAlaaInstabug Jul 30, 2024
faa33ed
fix: Pr comments
ahmedAlaaInstabug Jul 31, 2024
d00c708
fix: Pr comments
ahmedAlaaInstabug Jul 31, 2024
a53508c
fix: Pr comments
ahmedAlaaInstabug Jul 31, 2024
13ac3ad
fix: Pr comments
ahmedAlaaInstabug Jul 31, 2024
3078211
feat: export upload utils (#1252)
a7medev Jul 31, 2024
6eaf496
chore(example): remove flipper (#1259)
a7medev Jul 31, 2024
f2197b8
fix: Pr comments
ahmedAlaaInstabug Aug 1, 2024
79afb4b
fix(android): resolve an OOM in network logs (#1244)
a7medev Jul 18, 2024
61274de
fix(android): APM network logging(#1253)
kholood-ea Jul 23, 2024
36c9974
feat: export upload utils (#1252)
a7medev Jul 31, 2024
8677585
fix(android): pass network start time in microseconds (#1260)
ahmedAlaaInstabug Aug 2, 2024
b638d12
feat: support feature flags with variants (#1230)
ahmedAlaaInstabug Aug 2, 2024
27a10e3
chore(android): bump android sdk to v13.3.0 (#1261)
a7medev Aug 4, 2024
f5f64f8
chore(ios): bump sdk to v13.3.0 (#1262)
a7medev Aug 4, 2024
2485fac
release: v13.3.0 (#1263)
a7medev Aug 4, 2024
f66f3e1
chore: remove duplicate app flows entries in changelog (#1264)
a7medev Aug 4, 2024
efe4240
chore: remove duplicate execution traces deprecation in changelog (#1…
a7medev Aug 4, 2024
be8daf0
feat: add axios button to example app
ahmedAlaaInstabug Aug 6, 2024
8f0a5c4
fix: change client error code to 9876
ahmedAlaaInstabug Aug 22, 2024
398262d
fix: change client error code to 9876
ahmedAlaaInstabug Aug 22, 2024
ac2d7e6
fix: change client error code to 9876
ahmedAlaaInstabug Aug 22, 2024
9550ce9
fix: change client error code to 9876
ahmedAlaaInstabug Aug 22, 2024
b41ff4f
feat: navigation tracking support with expo router (#1270)
kholood-ea Aug 12, 2024
10286cd
chore: enhance expo router tracking support (#1272)
kholood-ea Aug 13, 2024
ef5a023
ci: generalize enterprise releases (#1275)
a7medev Aug 22, 2024
253c92c
ci: run tests before enterprise releases (#1271)
a7medev Aug 22, 2024
030fa97
ci: publish snapshots to npm (#1274)
a7medev Aug 22, 2024
ee836a1
fix: changelog merge issues
ahmedAlaaInstabug Sep 12, 2024
97350b4
fix: changelog merge issues
ahmedAlaaInstabug Sep 12, 2024
0a16c77
fix: PR comments
ahmedAlaaInstabug Sep 12, 2024
f0c4228
Merge remote-tracking branch 'origin/dev' into sqqq
ahmedAlaaInstabug Sep 15, 2024
b1424be
fix: merge issues
ahmedAlaaInstabug Sep 15, 2024
c189b2b
Merge remote-tracking branch 'origin/dev' into feat/support-capture-c…
ahmedAlaaInstabug Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
343 changes: 220 additions & 123 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Distribution
dist/
bin/
upload/*
!upload/package.json

# NodeJS
node_modules/
Expand Down
36 changes: 32 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v13.3.0...dev)

### Added

- Add support for Expo Router navigation tracking ([#1270](https://github.com/Instabug/Instabug-React-Native/pull/1270)).
- Enhance the network interceptor to capture some client error messages ([#1257](https://github.com/Instabug/Instabug-React-Native/pull/1257)).

## [13.3.0](https://github.com/Instabug/Instabug-React-Native/compare/v13.2.0...v13.3.0) (August 4, 2024)

### Added

- Add support for Feature Flags APIs `Instabug.addFeatureFlags`, `Instabug.removeFeatureFlags` and `Instabug.clearAllFeatureFlags` ([#1230](https://github.com/Instabug/Instabug-React-Native/pull/1230)).
- Export `uploadSourcemaps` and `uploadSoFiles` utilities in the `instabug-reactnative/upload` sub-package for usage in custom Node.js upload scripts ([#1252](https://github.com/Instabug/Instabug-React-Native/pull/1252)).

### Changed

- Bump Instabug Android SDK to v13.3.0 ([#1261](https://github.com/Instabug/Instabug-React-Native/pull/1261)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v13.3.0).
- Bump Instabug iOS SDK to v13.3.0 ([#1262](https://github.com/Instabug/Instabug-React-Native/pull/1262)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/13.3.0).

### Deprecated

- Deprecate Experiments APIs `Instabug.addExperiments`, `Instabug.removeExperiments` and `Instabug.clearAllExperiments` in favor of the new Feature Flags APIs ([#1230](https://github.com/Instabug/Instabug-React-Native/pull/1230)).

### Fixed

- Fix APM network logging on Android ([#1253](https://github.com/Instabug/Instabug-React-Native/pull/1253)).
- Fix an OOM (out-of-memory) crash while saving network logs on Android ([#1244](https://github.com/Instabug/Instabug-React-Native/pull/1244)).

## [13.2.0](https://github.com/Instabug/Instabug-React-Native/compare/v13.1.1...v13.2.0) (July 7, 2024)

### Changed
Expand Down Expand Up @@ -52,17 +80,17 @@
- Bump Instabug iOS SDK to v13.0.0 ([#1189](https://github.com/Instabug/Instabug-React-Native/pull/1189)). [See release notes](https://github.com/instabug/instabug-ios/releases/tag/13.0.0).
- Bump Instabug Android SDK to v13.0.0 ([#1188](https://github.com/Instabug/Instabug-React-Native/pull/1188)). [See release notes](https://github.com/Instabug/android/releases/tag/v13.0.0).

### Deprecated

- Deprecate Execution Traces APIs `APM.startExecutionTrace`, `Trace.end` and `Trace.setAttribute` in favor of the new App Flows APIs ([#1138](https://github.com/Instabug/Instabug-React-Native/pull/1138)).

## [12.9.0](https://github.com/Instabug/Instabug-React-Native/compare/v12.8.0...12.9.0)(April 2, 2024)

### Added

- Adds symbol files upload script ([#1137](https://github.com/Instabug/Instabug-React-Native/pull/1137))
- Support enabling NDK crash capturing on Android ([#1132](https://github.com/Instabug/Instabug-React-Native/pull/1132)).

### Deprecated

- Deprecate Execution Traces APIs `APM.startExecutionTrace`, `Trace.end` and `Trace.setAttribute` in favor of the new App Flows APIs ([#1138](https://github.com/Instabug/Instabug-React-Native/pull/1138)).

### Changed

- Bump Instabug Android SDK to v12.9.0 ([#1168](https://github.com/Instabug/Instabug-React-Native/pull/1168)). [See release notes](https://github.com/Instabug/android/releases/tag/v12.9.0).
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ android {
minSdkVersion getExtOrDefault('minSdkVersion').toInteger()
targetSdkVersion getExtOrDefault('targetSdkVersion').toInteger()
versionCode 1
versionName "13.2.0"
versionName "13.3.0"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
Expand Down
2 changes: 1 addition & 1 deletion android/native.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project.ext.instabug = [
version: '13.2.0'
version: '13.3.0'
]

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest package="com.instabug.reactlibrary"
<manifest
xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.instabug.apm.APM;
import com.instabug.apm.model.ExecutionTrace;
import com.instabug.apm.networking.APMNetworkLogger;
import com.instabug.apm.networkinterception.cp.APMCPNetworkLog;
import com.instabug.reactlibrary.utils.MainThreadHandler;

import org.json.JSONException;
Expand Down Expand Up @@ -312,56 +315,59 @@ public void run() {
});
}

/**
* Send Apm network log by Reflection
*/
@ReactMethod
public void networkLog(String networkData) throws JSONException {
try{
APMNetworkLogger apmNetworkLogger = new APMNetworkLogger();
JSONObject jsonObject = new JSONObject(networkData);
final String requestUrl = (String) jsonObject.get("url");
final String requestBody = (String) jsonObject.get("requestBody");
final String responseBody = (String) jsonObject.get("responseBody");
final String requestMethod = (String) jsonObject.get("method");
//--------------------------------------------
final String requestContentType = (String) jsonObject.get("requestContentType");
final String responseContentType = (String) jsonObject.get("contentType");
//--------------------------------------------
final long requestBodySize = ((Number) jsonObject.get("requestBodySize")).longValue();
final long responseBodySize = ((Number) jsonObject.get("responseBodySize")).longValue();
//--------------------------------------------
final String errorDomain = (String) jsonObject.get("errorDomain");
final Integer statusCode = (Integer) jsonObject.get("responseCode");
final long requestDuration = ((Number) jsonObject.get("duration")).longValue();
final long requestStartTime = ((Number) jsonObject.get("startTime")).longValue() * 1000;
final String requestHeaders = (String) jsonObject.get("requestHeaders").toString();
final String responseHeaders = (String) jsonObject.get("responseHeaders").toString();
final String errorMessage;
if(errorDomain.equals("")) {
errorMessage = null;
} else {
errorMessage = errorDomain;
}
//--------------------------------------------
String gqlQueryName = null;
if(jsonObject.has("gqlQueryName")){
gqlQueryName = (String) jsonObject.get("gqlQueryName");
}
final String serverErrorMessage = (String) jsonObject.get("serverErrorMessage");
private void networkLogAndroid(final double requestStartTime,
final double requestDuration,
final String requestHeaders,
final String requestBody,
final double requestBodySize,
final String requestMethod,
final String requestUrl,
final String requestContentType,
final String responseHeaders,
final String responseBody,
final double responseBodySize,
final double statusCode,
final String responseContentType,
@Nullable final String errorDomain,
@Nullable final String gqlQueryName,
@Nullable final String serverErrorMessage) {
try {
APMNetworkLogger networkLogger = new APMNetworkLogger();

final boolean hasError = errorDomain != null && !errorDomain.isEmpty();
final String errorMessage = hasError ? errorDomain : null;

try {
Method method = getMethod(Class.forName("com.instabug.apm.networking.APMNetworkLogger"), "log", long.class, long.class, String.class, String.class, long.class, String.class, String.class, String.class, String.class, String.class, long.class, int.class, String.class, String.class, String.class, String.class);
Method method = getMethod(Class.forName("com.instabug.apm.networking.APMNetworkLogger"), "log", long.class, long.class, String.class, String.class, long.class, String.class, String.class, String.class, String.class, String.class, long.class, int.class, String.class, String.class, String.class, String.class, APMCPNetworkLog.W3CExternalTraceAttributes.class);
if (method != null) {
method.invoke(apmNetworkLogger, requestStartTime, requestDuration, requestHeaders, requestBody, requestBodySize, requestMethod, requestUrl, requestContentType, responseHeaders, responseBody, responseBodySize, statusCode, responseContentType, errorMessage, gqlQueryName, serverErrorMessage);
method.invoke(
networkLogger,
(long) requestStartTime * 1000,
(long) requestDuration,
requestHeaders,
requestBody,
(long) requestBodySize,
requestMethod,
requestUrl,
requestContentType,
responseHeaders,
responseBody,
(long)responseBodySize,
(int) statusCode,
responseContentType,
errorMessage,
gqlQueryName,
serverErrorMessage,
null
);
} else {
Log.e("IB-CP-Bridge", "apmNetworkLogByReflection was not found by reflection");
Log.e("IB-CP-Bridge", "APMNetworkLogger.log was not found by reflection");
}
} catch (Throwable e) {
e.printStackTrace();
}
}
catch(Throwable e) {
} catch(Throwable e) {
e.printStackTrace();
}
}
Expand Down
Loading