Skip to content

Commit e0f5713

Browse files
Merge branch 'main' into expo
2 parents b51f045 + 9aa72e9 commit e0f5713

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Errors from InternalBytecode.js are no longer marked as in_app ([#3518](https://github.com/getsentry/sentry-react-native/pull/3518))
8+
39
## 5.16.0-alpha.4
410

511
### Fixes

src/js/integrations/rewriteframes.ts

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ export function createReactNativeRewriteFrames(): RewriteFrames {
5757
}
5858

5959
const appPrefix = 'app://';
60+
// https://github.com/getsentry/sentry-react-native/issues/3348
61+
if (frame.filename === '/InternalBytecode.js') {
62+
frame.in_app = false;
63+
}
6064
// We always want to have a triple slash
6165
frame.filename =
6266
frame.filename.indexOf('/') === 0 ? `${appPrefix}${frame.filename}` : `${appPrefix}/${frame.filename}`;

test/integrations/rewriteframes.test.ts

+33
Original file line numberDiff line numberDiff line change
@@ -859,4 +859,37 @@ describe('RewriteFrames', () => {
859859
},
860860
});
861861
});
862+
863+
it('InternalBytecode should be flaged as not InApp', async () => {
864+
mockFunction(isHermesEnabled).mockReturnValue(true);
865+
866+
const IOS_REACT_NATIVE_HERMES = {
867+
message: 'Error: lets throw!',
868+
name: 'Error',
869+
stack:
870+
'at anonymous (/Users/username/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:139:27)',
871+
};
872+
873+
const exception = await exceptionFromError(IOS_REACT_NATIVE_HERMES);
874+
875+
expect(exception).toEqual({
876+
value: 'Error: lets throw!',
877+
type: 'Error',
878+
mechanism: {
879+
handled: true,
880+
type: 'generic',
881+
},
882+
stacktrace: {
883+
frames: [
884+
{
885+
filename: 'app:///InternalBytecode.js',
886+
function: 'anonymous',
887+
lineno: 139,
888+
colno: 27,
889+
in_app: false,
890+
},
891+
],
892+
},
893+
});
894+
});
862895
});

0 commit comments

Comments
 (0)