fix(app-start): Fixes cold/warm start spans not attaching if TTFD takes more than 3 seconds to report#3404
Merged
Merged
Conversation
…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.
Contributor
Android Performance metrics 🚀
|
| 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 |
Contributor
iOS Performance metrics 🚀
|
| 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 |
buenaflor
marked this pull request as ready for review
December 16, 2025 14:06
denrase
approved these changes
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 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
sendDefaultPiiis enabled🔮 Next steps