Skip to content

fix(android): Start a warm app start from onActivityPreCreated on API 29+ - #6719

Merged
markushi merged 3 commits into
mainfrom
no/warm-start-on-activity-pre-created
Nov 23, 2026
Merged

markushi merged 3 commits into
mainfrom
no/warm-start-on-activity-pre-created

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

On API 29+, AppStartMetrics now decides the app start type and restarts the warm app start span in onActivityPreCreated. Below API 29, where that callback doesn't exist, it keeps doing this in onActivityCreated.

💡 Motivation and Context

ActivityLifecycleIntegration already starts the activity.load span in onActivityPreCreated. A warm app.start transaction anchored at onActivityCreated therefore started after its own first child. This was raised in review of #6687.

  • resolves: JAVA-850

💚 How did you test it?

Unit tests.

📝 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

🤖 Generated with Claude Code

runningcode and others added 2 commits November 20, 2026 17:12
… 29+

The activity.load span starts in onActivityPreCreated, so a warm
app.start transaction anchored at onActivityCreated started after its
own first child. On API 29+ the first-activity logic now runs in
onActivityPreCreated; older versions keep onActivityCreated, since
pre-created callbacks don't exist there.

Fixes JAVA-850

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 20, 2026

Copy link
Copy Markdown

JAVA-850

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

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 9b4ff5a.

Main concerns: public contract, reach, host performance.

Rules that block low also fired:

  • R4: a public API record changed: sentry-android-core/api/sentry-android-core.api

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

@sentry

sentry Bot commented Nov 20, 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
runningcode marked this pull request as ready for review November 20, 2026 16:40
@runningcode
runningcode requested review from a team and adinauer as code owners November 20, 2026 16:40
@runningcode
runningcode requested review from 0xadam-brown and romtsn and removed request for a team November 20, 2026 16:40
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 20, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 33c9028. Configure here.

@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.

I'd fix the bugbot finding, but LGTM otherwise, pre-approving!

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 23, 2026
@markushi
markushi merged commit 47d20c2 into main Nov 23, 2026
49 checks passed
@markushi
markushi deleted the no/warm-start-on-activity-pre-created branch November 23, 2026 13:11
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.

3 participants