Skip to content

fix(android): Time a warm relaunch within 1 minute from its own activity - #6687

Merged
runningcode merged 2 commits into
mainfrom
no/fix-warm-relaunch-app-start-anchor
Nov 20, 2026
Merged

runningcode merged 2 commits into
mainfrom
no/fix-warm-relaunch-app-start-anchor

Conversation

@runningcode

@runningcode runningcode commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Here's the bug: You start the app, click home then relaunch the app with "Don't keep activities" on.
The second launch is a warm start since the activity was killed but not the process.
The problem is that it uses the process start time instead of a new anchor. This means the warm start is super long (since the process was started) instead of when the activity was launched. This affects TTID and TTFD metrics that include warm starts.

💡 Motivation and Context

Apparently this existed since #4999 (8.32.0), onActivityDestroyed marks the next launch as warm but leaves the process-start anchor in place, and onActivityCreated resets it only after 1 minute. So a relaunch within 60s was timed from process start:

  • refs: JAVA-503

💚 How did you test it?

My clanker easily reproduced this on an emulator:

  • Sample app on an API 37 emulator: cold launch, then HOME with "Don't keep activities" on (the process stays alive), then relaunch about 15s later. Android reported the relaunch at about 280ms.
Relaunch Before After
Standalone App Start app_start_warm 1684ms, same start time as the cold one 248ms
Standalone ui.load TTID 16,106ms 248ms
Non-standalone app_start_warm 16,577ms, with TTID and TTFD the same 223ms

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Make standalone app start tracing the default on 9.x.x (JAVA-503).

🤖 Generated with Claude Code

@runningcode
runningcode requested review from a team and adinauer as code owners November 19, 2026 16:59
@runningcode
runningcode requested review from markushi and romtsn and removed request for a team November 19, 2026 16:59
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

JAVA-503

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 65fd006.

Main concerns: data sent to Sentry, reach, host performance.

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.0 (1) release

⚙️ sentry-android Build Distribution Settings

runningcode and others added 2 commits November 19, 2026 19:26
Since #4999, destroying the last activity marks the next launch as warm
but keeps the process-start anchor unless the process is older than a
minute. A quick relaunch was therefore timed from process start:
standalone mode re-sent the cold interval as a second warm App Start, and
the relaunched screen's TTID spanned the whole session.

Refs JAVA-503

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/fix-warm-relaunch-app-start-anchor branch from f2d06bb to 65fd006 Compare November 19, 2026 18:26
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 19, 2026

@romtsn romtsn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, but can be done in a follow-up, unblocking

@runningcode
runningcode enabled auto-merge (squash) November 20, 2026 15:58
@runningcode
runningcode merged commit c503bd6 into main Nov 20, 2026
55 checks passed
@runningcode
runningcode deleted the no/fix-warm-relaunch-app-start-anchor branch November 20, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants