-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionDailyKSv2KSv2ImprovementItem broken or needs improvement.Item broken or needs improvement.Task
Description
Problem
We are currently on @sentry/react-native v7.6.0. Several issues motivate upgrading to v8:
- Android profiling crashes (#75036): Profiling on Android is disabled (
profilesSampleRate: 0) because it causes SIGABRT crashes in thehermes-samplingthread due to invalid pthread access. The Sentry team confirmed they are addressing these threading issues in newer SDK versions. Testing on v8 suggests the crash may be resolved. - Native initialization support (#82974): v8 introduces first-class support for initializing Sentry from native code (via
RNSentrySDK.init()on Android and[RNSentrySDK start]on iOS) and asentry.options.jsonconfig file. This enables capturing app start errors and crashes that occur before JS loads. PR #82858 already merged native Sentry initialization, and the v8 SDK provides cleaner APIs for this pattern. - Updated native SDKs: v8 brings Cocoa SDK v9 (from v8.57.2), Sentry CLI v3 (from v2.58.0), and Android Gradle Plugin v6 (from v5.12.2), which include performance improvements, bug fixes, and better profiling stability.
- Maintenance burden of patches: We maintain 4 patches against
@sentry/core10.24.0,@sentry/browser10.24.0, and@sentry/react-native7.6.0. These must be ported to the new versions. PR #84044 already includes these updated patches.
Solution
Upgrade @sentry/react-native from ^7.6.0 to 8.2.0 (or latest 8.x). This involves:
- Bump the dependency in
package.jsonfrom^7.6.0to8.2.0 - Update native dependencies:
- iOS: Cocoa SDK
Sentry/HybridSDK 8.57.2toSentry 9.5.1, regeneratePodfile.lock - Android:
io.sentry:sentry-android-gradle-pluginfrom5.12.2to6.0.0inMobile-Expensify/Android/build.gradle
- iOS: Cocoa SDK
- Port existing patches to new package versions:
@sentry+core+10.24.0+001+data-sentry-label-support.patch→@sentry+core+10.39.0+...@sentry+core+10.24.0+002+request-id-support.patch→@sentry+core+10.39.0+...@sentry+browser+10.24.0+001+request-id-support.patch→@sentry+browser+10.39.0+...(note: v8 splits browser builds intodev/andprod/subdirectories, so the patch needs updating)@sentry+react-native+7.6.0.patch→@sentry+react-native+8.2.0.patch
- Verify minimum platform requirements are met:
- iOS 15.0+ deployment target (previously 11.0+)
- Xcode 16.4+
- Kotlin 1.8+, Android Gradle Plugin 7.4.0+
- Re-test Android profiling to verify the
hermes-samplingSIGABRT crash is resolved; if so, re-enable profiling (profilesSampleRate> 0 on Android insetupSentry.ts) - HybridApp compatibility: Verify no regressions in HybridApp builds (the PR was flagged for native code changes)
Breaking changes to verify (from migration guide)
- iOS minimum raised to 15.0+ (our current minimum should already meet this)
- Sentry CLI upgraded to v3 (impacts source map upload scripts in CI)
hoist-non-react-staticsremoved from@sentry/react(unlikely to affect us, but verify)- Android Gradle Plugin 6.0.0 may require build.gradle adjustments
Related
- Blocks: #75036 (re-enable Android profiling)
- Related: #82974 (native Sentry initialization)
- PR: #84044 (WIP implementation by @elirangoshen)
Notes
- PR #84044 by @elirangoshen already implements the upgrade and is in review (requested by @roryabraham and @abdulrahuman5196)
- The
@sentry/webpack-plugin(v4.6.0, devDependency) does not need updating as part of this change - Sentry CLI v3 has a different license (
FSL-1.1-MITvsBSD-3-Clause) -- worth noting but should not block adoption
Issue Owner
Current Issue Owner: @mallenexpensifyReactions are currently unavailable
Metadata
Metadata
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionDailyKSv2KSv2ImprovementItem broken or needs improvement.Item broken or needs improvement.Task