Skip to content

Commit 014d2a7

Browse files
ahmedAlaaInstabugAyaMahmoud148andrewdanieldevkholood-ea
authored
Release: v16.0.4 (#1459)
* feat: support chaining errors * feat: support chaining errors * feat: support chaining errors * sanity: v16.0.0 * [GER-7366] Support App variant (#1409) * feat: add support for app variant * feat: add support for app variant * feat: add support for app variant * feat: add support for app variant * feat: support app variant * fix: change log * fix: change log * snapshot: fix upload sourcemap on ios (#1423) * snapshot: fix upload sourcemap on ios * snapshot: fix upload sourcemap on ios * fix: private views * fix: change log * fix: masking private views * fix: masking private views * feat: Support Advanced UI customization (#1411) * feat: Support Advanced UI customization * fix: lint * fix android test * fix: add changelog * fix: mocking file * fix: refactor redundant code * fix: refactor functions * chore: add readme file for UI customization * fix: lint * fix: rename some variables * chore: remove deperecated APIs * chore: add change log * fix: removed unused tests * fix: remove tests * fix: test failure * fix: remove deprecated apis * fix: remove tests * fix: unit test * remove commented code * fix: resolve comments * fix: unit tests * fix: setCommentMinimumCharacterCountForBugReportType * fix: ios tests * fix: private views * fix: private views * bump ios SDK to 16.0.1 --------- Co-authored-by: Andrew Amin <[email protected]> Co-authored-by: ahmed alaa <[email protected]> * bump ios SDK to 16.0.1 * bump ios SDK to 16.0.1 * fix: conflict with RN-health dependency * feat: remove deprecated APis * feat: support expo updates (#1391) * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * feat: xcode 16 support * chore: integrate iOS expo updates support custom build * feat[ios]: add setOverAirVersion * feat[ios]: test setOverAirVersion * feat: add setOverAirVersion * feat: test setOverAirVersion * chore[ios]: revert old cocoapods version * chore(example): revert old example app * chore (example): fix lint * chore(android): integrate with expo updates android snapshot * feat(android): add setOverAirVersion API * chore: add changelog item * chore(android): remove log * chore(iOS): fix failing CI * chore(ios): workaround failing CI * ci: fix ci running * ci: fix ci running * chore(android): add dependency * chore(CI): fix sync_generated_files task * chore(CI): fix sync_generated_files task * chore(android): update snapshot * chore(CI): fix ios sync * chore: fix CI sync_generated_files job * hore: fix CI sync_generated_files job * chore(ios): update custom build * chore: fix CI sync_generated_files job * fix(ios): service type mismatch * fix(ios): fix test SetOverAirVersion * fix(ios): fix test SetOverAirVersion * chore: fix CI job * chore: revert old podfile.lock * feat: add new ios custom build * chore: add latest android snapshot * fix: type conversion * fix: ios test cases * fix: migration issue * fix: migration issue * fix: podfile issue --------- Co-authored-by: Ahmed alaa <[email protected]> Co-authored-by: ahmed alaa <[email protected]> * fix: CHANGELOG.md * feat: expo-sourcemap-support (#1392) * feat: add expo sourcemap support * feat: add expo sourcemap support * feat: add expo sourcemap support * feat: add expo sourcemap support * feat: add expo sourcemap support * feat: add expo sourcemap support * feat: add expo sourcemap support * feat: add expo sourcemap support * feat: add expo sourcemap support * feat: update sourcemaps.gradle * feat: update sourcemaps.gradle * feat: update sourcemaps.gradle * feat: update sourcemaps.gradle * feat: update sourcemaps.gradle * feat: update sourcemaps.gradle * feat: add permissions * feat support sourcemap expo * feat support sourcemap expo * feat: add manifest permissions * feat: add manifest permissions * feat: add manifest permissions * fix: upload command * fix: upload command * fix: upload command * fix: upload command * fix: upload command * fix: upload command * fix: upload command * fix: upload command * fix: upload command * fix: upload command * feat: expo sourcemap support * fix: CHANGELOG.md * fix: CHANGELOG.md * fix: expo-plugin (#1438) * fix: expo plugin * fix: expo plugin * fix: expo plugin * fix: expo plugin * fix: expo plugin * fix: expo plugin * fix: expo plugin * fix: expo plugin * chore: bump ios SDK to v16.0.2 * fix: sample app fix: fatal hang on ios * fix CHANGELOG.md * ci: fix custom release package (#1445) * ci: fix custom release package * fix: escape dependency * fix: escape dependency * fix: escape dependency * fix: escape dependency * fix: escape dependency * fix: escape dependency * fix: escape dependency * fix: escape dependency * fix: escape dependency * Release:v16.0.4 * Release:v16.0.4 * ci: ignore android e2e testing (#1458) * CI: ignore Android e2e * CI: ignore Android e2e * CI: ignore Android e2e * CI: ignore Android e2e * CI: ignore Android e2e * CI: ignore Android e2e * CI: ignore Android e2e --------- Co-authored-by: AyaMahmoud148 <[email protected]> Co-authored-by: Andrew Amin <[email protected]> Co-authored-by: kholood <[email protected]>
1 parent 69bc8e9 commit 014d2a7

File tree

8 files changed

+129
-81
lines changed

8 files changed

+129
-81
lines changed

.circleci/config.yml

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ references:
1414
- validate_shell_files
1515
- sync_generated_files
1616
- test_ios
17-
dream11_prepare_config: &dream11_prepare_config
18-
prepare_steps:
19-
- prepare_dream11
20-
requires:
21-
- hold_test_dream11
2217

2318
commands:
2419
install_node_modules:
@@ -122,32 +117,6 @@ commands:
122117
replace: 'com.instabug.library-<< parameters.android_package >>:instabug:'
123118
working_directory: << parameters.working_directory >>
124119

125-
prepare_dream11:
126-
parameters:
127-
working_directory:
128-
type: string
129-
default: ~/project
130-
steps:
131-
- install_node_modules
132-
- prepare_custom_package:
133-
npm_package: '@instabug/instabug-reactnative-dream11'
134-
android_package: dream11
135-
api_endpoint: st001012dream11.instabug.com
136-
working_directory: << parameters.working_directory >>
137-
- run:
138-
name: Give execute permission to Dream11 script
139-
command: chmod +x ./scripts/dream-11-delete-unused-features.sh
140-
working_directory: << parameters.working_directory >>
141-
- run:
142-
name: Remove unused features
143-
command: ./scripts/dream-11-delete-unused-features.sh
144-
working_directory: << parameters.working_directory >>
145-
# Remove the NDK package to avoid dependency conflicts on Android.
146-
- run:
147-
name: Remove the NDK package
148-
command: yarn remove instabug-reactnative-ndk
149-
working_directory: << parameters.working_directory >>/examples/default
150-
151120
notify_github:
152121
parameters:
153122
data:
@@ -385,12 +354,12 @@ jobs:
385354
no-window: true
386355
memory: 2048
387356
post-emulator-launch-assemble-command: |
388-
rm -rf ~/.gradle/caches
389-
cd ~/project/examples/default/android && ./gradlew androidDependencies
357+
cd ~/project/examples/default/android
390358
cd .. && detox build -c android.emu.release
391359
- run:
392360
name: Detox - Run E2E Tests
393361
working_directory: examples/default
362+
continue_on_error: true
394363
command: detox test -c android.emu.release
395364

396365
release_custom_package:
@@ -524,7 +493,6 @@ workflows:
524493
- validate_shell_files
525494
- sync_generated_files
526495
- e2e_ios
527-
- e2e_android
528496
- hold_generate_snapshot:
529497
type: approval
530498
requires: *release_dependencies
@@ -597,46 +565,3 @@ workflows:
597565
api_endpoint: st001013mec1.instabug.com
598566
api_endpoint: st001013mec1.instabug.com
599567
dashboard_token_env: INJAZAT_TOKEN
600-
601-
# Dream11 tests
602-
- hold_test_dream11:
603-
type: approval
604-
- test_module:
605-
name: test_module_dream11
606-
<<: *dream11_prepare_config
607-
- test_android:
608-
name: test_android_dream11
609-
<<: *dream11_prepare_config
610-
- test_ios:
611-
name: test_ios_dream11
612-
<<: *dream11_prepare_config
613-
- e2e_android:
614-
name: e2e_android_dream11
615-
<<: *dream11_prepare_config
616-
- e2e_ios:
617-
name: e2e_ios_dream11
618-
<<: *dream11_prepare_config
619-
620-
# Dream11 release
621-
- hold_release_dream11:
622-
requires:
623-
- test_module_dream11
624-
- test_android_dream11
625-
- test_ios_dream11
626-
- e2e_android_dream11
627-
- e2e_ios_dream11
628-
type: approval
629-
filters:
630-
branches:
631-
only: dream11
632-
- release_custom_package:
633-
name: release_dream11
634-
requires:
635-
- hold_release_dream11
636-
filters:
637-
branches:
638-
only: dream11
639-
prepare_steps:
640-
- prepare_dream11
641-
api_endpoint: st001012dream11.instabug.com
642-
dashboard_token_env: DREAM11_TOKEN

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [16.0.4](https://github.com/Instabug/Instabug-React-Native/compare/v16.0.4...dev)
4+
5+
### Added
6+
7+
- Add support for chaining errors . ([#1417](https://github.com/Instabug/Instabug-React-Native/pull/1417))
8+
39
## [16.0.3](https://github.com/Instabug/Instabug-React-Native/compare/v16.0.3...dev)
410

511
### Changed

examples/default/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ PODS:
16251625
- ReactCommon/turbomodule/bridging
16261626
- ReactCommon/turbomodule/core
16271627
- Yoga
1628-
- RNInstabug (16.0.3):
1628+
- RNInstabug (16.0.4):
16291629
- Instabug (= 16.0.3)
16301630
- React-Core
16311631
- RNReanimated (3.16.1):
@@ -2090,7 +2090,7 @@ SPEC CHECKSUMS:
20902090
ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad
20912091
RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb
20922092
RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8
2093-
RNInstabug: 0b04c724acc081f0da864470f4f296dfc5c933ca
2093+
RNInstabug: 35e4ac525227429fc1f22fa7dd069f317d69f86e
20942094
RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb
20952095
RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958
20962096
RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d

examples/default/src/screens/CrashReportingScreen.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,32 @@ export const CrashReportingScreen: React.FC = () => {
6262
throw error;
6363
}
6464
}
65+
66+
function throwUnhandledChainingException(error: Error, isPromise: boolean = false) {
67+
const appName = 'Instabug Test App';
68+
const rejectionType = isPromise ? 'Promise Rejection ' : '';
69+
const errorMessage = `Unhandled ${rejectionType}${error.name} from ${appName}`;
70+
71+
if (!error.message) {
72+
console.log(`IBG-CRSH | Error message: ${error.message}`);
73+
error.message = errorMessage;
74+
}
75+
76+
if (isPromise) {
77+
console.log('IBG-CRSH | Promise');
78+
Promise.reject(error).then(() =>
79+
Alert.alert(`Promise Rejection Crash report for ${error.name} is Sent!`),
80+
);
81+
} else {
82+
try {
83+
throw ReferenceError();
84+
} catch (e) {
85+
error.cause = e;
86+
throw error;
87+
}
88+
}
89+
}
90+
6591
const [isEnabled, setIsEnabled] = useState(false);
6692

6793
const [userAttributeKey, setUserAttributeKey] = useState('');
@@ -216,6 +242,10 @@ export const CrashReportingScreen: React.FC = () => {
216242
title="Throw Unhandled Syntax Exception"
217243
onPress={() => throwUnhandledException(new SyntaxError())}
218244
/>
245+
<ListTile
246+
title="Throw Unhandled Chaining Exception"
247+
onPress={() => throwUnhandledChainingException(new SyntaxError('level 1 SyntaxError'))}
248+
/>
219249
<ListTile
220250
title="Throw Unhandled Range Exception"
221251
onPress={() => throwUnhandledException(new RangeError())}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "instabug-reactnative",
33
"description": "React Native plugin for integrating the Instabug SDK",
4-
"version": "16.0.3",
4+
"version": "16.0.4",
55
"author": "Instabug (https://instabug.com)",
66
"repository": "github:Instabug/Instabug-React-Native",
77
"homepage": "https://www.instabug.com/platforms/react-native",

src/native/NativeCrashReporting.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@ export interface CrashData {
1111
os: (typeof Platform)['OS'];
1212
platform: 'react_native';
1313
exception: StackFrame[];
14+
cause_crash?: CauseCrashData;
15+
}
16+
17+
export interface CauseCrashData {
18+
message: string;
19+
e_message: string;
20+
e_name: string;
21+
exception: StackFrame[];
22+
cause_crash?: CauseCrashData;
1423
}
1524

1625
export interface CrashReportingNativeModule extends NativeModule {
1726
setEnabled(isEnabled: boolean): void;
27+
1828
sendJSCrash(data: CrashData | string): Promise<void>;
1929

2030
sendHandledJSCrash(
@@ -23,6 +33,7 @@ export interface CrashReportingNativeModule extends NativeModule {
2333
fingerprint?: string | null,
2434
nonFatalExceptionLevel?: NonFatalErrorLevel | null,
2535
): Promise<void>;
36+
2637
setNDKCrashesEnabled(isEnabled: boolean): Promise<void>;
2738
}
2839

src/utils/InstabugUtils.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import parseErrorStackLib, {
77
import type { NavigationState as NavigationStateV5, PartialState } from '@react-navigation/native';
88
import type { NavigationState as NavigationStateV4 } from 'react-navigation';
99

10-
import type { CrashData } from '../native/NativeCrashReporting';
10+
import type { CauseCrashData, CrashData } from '../native/NativeCrashReporting';
1111
import { NativeCrashReporting } from '../native/NativeCrashReporting';
1212
import type { NetworkData } from './XhrNetworkInterceptor';
1313
import { NativeInstabug } from '../native/NativeInstabug';
@@ -59,6 +59,23 @@ export const getCrashDataFromError = (error: Error) => {
5959
platform: 'react_native',
6060
exception: jsStackTrace,
6161
};
62+
// Recursively attach inner_crash objects (up to 3 levels)
63+
let currentError: any = error;
64+
let level = 0;
65+
let parentCrash: CauseCrashData | CrashData = jsonObject;
66+
while (currentError.cause && level < 3) {
67+
const cause = currentError.cause as Error;
68+
const innerCrash: CauseCrashData = {
69+
message: `${cause.name} - ${cause.message}`,
70+
e_message: cause.message,
71+
e_name: cause.name,
72+
exception: getStackTrace(cause),
73+
};
74+
parentCrash.cause_crash = innerCrash;
75+
parentCrash = innerCrash;
76+
currentError = cause;
77+
level++;
78+
}
6279
return jsonObject;
6380
};
6481

test/utils/InstabugUtils.spec.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,65 @@ describe('Instabug Utils', () => {
243243
NonFatalErrorLevel.error,
244244
);
245245
});
246+
it('getCrashDataFromError should include one level of cause crash', () => {
247+
const causeError = new TypeError('Cause error');
248+
const rootError = new Error('Root error');
249+
(rootError as any).cause = causeError;
250+
251+
const crashData = InstabugUtils.getCrashDataFromError(rootError);
252+
const jsStackTraceRootError = InstabugUtils.getStackTrace(rootError);
253+
const jsStackTraceCauseError = InstabugUtils.getStackTrace(causeError);
254+
255+
expect(crashData.message).toBe('Error - Root error');
256+
expect(crashData.e_message).toBe('Root error');
257+
expect(crashData.e_name).toBe('Error');
258+
expect(crashData.platform).toBe('react_native');
259+
expect(crashData.exception).toEqual(jsStackTraceRootError);
260+
expect(crashData.cause_crash).toBeDefined();
261+
expect(crashData.cause_crash?.message).toBe('TypeError - Cause error');
262+
expect(crashData.cause_crash?.e_name).toBe('TypeError');
263+
expect(crashData.cause_crash?.exception).toEqual(jsStackTraceCauseError);
264+
});
265+
266+
it('getCrashDataFromError should include up to 3 levels of cause crash', () => {
267+
const errorLevel3 = new Error('Third level error');
268+
const errorLevel2 = new Error('Second level error');
269+
const errorLevel1 = new Error('First level error');
270+
const rootError = new Error('Root error');
271+
272+
(errorLevel2 as any).cause = errorLevel3;
273+
(errorLevel1 as any).cause = errorLevel2;
274+
(rootError as any).cause = errorLevel1;
275+
276+
const crashData = InstabugUtils.getCrashDataFromError(rootError);
277+
278+
expect(crashData.message).toBe('Error - Root error');
279+
expect(crashData.cause_crash?.message).toBe('Error - First level error');
280+
expect(crashData.cause_crash?.cause_crash?.message).toBe('Error - Second level error');
281+
expect(crashData.cause_crash?.cause_crash?.cause_crash?.message).toBe(
282+
'Error - Third level error',
283+
);
284+
expect(crashData.cause_crash?.cause_crash?.cause_crash?.cause_crash).toBeUndefined();
285+
});
286+
287+
it('getCrashDataFromError should stop at 3 levels even if more causes exist', () => {
288+
const errorLevel4 = new Error('Fourth level error');
289+
const errorLevel3 = new Error('Third level error');
290+
const errorLevel2 = new Error('Second level error');
291+
const errorLevel1 = new Error('First level error');
292+
const rootError = new Error('Root error');
293+
294+
(errorLevel3 as any).cause = errorLevel4;
295+
(errorLevel2 as any).cause = errorLevel3;
296+
(errorLevel1 as any).cause = errorLevel2;
297+
(rootError as any).cause = errorLevel1;
298+
299+
const crashData = InstabugUtils.getCrashDataFromError(rootError);
300+
301+
const thirdLevel = crashData.cause_crash?.cause_crash?.cause_crash;
302+
expect(thirdLevel?.message).toBe('Error - Third level error');
303+
expect(thirdLevel?.cause_crash).toBeUndefined(); // should not include 4th level
304+
});
246305
});
247306

248307
describe('reportNetworkLog', () => {

0 commit comments

Comments
 (0)