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 that this, plus re-enabling Sentry on Android
(coming up) seems adequate for zulip#5766.
  • Loading branch information
gnprice authored and chrisbobbe committed Oct 4, 2023
1 parent 103520f commit ed101de
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 ed101de

Please sign in to comment.