getsentry / getsentry/sentry-java

Incorrect app start transaction duration when app goes in sleep

未关闭
#5,752 1 条评论 0 个 reaction 已指派 1 人 已被 @runningcode 认领 在 GitHub 查看
Android Bug Platform: Android Platform: Java
主要语言
Kotlin
星标
1.4k
派生
478
平均合并
2 天 22 小时
30 天内合并 PR
69

描述

As reported by a customer we're seeing the following behavior:

1. App is launched
2. A cold start is detected and an `ui.load` transaction is created (`app.start.cold` + `ttid`)
3. The app is backgrounded before the first frame draws (and the activity only progresses through the `onCreate` + `onStart` phases, no `onDestroy`) — so TTID never happens, and no lifecycle cleanup on our side runs.
4. The device enters Doze, which freezes our deadline timer so it doesn't fire at +30s.
5. Hours later the device wakes up, the deadline finally fires when the app is resumed, and our `forceFinish` stamps the spans with the current time.
6. The resulting transactions spans over multiple hours.

I would argue that we should drop any foreground launches which have a doze in-between, as it just skews the real "user perceived" launches.

On the other hand, a real user was probably waiting for a few seconds for the app to come alive, but it didn't, so the user bailed.

Related issue: getsentry/sentry-java#5530

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。