Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Cold/Warm Start not correct with react-native-navigation #3479

Closed
5 tasks
moonjava2005 opened this issue Dec 17, 2023 · 9 comments
Closed
5 tasks

App Cold/Warm Start not correct with react-native-navigation #3479

moonjava2005 opened this issue Dec 17, 2023 · 9 comments

Comments

@moonjava2005
Copy link

moonjava2005 commented Dec 17, 2023

OS:

  • Windows
  • [ X] MacOS
  • Linux

Platform:

  • [ X] iOS
  • [ X] Android

SDK:

  • [X ] @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 5.11.1

react-native version: 0.72.6

Are you using Expo?

  • Yes
  • [X ] No

Are you using sentry.io or on-premise?

  • [X ] sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

(@sentry/react-native)

Sentry.init({
      dsn:'https://[email protected]/XXXXX512',
      release:'com.a.b',
      dist:'0.1.1',
      environment: 'debug',
      integrations: [
        new Sentry.ReactNativeTracing({
          routingInstrumentation:
            new Sentry.ReactNativeNavigationInstrumentation(Navigation),
        }),
      ],
    })

or

(react-native-sentry)

Sentry.config(
  'https://[email protected]/...'
  // other options
 ).install();

I have the following issue:
The App Cold/Warm start time is incorrect with "react-native-navigation": "7.37.2"
I try to naming the isolated environment name debug in order to tracing from may real phone only. I found that:

  • The app open on my real phone is around 2-3 seconds (slowest is around 5 seconds) to see the first content of screen
  • However, after a while, I check transaction on Sentry, the Start Cold/Warm time up to 59 seconds (a big big value)

Actual result:

[Actual result]
Screenshot 2023-12-17 at 17 02 09
Screenshot 2023-12-17 at 17 03 23

Expected result:

[Expected result]
I expected the value should be exact the time of app start

@kahest
Copy link
Member

kahest commented Dec 19, 2023

Hey @moonjava2005 thanks for the report, we'll look into this. Please be aware that due to vacations and incoming holidays we might be slower to respond than usual.

@krystofwoldrich
Copy link
Member

Hi @moonjava2005,
were you able to reproduce this on a simulator or only on a device? Was the device Android or iOS?

Can you share a minimal reproducible example? If not, please describe your navigation setup. I've tried simple stack navigation with [email protected] and the start times were correct.

@moonjava2005
Copy link
Author

Hi @moonjava2005, were you able to reproduce this on a simulator or only on a device? Was the device Android or iOS?

Can you share a minimal reproducible example? If not, please describe your navigation setup. I've tried simple stack navigation with [email protected] and the start times were correct.

Hi @krystofwoldrich
You could try with setRoot as 5 tabs, each tab has a stack
I have to "hack" this incorrect statistic by trying to ignore "App Start" event. Then, everything is working well with all simulator and real devices

@krystofwoldrich
Copy link
Member

@moonjava2005 Thank will try!

What do you mean by "hack"? Ignore the "App Start" in the SDK or the Sentry Product.

@moonjava2005
Copy link
Author

moonjava2005 commented Jan 10, 2024

@moonjava2005 Thank will try!

What do you mean by "hack"? Ignore the "App Start" in the SDK or the Sentry Product.

I hacked by setting startTime is 0
I guess the issue is:

  • When the app has just started, Sentry create the transaction in hub (I call this is Start transaction)
  • While app starting, and the first JSX is mounting, there're other transaction (like network,...), in this case, these actions will be added as the span of the start transaction
  • Then, JSX start rendering the first frame, but, there're other spans (inside the start transaction) have not finished yet. Therefore, start transaction will be prolong. As the result, the start transaction will be finish after all other spans finish. This cause the start time transaction is not correct
    I guess the scenario like this while I was taking a glimpse on the source code
    You can test by make some mock API call with slow response. These requests should be called at index.js and before mounting the first JSX. Then, you can see the result

@krystofwoldrich
Copy link
Member

@moonjava2005 Thank you for the details.

@krystofwoldrich
Copy link
Member

Let's create a new RN application with react-native-navigation and Sentry RN SDK and check the app start measurements and spans which are reported.

Let's test this on simulator and real device.

@lucas-zimerman
Copy link
Collaborator

Hi @moonjava2005, I have tried to reproduce this issue on both physical and simulated devices (Android and iOS), but so far, I haven't noticed any issues on a new React Native application using native navigation.

Could you try checking if the issue still occurs when you use the latest Sentry React Native SDK? If the problem persists, could you share the application start up log with debug set to true in the Sentry options?

@krystofwoldrich
Copy link
Member

Since we can't reproduce the issue I'm closing this. In case there is a new context or reproducible example, please, comment here and we can reopen it.

@krystofwoldrich krystofwoldrich closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Archived in project
Development

No branches or pull requests

5 participants