Skip to content

Commit

Permalink
sentry: Disable Sentry native code on Android
Browse files Browse the repository at this point in the history
Using the new option added in @sentry/react-native 5.10.0:
  https://github.com/getsentry/sentry-react-native/releases/tag/5.10.0

Greg found in testing:
  https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/re-enabling.20Sentry/near/1654140

that this, plus re-enabling Sentry on Android (coming up) seems
adequate for #5766.
  • Loading branch information
gnprice committed Oct 5, 2023
1 parent 49b0913 commit 1510bd3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { nativeApplicationVersion } from 'expo-application';
// $FlowFixMe[untyped-import]
import md5 from 'blueimp-md5';

import { Platform } from 'react-native';
import type { Identity } from './types';
import isAppOwnDomain from './isAppOwnDomain';
import store from './boot/store';
Expand Down Expand Up @@ -153,10 +154,22 @@ export const initializeSentry = () => {

Sentry.init({
dsn: key,

ignoreErrors: [
// RN's fetch implementation can raise these; we sometimes mimic it
'Network request failed',
],

...(Platform.OS === 'android'
? {
// Disable Sentry's native code (libsentry.so), because it has
// memory-corruption bugs that cause the app to crash.
// https://github.com/zulip/zulip-mobile/issues/5766
// https://github.com/getsentry/sentry-java/issues/2955#issuecomment-1739030872
enableNdk: false,
}
: Object.freeze({})),

beforeBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null {
try {
return scrubBreadcrumb(breadcrumb, hint);
Expand Down

0 comments on commit 1510bd3

Please sign in to comment.