diff --git a/ios/NewExpensify.xcodeproj/project.pbxproj b/ios/NewExpensify.xcodeproj/project.pbxproj index 236658039a3b..b31421278904 100644 --- a/ios/NewExpensify.xcodeproj/project.pbxproj +++ b/ios/NewExpensify.xcodeproj/project.pbxproj @@ -721,7 +721,6 @@ "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.bundle", - "${PODS_CONFIGURATION_BUILD_DIR}/Sentry/Sentry.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/boost/boost_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/glog/glog_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb_Privacy.bundle", @@ -755,7 +754,6 @@ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SDWebImage.bundle", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Sentry.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/boost_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/glog_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/nanopb_Privacy.bundle", diff --git a/ios/Podfile.lock b/ios/Podfile.lock index aba7745ebf2e..09a4e0118ade 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -3157,31 +3157,6 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - RNSentry (7.4.0): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.11.18.00) - - RCTRequired - - RCTTypeSafety - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-hermes - - React-ImageManager - - React-jsi - - React-NativeModulesApple - - React-RCTFabric - - React-renderercss - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Sentry/HybridSDK (= 8.57.0) - - Yoga - RNShare (11.0.2): - DoubleConversion - glog @@ -3271,7 +3246,6 @@ PODS: - SDWebImageWebPCoder (0.14.6): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.17) - - Sentry/HybridSDK (8.57.0) - SocketRocket (0.7.1) - Turf (2.8.0) - TweetNacl (1.0.2) @@ -3420,7 +3394,6 @@ DEPENDENCIES: - RNReactNativeHapticFeedback (from `../node_modules/react-native-haptic-feedback`) - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) - - "RNSentry (from `../node_modules/@sentry/react-native`)" - RNShare (from `../node_modules/react-native-share`) - RNSound (from `../node_modules/react-native-sound`) - RNSVG (from `../node_modules/react-native-svg`) @@ -3474,7 +3447,6 @@ SPEC REPOS: - SDWebImageAVIFCoder - SDWebImageSVGCoder - SDWebImageWebPCoder - - Sentry - SocketRocket - Turf - TweetNacl @@ -3745,8 +3717,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-reanimated" RNScreens: :path: "../node_modules/react-native-screens" - RNSentry: - :path: "../node_modules/@sentry/react-native" RNShare: :path: "../node_modules/react-native-share" RNSound: @@ -3936,7 +3906,6 @@ SPEC CHECKSUMS: RNReactNativeHapticFeedback: 85c0a6ff490d52f5e8073040296fefe5945ebbfa RNReanimated: 0692f0b36f15b83a7936c3611cab923e1396eeb9 RNScreens: 0dcbe4c37daf0ec9b98bc5a655b1303e58e676ff - RNSentry: ad7065ec925f1d28fe515a28b9b5a9355362a164 RNShare: 1e3e15a3d2608acde2808bc35448e2344e38e15b RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852 RNSVG: 9346c68a0d5c5e4e74d82d664b745f28e6cfc1cb @@ -3944,7 +3913,6 @@ SPEC CHECKSUMS: SDWebImageAVIFCoder: afe194a084e851f70228e4be35ef651df0fc5c57 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380 - Sentry: e1b49e5f49367ff211b25c431a60e2bd83b792aa SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Turf: aa2ede4298009639d10db36aba1a7ebaad072a5e TweetNacl: 3abf4d1d2082b0114e7a67410e300892448951e6 diff --git a/jest/setup.ts b/jest/setup.ts index 161133fbd6b7..8e4dd8f5179a 100644 --- a/jest/setup.ts +++ b/jest/setup.ts @@ -107,15 +107,6 @@ jest.mock('@src/libs/actions/Timing', () => ({ clearData: jest.fn(), })); -jest.mock('@src/setup/telemetry', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention - __esModule: true, - default: jest.fn(), - navigationIntegration: { - registerNavigationContainer: jest.fn(), - }, -})); - jest.mock('../modules/background-task/src/NativeReactNativeBackgroundTask', () => ({ defineTask: jest.fn(), onBackgroundTaskExecution: jest.fn(), diff --git a/metro.config.js b/metro.config.js index 77daa8dae19c..90ae8c6becea 100644 --- a/metro.config.js +++ b/metro.config.js @@ -5,8 +5,6 @@ const {mergeConfig} = require('@react-native/metro-config'); const defaultAssetExts = require('metro-config/src/defaults/defaults').assetExts; const {sourceExts: defaultSourceExts, additionalExts} = require('metro-config/src/defaults/defaults'); const {wrapWithReanimatedMetroConfig} = require('react-native-reanimated/metro-config'); -const {withSentryConfig} = require('@sentry/react-native/metro'); -const {createSentryMetroSerializer} = require('@sentry/react-native/dist/js/tools/sentryMetroSerializer'); require('dotenv').config(); const defaultConfig = getReactNativeDefaultConfig(__dirname); @@ -36,9 +34,6 @@ const config = { }, }), }, - serializer: { - customSerializer: createSentryMetroSerializer(), - }, }; -module.exports = withSentryConfig(wrapWithReanimatedMetroConfig(mergeConfig(defaultConfig, expoConfig, config))); +module.exports = wrapWithReanimatedMetroConfig(mergeConfig(defaultConfig, expoConfig, config)); diff --git a/package-lock.json b/package-lock.json index d4d1709f5835..2c3995895648 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,6 @@ "@react-navigation/stack": "7.3.3", "@react-ng/bounds-observer": "^0.2.1", "@rnmapbox/maps": "10.1.44", - "@sentry/react-native": "^7.0.1", "@shopify/flash-list": "2.0.3", "@ua/react-native-airship": "~24.4.0", "array.prototype.tosorted": "^1.1.4", @@ -12145,311 +12144,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@sentry-internal/browser-utils": { - "version": "10.20.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-10.20.0.tgz", - "integrity": "sha512-9+NybrYs+dEM2iW5uRAYEhKkNK0XhDea5jovtDUXEvdSCMJFcdR88uztkftnCur45/hpvbgSULsGPUdHPb5ITw==", - "license": "MIT", - "dependencies": { - "@sentry/core": "10.20.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry-internal/feedback": { - "version": "10.20.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-10.20.0.tgz", - "integrity": "sha512-R/eGLKl7WDccLKBorEbyTsy5b99w/k4v80SntE8HL2rsO7DCDXma8TGmtHd+iZnw8dUci+EVrw7LbeGSgf3QzA==", - "license": "MIT", - "dependencies": { - "@sentry/core": "10.20.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry-internal/replay": { - "version": "10.20.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-10.20.0.tgz", - "integrity": "sha512-+XPYp0CuJnf+c36/c+hHrY6wAPHCdnqllZeyU7+9LAiKsdhN8Oo4eF1v5zd097qDZBg1NrKhU44ScJIzz+vygw==", - "license": "MIT", - "dependencies": { - "@sentry-internal/browser-utils": "10.20.0", - "@sentry/core": "10.20.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry-internal/replay-canvas": { - "version": "10.20.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-10.20.0.tgz", - "integrity": "sha512-8DBawFi4F4e2Cu2ToiitCnYsK8idrDOv66Vq+N6c8e3qFitTTuoPQwOihb2+HY4CB06ABPW3WvfZntJJmsf91w==", - "license": "MIT", - "dependencies": { - "@sentry-internal/replay": "10.20.0", - "@sentry/core": "10.20.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry/babel-plugin-component-annotate": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-4.4.0.tgz", - "integrity": "sha512-Pzjpn9MZg6yR61ThJgOoD28dLNCj457O0/t8d276K+Bzf8iOZKbrNO4sltp1vUB1yqhV+ulvIZO8xu8ABohtsg==", - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/@sentry/browser": { - "version": "10.20.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-10.20.0.tgz", - "integrity": "sha512-zcf8HwFiRbzjZL9KbLev44eEOf+yl+3svQbs2BlR2KAYGaB10swV5abij0UTTGO7ClnqUZdcGpwiyyfPS6mjHg==", - "license": "MIT", - "dependencies": { - "@sentry-internal/browser-utils": "10.20.0", - "@sentry-internal/feedback": "10.20.0", - "@sentry-internal/replay": "10.20.0", - "@sentry-internal/replay-canvas": "10.20.0", - "@sentry/core": "10.20.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry/cli": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.56.1.tgz", - "integrity": "sha512-VDAIg+gmjNtJS5VUZQMDSK9RaKC9hYQi3PoXpNa+owNfQNk60bCi8z8jkbWRcKbNGn3V51WqvrQAqLoNAdPc9w==", - "hasInstallScript": true, - "license": "BSD-3-Clause", - "dependencies": { - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.7", - "progress": "^2.0.3", - "proxy-from-env": "^1.1.0", - "which": "^2.0.2" - }, - "bin": { - "sentry-cli": "bin/sentry-cli" - }, - "engines": { - "node": ">= 10" - }, - "optionalDependencies": { - "@sentry/cli-darwin": "2.56.1", - "@sentry/cli-linux-arm": "2.56.1", - "@sentry/cli-linux-arm64": "2.56.1", - "@sentry/cli-linux-i686": "2.56.1", - "@sentry/cli-linux-x64": "2.56.1", - "@sentry/cli-win32-arm64": "2.56.1", - "@sentry/cli-win32-i686": "2.56.1", - "@sentry/cli-win32-x64": "2.56.1" - } - }, - "node_modules/@sentry/cli-darwin": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.56.1.tgz", - "integrity": "sha512-zfhT8MrvB5x/xRdIVGwg+sG0Cx3i0G6RH2zCrdQ/moWn8TfkwsM0O1k/AxpwbpcRfAHCkVb04CU/yKciKwg2KA==", - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@sentry/cli-linux-arm": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.56.1.tgz", - "integrity": "sha512-fNB/Ng11HrkGOSEIDg+fc3zfTCV7q6kJddp6ndK3QlYFsCffRSnclaX1SMp+mqxdWkHqe1kkp85OY8G/x5uAWw==", - "cpu": [ - "arm" - ], - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "linux", - "freebsd", - "android" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@sentry/cli-linux-arm64": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.56.1.tgz", - "integrity": "sha512-AypXIwZvOMJb9RgjI/98hTAd06FcOjqjIm6G9IR0OI4pJCOcaAXz9NKXdJqxpZd7phSMJnD+Bx/8iYOUPeY73A==", - "cpu": [ - "arm64" - ], - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "linux", - "freebsd", - "android" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@sentry/cli-linux-i686": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.56.1.tgz", - "integrity": "sha512-vnH+WJEsUq7Lf7xc9udzE/M4hoDXXsniFFYr/7BvdnXtCQlNNaWFMXHbEDYAql3baIlHkWoG8cEHWuB/YKyniw==", - "cpu": [ - "x86", - "ia32" - ], - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "linux", - "freebsd", - "android" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@sentry/cli-linux-x64": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.56.1.tgz", - "integrity": "sha512-3/BlKe5Vdnia36MeovghHJD8lbcum5TFIxLp+PSfH2sVb09+5Jo0L95oRTI2JkD8Fs+QNssvTqTxJj5eIo/n+A==", - "cpu": [ - "x64" - ], - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "linux", - "freebsd", - "android" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@sentry/cli-win32-arm64": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.56.1.tgz", - "integrity": "sha512-Gg8RV7CV7Tz4fiR1EN1Af5AVhJsnEXiZvfvfQXI4lp51MKAhcxZIMtEfg9HaWsn3Dm/wgwYBinyeywfWbTXYDg==", - "cpu": [ - "arm64" - ], - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@sentry/cli-win32-i686": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.56.1.tgz", - "integrity": "sha512-6u6a060yC3i76Ze1apqgWr5luQSyhuD5ND84eWfh/UbddsEa42UHjoVHOiBwmpZqf/hvNZAtzLnE4NCvU4zOMg==", - "cpu": [ - "x86", - "ia32" - ], - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@sentry/cli-win32-x64": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.56.1.tgz", - "integrity": "sha512-11cdflajBrDWlRZqI9MOu7ok2vnPzFjKmbU3YvBYWQapNE+HHAsWdsRL/u/P1RmU62vj7Y42iSUcj6x1SNrdPw==", - "cpu": [ - "x64" - ], - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@sentry/core": { - "version": "10.20.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.20.0.tgz", - "integrity": "sha512-S291KihnOIB8i7mVJIJBVHBMcCfIoY/KDJBHEfBoHY9M56g2An4FVhM9+/xR85+IoMkTySdXN08k9LEyQz4FpQ==", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@sentry/react": { - "version": "10.20.0", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-10.20.0.tgz", - "integrity": "sha512-8W+gMkMxQhqlGHCW7kjLhcLgBJ/YSHbLhVd36s0GRudxjXh61K8rdCaAXToD8akgZ76DtLbx5PPQ5fLfQCOnpw==", - "license": "MIT", - "dependencies": { - "@sentry/browser": "10.20.0", - "@sentry/core": "10.20.0", - "hoist-non-react-statics": "^3.3.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "react": "^16.14.0 || 17.x || 18.x || 19.x" - } - }, - "node_modules/@sentry/react-native": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@sentry/react-native/-/react-native-7.4.0.tgz", - "integrity": "sha512-dDbFEO4DkDjfGlo+gQ5u1JokMMSglZerAQZbuMJO1cBCt+G/+8GZBFVXSHPk/CZLWiPBxQWP27nHhZ7Y06h5hw==", - "license": "MIT", - "dependencies": { - "@sentry/babel-plugin-component-annotate": "4.4.0", - "@sentry/browser": "10.20.0", - "@sentry/cli": "2.56.1", - "@sentry/core": "10.20.0", - "@sentry/react": "10.20.0", - "@sentry/types": "10.20.0" - }, - "bin": { - "sentry-expo-upload-sourcemaps": "scripts/expo-upload-sourcemaps.js" - }, - "peerDependencies": { - "expo": ">=49.0.0", - "react": ">=17.0.0", - "react-native": ">=0.65.0" - }, - "peerDependenciesMeta": { - "expo": { - "optional": true - } - } - }, - "node_modules/@sentry/types": { - "version": "10.20.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-10.20.0.tgz", - "integrity": "sha512-9pGtoiYBvw0SpHayBlQ6/9F4wP/KwlS8KZg1iBsZSR8h8WjLRGbER/TjKcAdg07HPd0APVajbT2YyL30+9Oi8Q==", - "license": "MIT", - "dependencies": { - "@sentry/core": "10.20.0" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/@shopify/flash-list": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@shopify/flash-list/-/flash-list-2.0.3.tgz", @@ -15682,6 +15376,7 @@ }, "node_modules/agent-base": { "version": "6.0.2", + "dev": true, "license": "MIT", "dependencies": { "debug": "4" @@ -24586,6 +24281,7 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", + "dev": true, "license": "MIT", "dependencies": { "agent-base": "6", @@ -31604,12 +31300,6 @@ "node": ">= 0.10" } }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "license": "MIT" - }, "node_modules/psl": { "version": "1.9.0", "dev": true, diff --git a/package.json b/package.json index 1cc3cc12b12a..6fe95aae6876 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,6 @@ "@react-navigation/stack": "7.3.3", "@react-ng/bounds-observer": "^0.2.1", "@rnmapbox/maps": "10.1.44", - "@sentry/react-native": "^7.0.1", "@shopify/flash-list": "2.0.3", "@ua/react-native-airship": "~24.4.0", "array.prototype.tosorted": "^1.1.4", diff --git a/patches/sentry-react-native/@sentry+react-native+7.4.0.patch b/patches/sentry-react-native/@sentry+react-native+7.4.0.patch deleted file mode 100644 index 0b50294fd9b2..000000000000 --- a/patches/sentry-react-native/@sentry+react-native+7.4.0.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/node_modules/@sentry/react-native/scripts/sentry_utils.rb b/node_modules/@sentry/react-native/scripts/sentry_utils.rb -index 5dc57a3..8887025 100644 ---- a/node_modules/@sentry/react-native/scripts/sentry_utils.rb -+++ b/node_modules/@sentry/react-native/scripts/sentry_utils.rb -@@ -1,8 +1,24 @@ - def parse_rn_package_json() -- rn_path = File.dirname(`node --print "require.resolve('react-native/package.json')"`) -- env_rn_path = ENV['REACT_NATIVE_NODE_MODULES_DIR'] -- if env_rn_path != nil -- rn_path = env_rn_path -+ # Try to resolve from installation root first (similar to react-native-svg and react-native-reanimated) -+ rn_path = nil -+ begin -+ rn_path = File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')" 2>/dev/null`.strip) -+ rescue -+ # node resolution failed, will try ENV fallback -+ end -+ -+ # Fall back to ENV variable if node resolution didn't work -+ if rn_path.nil? || rn_path.empty? -+ env_rn_path = ENV['REACT_NATIVE_NODE_MODULES_DIR'] -+ if env_rn_path != nil -+ # Check if ENV points to node_modules or node_modules/react-native -+ # Support both conventions for compatibility -+ if File.exist?(File.join(env_rn_path, 'package.json')) -+ rn_path = env_rn_path # Already points to react-native directory -+ elsif File.exist?(File.join(env_rn_path, 'react-native/package.json')) -+ rn_path = File.join(env_rn_path, 'react-native') # Points to node_modules -+ end -+ end - end - - rn_package_json_path = File.join(rn_path, 'package.json') diff --git a/patches/sentry-react-native/details.md b/patches/sentry-react-native/details.md deleted file mode 100644 index cf9872b8701e..000000000000 --- a/patches/sentry-react-native/details.md +++ /dev/null @@ -1,9 +0,0 @@ -# `@sentry/react-native` patches - -### [@sentry+react-native+7.4.0.patch](@sentry+react-native+7.4.0.patch) - -- Reason: Fixes React Native path resolution in the Sentry Ruby script during iOS builds. The original implementation failed to locate `react-native/package.json` in our hybrid app setup. The patch changes the resolution strategy to first try resolving from the installation root (similar to react-native-svg and react-native-reanimated), and falls back to ENV variables with support for both node_modules conventions. -- Upstream PR/issue: N/A (specific to our hybrid app environment) -- E/App issue: N/A -- PR Introducing Patch: https://github.com/Expensify/App/pull/70298 - diff --git a/src/App.tsx b/src/App.tsx index 9ed0e2bac6ed..8c5337fbd099 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,4 @@ import {PortalProvider} from '@gorhom/portal'; -import * as Sentry from '@sentry/react-native'; import React from 'react'; import {LogBox, View} from 'react-native'; import {GestureHandlerRootView} from 'react-native-gesture-handler'; @@ -149,6 +148,4 @@ function App() { App.displayName = 'App'; -const WrappedApp = Sentry.wrap(App); -WrappedApp.displayName = 'App'; -export default WrappedApp; +export default App; diff --git a/src/CONFIG.ts b/src/CONFIG.ts index 7870c32cb030..ec5a3a7cff27 100644 --- a/src/CONFIG.ts +++ b/src/CONFIG.ts @@ -142,5 +142,4 @@ export default { IS_TEST_ENV: process.env.NODE_ENV === 'test', // eslint-disable-next-line no-restricted-properties IS_HYBRID_APP: HybridAppModule.isHybridApp(), - SENTRY_DSN: get(Config, 'SENTRY_DSN', 'https://7b463fb4d4402d342d1166d929a62f4e@o4510228013121536.ingest.us.sentry.io/4510228107427840'), } as const; diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index e846170a0257..3271c8be73ab 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -1,5 +1,4 @@ import {findFocusedRoute, useFocusEffect, useIsFocused, useNavigation} from '@react-navigation/native'; -import * as Sentry from '@sentry/react-native'; import React, {useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react'; import type {NativeScrollEvent, NativeSyntheticEvent, StyleProp, ViewStyle} from 'react-native'; import {View} from 'react-native'; @@ -977,6 +976,4 @@ function Search({ Search.displayName = 'Search'; export type {SearchProps}; -const WrappedSearch = Sentry.withProfiler(Search) as typeof Search; -WrappedSearch.displayName = 'Search'; -export default WrappedSearch; +export default Search; diff --git a/src/libs/Authentication.ts b/src/libs/Authentication.ts index 77f19dd6b3ef..aa594ae47a71 100644 --- a/src/libs/Authentication.ts +++ b/src/libs/Authentication.ts @@ -1,4 +1,3 @@ -import * as Sentry from '@sentry/react-native'; import Onyx from 'react-native-onyx'; import type {OnyxEntry} from 'react-native-onyx'; import CONFIG from '@src/CONFIG'; @@ -37,11 +36,6 @@ Onyx.connectWithoutView({ callback: (value) => { isAuthenticatingWithShortLivedToken = !!value?.isAuthenticatingWithShortLivedToken; isSupportAuthTokenUsed = !!value?.isSupportAuthTokenUsed; - - Sentry.setUser({ - id: value?.accountID, - email: value?.email, - }); }, }); diff --git a/src/libs/Navigation/NavigationRoot.tsx b/src/libs/Navigation/NavigationRoot.tsx index 8251044b728d..f25fb2d23695 100644 --- a/src/libs/Navigation/NavigationRoot.tsx +++ b/src/libs/Navigation/NavigationRoot.tsx @@ -1,6 +1,6 @@ import type {NavigationState} from '@react-navigation/native'; import {DarkTheme, DefaultTheme, findFocusedRoute, getPathFromState, NavigationContainer} from '@react-navigation/native'; -import React, {useCallback, useContext, useEffect, useMemo, useRef} from 'react'; +import React, {useContext, useEffect, useMemo, useRef} from 'react'; import {ScrollOffsetContext} from '@components/ScrollOffsetContextProvider'; import useCurrentReportID from '@hooks/useCurrentReportID'; import useOnyx from '@hooks/useOnyx'; @@ -23,7 +23,6 @@ import NAVIGATORS from '@src/NAVIGATORS'; import ONYXKEYS from '@src/ONYXKEYS'; import type {Route} from '@src/ROUTES'; import ROUTES from '@src/ROUTES'; -import {navigationIntegration} from '@src/setup/telemetry'; import AppNavigator from './AppNavigator'; import {cleanPreservedNavigatorStates} from './AppNavigator/createSplitNavigator/usePreserveNavigatorState'; import getAdaptedStateFromPath from './helpers/getAdaptedStateFromPath'; @@ -259,16 +258,11 @@ function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady}: N cleanPreservedNavigatorStates(state); }; - const onReadyWithSentry = useCallback(() => { - onReady(); - navigationIntegration.registerNavigationContainer(navigationRef); - }, [onReady]); - return ( , reports?: OnyxCollection, reportAttributesDerived?: ReportAttributesDerivedValue['reports']) { - const span = Sentry.startInactiveSpan({name: 'createOptionList'}); - const reportMapForAccountIDs: Record = {}; const allReportOptions: Array> = []; @@ -1212,12 +1209,6 @@ function createOptionList(personalDetails: OnyxEntry, repor ), })); - span.setAttributes({ - personalDetails: allPersonalDetailsOptions.length, - reports: allReportOptions.length, - }); - span.end(); - return { reports: allReportOptions, personalDetails: allPersonalDetailsOptions as Array>, diff --git a/src/pages/home/sidebar/SidebarLinksData.tsx b/src/pages/home/sidebar/SidebarLinksData.tsx index b791ab03aec1..d5a54ac919bf 100644 --- a/src/pages/home/sidebar/SidebarLinksData.tsx +++ b/src/pages/home/sidebar/SidebarLinksData.tsx @@ -1,5 +1,4 @@ import {useIsFocused} from '@react-navigation/native'; -import * as Sentry from '@sentry/react-native'; import React, {useCallback, useRef} from 'react'; import {View} from 'react-native'; import type {EdgeInsets} from 'react-native-safe-area-context'; @@ -51,6 +50,4 @@ function SidebarLinksData({insets}: SidebarLinksDataProps) { SidebarLinksData.displayName = 'SidebarLinksData'; -const WrappedSidebarLinksData = Sentry.withProfiler(SidebarLinksData); -WrappedSidebarLinksData.displayName = 'SidebarLinksData'; -export default WrappedSidebarLinksData; +export default SidebarLinksData; diff --git a/src/setup/telemetry/index.native.ts b/src/setup/telemetry/index.native.ts new file mode 100644 index 000000000000..794e3707efa3 --- /dev/null +++ b/src/setup/telemetry/index.native.ts @@ -0,0 +1,15 @@ +import {AppState} from 'react-native'; +import Timing from '@userActions/Timing'; +import CONST from '@src/CONST'; + +export default function () { + Timing.start(CONST.TIMING.SPLASH_SCREEN); + + AppState.addEventListener('change', (state) => { + if (state === 'active') { + return; + } + + Timing.clearData(); + }); +} diff --git a/src/setup/telemetry/index.ts b/src/setup/telemetry/index.ts index 438bf53d41c9..2f43acc04a1b 100644 --- a/src/setup/telemetry/index.ts +++ b/src/setup/telemetry/index.ts @@ -1,24 +1,10 @@ -import * as Sentry from '@sentry/react-native'; -import CONFIG from '@src/CONFIG'; -import pkg from '../../../package.json'; +import Timing from '@userActions/Timing'; +import CONST from '@src/CONST'; -const navigationIntegration = Sentry.reactNavigationIntegration({ - enableTimeToInitialDisplay: true, -}); +export default function () { + Timing.start(CONST.TIMING.SPLASH_SCREEN); -export default function (): void { - Sentry.init({ - dsn: CONFIG.SENTRY_DSN, - tracesSampleRate: 1.0, - profilesSampleRate: 1.0, - enableAutoPerformanceTracing: true, - enableUserInteractionTracing: true, - integrations: [navigationIntegration], - environment: CONFIG.ENVIRONMENT, - release: `${pkg.name}@${pkg.version}`, + document.addEventListener('visibilitychange', () => { + Timing.clearData(); }); - - Sentry.captureMessage('Sentry initialized successfully!'); } - -export {navigationIntegration};