Skip to content

fix(app-start): Fixes cold/warm start spans not attaching if TTFD takes more than 3 seconds to report#3404

Merged
buenaflor merged 6 commits into
mainfrom
fix/app-start-spns
Dec 17, 2025
Merged

fix(app-start): Fixes cold/warm start spans not attaching if TTFD takes more than 3 seconds to report#3404
buenaflor merged 6 commits into
mainfrom
fix/app-start-spns

Conversation

@buenaflor

@buenaflor buenaflor commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

📜 Description

Fixes cold/warm start spans not attaching if TTFD takes more than 3 seconds to report

💡 Motivation and Context

Fixes #3402

💚 How did you test it?

Unit test, manually

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

…D tracking completes

This update modifies the NativeAppStartHandler to attach app start spans prior to the completion of time-to-full-display (TTFD) tracking. A regression test has been added to verify that app start spans are present when TTFD tracking is enabled, addressing a previous issue where spans could be missing if reportFullyDisplayed() was called after autoFinishAfter.
…p start spans

This commit enhances the test for app start spans by ensuring they are attached before time-to-full-display (TTFD) tracking starts. A new spy wrapper is introduced to capture transaction state during tracking, improving test reliability and clarity. The test now verifies that the 'Cold Start' span is present when track() is called, addressing potential race conditions in span attachment.
@github-actions

github-actions Bot commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 361.35 ms 359.69 ms -1.66 ms
Size 13.93 MiB 15.18 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0fb45d0 482.79 ms 554.02 ms 71.23 ms
765aa8b 493.51 ms 531.23 ms 37.72 ms
c26ed0a 465.52 ms 476.38 ms 10.86 ms
c8596a6 474.00 ms 492.96 ms 18.96 ms
2cb90b9 479.38 ms 552.69 ms 73.31 ms
cdf371b 367.64 ms 377.02 ms 9.38 ms
e04b24b 504.72 ms 516.43 ms 11.71 ms
bfabaf2 408.04 ms 444.38 ms 36.34 ms
d3fb366 391.49 ms 385.85 ms -5.64 ms
cf443d2 464.64 ms 479.04 ms 14.40 ms

App size

Revision Plain With Sentry Diff
0fb45d0 6.54 MiB 7.70 MiB 1.17 MiB
765aa8b 6.54 MiB 7.70 MiB 1.16 MiB
c26ed0a 13.93 MiB 14.93 MiB 1.00 MiB
c8596a6 6.54 MiB 7.53 MiB 1015.27 KiB
2cb90b9 6.54 MiB 7.70 MiB 1.17 MiB
cdf371b 13.93 MiB 15.18 MiB 1.25 MiB
e04b24b 13.93 MiB 15.00 MiB 1.06 MiB
bfabaf2 13.93 MiB 15.06 MiB 1.13 MiB
d3fb366 13.93 MiB 15.06 MiB 1.13 MiB
cf443d2 13.93 MiB 15.00 MiB 1.06 MiB

Previous results on branch: fix/app-start-spns

Startup times

Revision Plain With Sentry Diff
871a3df 355.72 ms 350.13 ms -5.59 ms
73929fc 360.85 ms 389.96 ms 29.10 ms

App size

Revision Plain With Sentry Diff
871a3df 13.93 MiB 15.18 MiB 1.25 MiB
73929fc 13.93 MiB 15.18 MiB 1.25 MiB

@github-actions

github-actions Bot commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1264.48 ms 1266.53 ms 2.05 ms
Size 5.53 MiB 5.96 MiB 444.84 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6e7d494 1261.37 ms 1265.35 ms 3.99 ms
6bcdc99 1257.16 ms 1264.96 ms 7.79 ms
8825ed8 1243.35 ms 1240.39 ms -2.96 ms
e5b87f8 1257.94 ms 1261.90 ms 3.96 ms
af96ef2 1260.79 ms 1259.61 ms -1.17 ms
1f639ee 1252.43 ms 1257.82 ms 5.38 ms
765aa8b 1259.09 ms 1269.90 ms 10.82 ms
819c1e7 1250.59 ms 1249.08 ms -1.51 ms
e0c8591 1259.85 ms 1257.31 ms -2.54 ms
4298701 1243.56 ms 1262.29 ms 18.72 ms

App size

Revision Plain With Sentry Diff
6e7d494 5.53 MiB 6.01 MiB 488.14 KiB
6bcdc99 5.53 MiB 6.00 MiB 479.95 KiB
8825ed8 5.53 MiB 5.97 MiB 453.71 KiB
e5b87f8 5.53 MiB 6.02 MiB 502.11 KiB
af96ef2 5.53 MiB 6.02 MiB 501.31 KiB
1f639ee 5.53 MiB 6.00 MiB 479.95 KiB
765aa8b 7.86 MiB 9.44 MiB 1.58 MiB
819c1e7 5.53 MiB 6.00 MiB 479.96 KiB
e0c8591 5.53 MiB 5.96 MiB 444.86 KiB
4298701 20.70 MiB 22.46 MiB 1.76 MiB

Previous results on branch: fix/app-start-spns

Startup times

Revision Plain With Sentry Diff
871a3df 1269.75 ms 1253.24 ms -16.51 ms
73929fc 1256.91 ms 1254.87 ms -2.04 ms

App size

Revision Plain With Sentry Diff
871a3df 5.53 MiB 5.96 MiB 444.81 KiB
73929fc 5.53 MiB 5.96 MiB 444.82 KiB

@buenaflor
buenaflor marked this pull request as ready for review December 16, 2025 14:06
@buenaflor
buenaflor requested a review from denrase as a code owner December 16, 2025 14:06
@buenaflor
buenaflor merged commit cba2765 into main Dec 17, 2025
60 checks passed
@buenaflor
buenaflor deleted the fix/app-start-spns branch December 17, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native app start spans missing when TTFD tracking takes longer than 3 seconds

2 participants