Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork354
feat(expo): Add RNSentrySDK APIs support to @sentry/react-native/expo plugin#4633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:capture-app-start-errors-v7
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
github-actionsbot commentedMar 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
github-actionsbot commentedMar 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
iOS (legacy) Performance metrics 🚀
|
github-actionsbot commentedMar 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
iOS (new) Performance metrics 🚀
|
github-actionsbot commentedMar 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Android (legacy) Performance metrics 🚀
|
github-actionsbot commentedMar 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Android (new) Performance metrics 🚀
|
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
lucas-zimerman left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Overall the PR looks good and thank you for the tests!
I still think we could fine tune a bit more the android part and after it we could get ready for merge
Co-authored-by: LucasZF <lucas-zimerman1@hotmail.com>
antonis commentedApr 4, 2025
Note: TheBuild & Test / Type Check Typescript 3.8 (pull_request) failure should be fixed when we merge#4673 from |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
krystofwoldrich commentedJun 11, 2025
I'm currently updating the base branch with the latest main since there was quite a lot of development that was not synced to the feature branch. |
antonis commentedJun 11, 2025
Thank you for the heads up@krystofwoldrich 🙇 |
Co-authored-by: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com>
…getsentry/sentry-react-native into antonis/4625-expo-useNativeInit
2363742 to588ba6dCompare
krystofwoldrich left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you for the fixes. 🚀 It looks great!
| ###Features | ||
| - Add RNSentrySDK APIs support to@sentry/react-native/expo plugin ([#4633](https://github.com/getsentry/sentry-react-native/pull/4633)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nit. It would be nice to include an example code snippet and a small summary of what will the flag do.
Co-authored-by: Antonis Lilis <antonis.lilis@gmail.com>
lucas-zimerman commentedOct 15, 2025
@sentry review |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
lucas-zimerman commentedDec 11, 2025
@antonis should we restart this PR? |
antonis commentedDec 11, 2025
I don't expect this to have major conflicts with main/v7. |
- Resolved conflicts by separating imports from logger and version modules- Preserved useNativeInit functionality from PR#4633- Fixed optional chain expressions in withSentryAndroid and withSentryIOS- Updated test mocks to use logger instead of utils
Uh oh!
There was an error while loading.Please reload this page.
| } | ||
| exportfunctionmodifyAppDelegate(config:ExpoConfig):ExpoConfig{ | ||
| returnwithAppDelegate(config,asyncconfig=>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Bug: ThemodifyAppDelegate function incorrectly returns aPromise<ExpoConfig> instead ofExpoConfig due to anasync callback, breaking the synchronous call chain for iOS native initialization.
Severity: HIGH | Confidence: High
🔍Detailed Analysis
ThemodifyAppDelegate function is declared to return anExpoConfig but it uses anasync callback withwithAppDelegate, which causes the function to actually return aPromise<ExpoConfig>. The return value, stored inappDelegateCfc, is then used as if it were a synchronousExpoConfig object and passed towithDangerousMod. This occurs whenuseNativeInit is true. Passing a promise instead of the expected configuration object towithDangerousMod will cause the Sentry iOS native initialization to fail.
💡Suggested Fix
Remove theasync keyword from the callback passed towithAppDelegate inside themodifyAppDelegate function. This will make the function returnExpoConfig synchronously, matching its type signature and the Android implementation.
🤖Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AIagent.Verify if this is a real issue. If it is, propose a fix; if not, explain why it's notvalid.Location: packages/core/plugin/src/withSentryIOS.ts#L90Potential issue: The `modifyAppDelegate` function is declared to return an `ExpoConfig`but it uses an `async` callback with `withAppDelegate`, which causes the function toactually return a `Promise<ExpoConfig>`. The return value, stored in `appDelegateCfc`,is then used as if it were a synchronous `ExpoConfig` object and passed to`withDangerousMod`. This occurs when `useNativeInit` is true. Passing a promise insteadof the expected configuration object to `withDangerousMod` will cause the Sentry iOSnative initialization to fail.Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID:7592441
Uh oh!
There was an error while loading.Please reload this page.
📢 Type of change
Based onfeat: Capture app start errors before JSBased on#5470
📜 Description
Adds RNSentrySDK APIs support to @sentry/react-native/expo plugin by importing sentry and adding injecting
RNSentrySDK.init/startin the Android MainApplication (Kotlin or Java) or AppDelegate (Objective-C or Swift).This feature is opt-out to enable it set
useNativeInittotruein your@sentry/react-native/expoplugin configuration.💡 Motivation and Context
Fixes#4625
💚 How did you test it?
CI, Manual
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps
#skip-changelog