Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering duplicated Unhandled JS Errors doesn't work with obfuscated class names on Android #3126

Closed
krystofwoldrich opened this issue Jun 14, 2023 · 5 comments · Fixed by #4232

Comments

@krystofwoldrich
Copy link
Member

Description

Our current solution to avoid duplicated errors being reported to Sentry doesn't work with obfuscated class names as we are checking the exception type against the string JavascriptException.

We have to check this as React Native passes unhandled exceptions from JS layer to the native layers. We catch and send the exception in the JS layer with JS context, the native exception doesn't provide any more useful information.

// React native internally throws a JavascriptException
// Since we catch it before that, we don't want to send this one
// because we would send it twice
try {
SentryException ex = event.getExceptions().get(0);
if (null != ex && ex.getType().contains("JavascriptException")) {
return null;
}
} catch (Throwable ignored) {
// We do nothing
}

@Angelodaniel Angelodaniel changed the title Filtering duplicated Unhandled JS Errors doesn't work with obfuscated class names on Andoroid Filtering duplicated Unhandled JS Errors doesn't work with obfuscated class names on Android Jun 14, 2023
@krystofwoldrich
Copy link
Member Author

@marandaneto I'm not sure because we are doing the check on the SentryException not on the original Exception. Is there a way to get the original in beforeSend?

@marandaneto
Copy link
Contributor

@marandaneto I'm not sure because we are doing the check on the SentryException not on the original Exception. Is there a way to get the original in beforeSend?

yes, our docs should document that https://docs.sentry.io/platforms/android/configuration/filtering/

@krystofwoldrich
Copy link
Member Author

This error doesn't look obfuscated (might be because it was symbolicated by Sentry) but is also reported twice.

@marandaneto
Copy link
Contributor

Consider even using https://docs.sentry.io/platforms/android/configuration/options/#ignored-exceptions-for-type
Maybe probably easier than beforeSend.

@krystofwoldrich krystofwoldrich added this to the 5.x milestone Jun 16, 2023
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Jun 19, 2023
@krystofwoldrich krystofwoldrich removed this from the 5.x milestone Jul 12, 2024
@antonis antonis self-assigned this Nov 1, 2024
@antonis antonis moved this from Backlog to In Progress in Mobile & Cross Platform SDK Nov 1, 2024
@antonis antonis moved this from In Progress to Needs Review in Mobile & Cross Platform SDK Nov 5, 2024
@github-project-automation github-project-automation bot moved this from Needs Review to Done in Mobile & Cross Platform SDK Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants