sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Warm starts potentially reported as cold starts for activities in singleTask launch mode

Open idosun opened this issue 1 month ago • 1 comments

Integration

sentry-android

Build System

Gradle

AGP Version

5.10.0

Proguard

Enabled

Version

8.17.0

Steps to Reproduce

The Sentry SDK is capturing an unreasonably low number of warm starts, and the start duration consistently shows cold < warm.

This happens for a specific Activity in my app that is configured with android:launchMode="singleTask".

I suspect that the SDK is misclassifying app startup types in AppStartMetrics.java → onActivityCreated() (https://github.com/getsentry/sentry-java/blob/23b6ef97e8f491b9bf73bde3b73453030fc3d973/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java#L364) as the singleTask launch mode would always create Activity instances with savedInstanceState = null, causing all app launches to be classified as cold starts.

Expected Result

warm start < cold start

Actual Result

warm start > cold start

idosun avatar Nov 20 '25 03:11 idosun

JAVA-249

linear[bot] avatar Nov 20 '25 03:11 linear[bot]