Disable sentry on native
(cherry picked from commit 886b6fcf9ef2797949c5bf45ecaf786647e1105b) (cherry picked from commit 8707b44f8c9e2321a99f6cca140edbb77e7fb472)
This commit is contained in:
@@ -35,11 +35,6 @@ module.exports = function (config) {
|
||||
: undefined
|
||||
const UPDATES_ENABLED = !!UPDATES_CHANNEL
|
||||
|
||||
const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN)
|
||||
const SENTRY_DIST = `${PLATFORM}.${VERSION}.${IS_TESTFLIGHT ? 'tf' : ''}${
|
||||
IS_DEV ? 'dev' : ''
|
||||
}`
|
||||
|
||||
return {
|
||||
expo: {
|
||||
version: VERSION,
|
||||
@@ -197,15 +192,6 @@ module.exports = function (config) {
|
||||
plugins: [
|
||||
'expo-video',
|
||||
'expo-localization',
|
||||
USE_SENTRY && [
|
||||
'@sentry/react-native/expo',
|
||||
{
|
||||
organization: 'blueskyweb',
|
||||
project: 'react-native',
|
||||
release: VERSION,
|
||||
dist: SENTRY_DIST,
|
||||
},
|
||||
],
|
||||
[
|
||||
'expo-build-properties',
|
||||
{
|
||||
@@ -403,22 +389,6 @@ module.exports = function (config) {
|
||||
projectId: '55bd077a-d905-4184-9c7f-94789ba0f302',
|
||||
},
|
||||
},
|
||||
hooks: {
|
||||
postPublish: [
|
||||
/*
|
||||
* @see https://docs.expo.dev/guides/using-sentry/#app-configuration
|
||||
*/
|
||||
{
|
||||
file: './postHooks/uploadSentrySourcemapsPostHook',
|
||||
config: {
|
||||
organization: 'blueskyweb',
|
||||
project: 'react-native',
|
||||
release: VERSION,
|
||||
dist: SENTRY_DIST,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'react-native-url-polyfill/auto'
|
||||
import '#/logger/sentry/setup'
|
||||
import '#/lib/bitdrift' // must be near top
|
||||
import '#/view/icons'
|
||||
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@ import {RootSiblingParent} from 'react-native-root-siblings'
|
||||
import {SafeAreaProvider} from 'react-native-safe-area-context'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import * as Sentry from '@sentry/react-native'
|
||||
|
||||
import {QueryProvider} from '#/lib/react-query'
|
||||
import {Provider as StatsigProvider} from '#/lib/statsig/statsig'
|
||||
@@ -207,4 +208,4 @@ function App() {
|
||||
)
|
||||
}
|
||||
|
||||
export default App
|
||||
export default Sentry.wrap(App)
|
||||
|
||||
+4
-1
@@ -6,11 +6,14 @@ import {consoleTransport} from '#/logger/transports/console'
|
||||
import {sentryTransport} from '#/logger/transports/sentry'
|
||||
import {LogContext, LogLevel, Metadata, Transport} from '#/logger/types'
|
||||
import {enabledLogLevels} from '#/logger/util'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
|
||||
const TRANSPORTS: Transport[] = (function configureTransports() {
|
||||
switch (process.env.NODE_ENV) {
|
||||
case 'production': {
|
||||
return [sentryTransport, bitdriftTransport].filter(Boolean) as Transport[]
|
||||
return [isWeb && sentryTransport, bitdriftTransport].filter(
|
||||
Boolean,
|
||||
) as Transport[]
|
||||
}
|
||||
case 'test': {
|
||||
return []
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Importing these separately from `platform/detection` and `lib/app-info` to
|
||||
* avoid future conflicts and/or circular deps
|
||||
*/
|
||||
|
||||
import {Platform} from 'react-native'
|
||||
import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application'
|
||||
import {init} from '@sentry/react-native'
|
||||
|
||||
import {IS_TESTFLIGHT} from '#/lib/app-info'
|
||||
|
||||
/**
|
||||
* Examples:
|
||||
* - `dev`
|
||||
* - `1.57.0`
|
||||
*/
|
||||
const release = nativeApplicationVersion ?? 'dev'
|
||||
|
||||
/**
|
||||
* Examples:
|
||||
* - `web.dev`
|
||||
* - `ios.dev`
|
||||
* - `android.dev`
|
||||
* - `web.1.57.0`
|
||||
* - `ios.1.57.0.3`
|
||||
* - `android.1.57.0.46`
|
||||
*/
|
||||
const dist = `${Platform.OS}.${nativeBuildVersion}.${
|
||||
IS_TESTFLIGHT ? 'tf' : ''
|
||||
}${__DEV__ ? 'dev' : ''}`
|
||||
|
||||
init({
|
||||
enabled: !__DEV__,
|
||||
autoSessionTracking: false,
|
||||
dsn: 'https://05bc3789bf994b81bd7ce20c86ccd3ae@o4505071687041024.ingest.sentry.io/4505071690514432',
|
||||
debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production
|
||||
environment: process.env.NODE_ENV,
|
||||
dist,
|
||||
release,
|
||||
})
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import {init} from '@sentry/react-native'
|
||||
|
||||
init({
|
||||
enabled: !__DEV__,
|
||||
autoSessionTracking: false,
|
||||
dsn: 'https://8fb55ba4807fca137eedfc8403ee27ba@o4505071687041024.ingest.us.sentry.io/4508807082278912',
|
||||
debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production
|
||||
environment: process.env.NODE_ENV,
|
||||
ignoreErrors: ['t is not defined'],
|
||||
})
|
||||
Reference in New Issue
Block a user