-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
Fix Ensure app start type is set, even when ActivityLifecycleIntegration is not running #4216
base: 7.x.x
Are you sure you want to change the base?
Fix Ensure app start type is set, even when ActivityLifecycleIntegration is not running #4216
Conversation
Performance metrics 🚀
|
@Override | ||
public void onActivityCreated( | ||
@NotNull Activity activity, @Nullable Bundle savedInstanceState) { | ||
if (appStartMetrics.getAppStartType() == AppStartMetrics.AppStartType.UNKNOWN) { |
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.
I would duplicate the logic of the ActivityLifecycleIntegration
That should save us from a lot of headaches.
Or we can move the logic inside the AppStartMetrics
, passing the required uptimeMillis and the Activity Bundle, since it has everything needed to check whether it's a cold or warm start. That way, the code would not even be duplicated, and it would work as expected.
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.
and I'd add a comment on why we do this (react native not passing an Application and initializing the SDK too late)
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.
From my testing, the condition appStartSpan.hasStopped()
from ActivityLifecycleIntegration will never evaluate to true
within this content provider, causing no warm starts to be detected. This content provider runs before any SDK init, so there's no other component able to stop the span.
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.
In the long I would love to see ActivityLifecycleIntegration
being split up into several components:
- One for app-starts
- One for profiling
- One for TTID/TTFD
- One for activity lifecycle after app-start
Fix Ensure app start type is set, even when ActivityLifecycleIntegration is not running or init is deferred.
Fixes getsentry/sentry-react-native#4598