Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"@react-navigation/stack": "^7.4.2",
"@redux-devtools/remote": "0.8.0",
"@reduxjs/toolkit": "1.6.1",
"@sentry/react-native": "^6.20.0",
"@shopify/flash-list": "^1.8.3",
"@snapchat/snap-kit-react-native": "0.4.0",
"@solana-mobile/mobile-wallet-adapter-protocol": "2.2.5",
Expand Down
44 changes: 40 additions & 4 deletions packages/mobile/src/app/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,44 @@
// Sentry removed from mobile - using only console logging and other error tracking
import * as Sentry from '@sentry/react-native'

export const navigationIntegration = null
import { env } from 'app/services/env'

import packageJson from '../../package.json'

const { version: appVersion } = packageJson

export const navigationIntegration = Sentry.reactNavigationIntegration({
enableTimeToInitialDisplay: true
})

export const initSentry = () => {
// No-op: Sentry disabled for mobile
// console.log('Sentry disabled for mobile app')
if (!env.SENTRY_DSN) return

Sentry.init({
dsn: env.SENTRY_DSN,
release: appVersion,
integrations: [
navigationIntegration,
Sentry.reactNativeTracingIntegration()
],
enableUserInteractionTracing: true,
tracesSampleRate: 0.1,
ignoreErrors: [
'Network request failed',
'Network Error',
'NetworkError',
'The Internet connection appears to be offline',
'No internet connection',
'Connection lost',
/timeout.*exceeded/i,
'AbortError',
'User cancelled',
'Login cancelled',
'cancelled by user',
'Non-Error promise rejection captured'
]
})
Sentry.setTag('platform', 'mobile')
if (process.env.VITE_CURRENT_GIT_SHA) {
Sentry.setTag('commit_sha', process.env.VITE_CURRENT_GIT_SHA)
}
}