Skip to content

fix(tracing): Keep launch-screen TTID/TTFD anchored to navigation on delayed first navigation - #6626

Merged
antonis merged 6 commits into
mainfrom
fix/launch-screen-ttid-delayed-navigation
Sep 2, 2026
Merged

fix(tracing): Keep launch-screen TTID/TTFD anchored to navigation on delayed first navigation#6626
antonis merged 6 commits into
mainfrom
fix/launch-screen-ttid-delayed-navigation

Conversation

@antonis

@antonis antonis commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

On non-standalone app start tracking, attaching app start to the first navigation transaction rewrites its start_timestamp to process init and re-anchors the TTID/TTFD spans to it; timeToDisplay (which runs after) then derives time_to_initial_display/time_to_full_display from that rewritten start.

On a delayed first navigation — a splash / auth / loading screen held for several seconds — this makes TTID/TTFD span the uninstrumented app-ready → navigation gap instead of the screen render, inflating them by an order of magnitude (e.g. ~0.9s → ~23s in #6618; the 30s cap from #6210 flattens the overflow into a plateau).

This adds a gap check: when first navigation start − app start end > 5s, the SDK still reports the app_start_cold/app_start_warm measurement but leaves start_timestamp (and therefore TTID/TTFD) at the navigation start, so they measure the real render. Prompt cold-start displays (gap ≤ 5s) are unchanged. Scoped to non-standalone, non-__DEV__, and runs after the existing age/duration guards.

The 5s cutoff is a heuristic; a root-cause fix would use a native initial-display signal instead of elapsed time (see Next steps).

💡 Motivation and Context

React Native decouples JS navigation from native app start, so the first navigation transaction can fire arbitrarily late. The TTID/TTFD spec anchors first-screen TTID to app start with no gap guard, because on native the first Activity is the app start — they can't be seconds apart. On RN they can, producing a gap the spec never contemplated.

Fixes #6618

💚 How did you test it?

  • New unit tests in appStart.test.ts: delayed nav keeps start_timestamp at the navigation start and adds no Cold Start/Warm Start span while still reporting app_start_cold/warm; prompt nav (< 5s) keeps the existing app-start-anchored behavior; dev build skips the branch.
  • appStart.test.ts (94 passing, incl. snapshots) and timeToDisplayIntegration.test.ts pass; yarn build, TS/JS lint, circular-dep check, and api-report:check all clean (no public API change).
  • Manual testing

📝 Checklist

  • 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.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

@antonis
antonis force-pushed the fix/launch-screen-ttid-delayed-navigation branch from d0eaaeb to 6efdac3 Compare August 27, 2026 13:20
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(tracing): Keep launch-screen TTID/TTFD anchored to navigation on delayed first navigation by antonis in #6626
  • chore: Extend agents.toml and .agents/skills (Extend Warden setup #6637) by antonis in #6643
  • chore(sample): Bump React Native sample to 0.87.0 by antonis in #6617
  • fix(core): Resolve Metro from project root for source map generation by antonis in #6625
  • docs(sdk-versions): Add 8.14.3 row to SDK-VERSIONS.md by antonis in #6649
  • chore(deps): update Maestro to v2.10.0 by github-actions in #6641
  • chore(deps): update JavaScript SDK to v10.73.0 by github-actions in #6642
  • test(ios): Speed up sentry-xcode-scripts tests by antonis in #6633
  • fix: Update recommended vscode extensions by antonis in #6640
  • chore(deps): bump actions/setup-java from 5.7.0 to 6.0.0 by dependabot in #6636
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6635
  • chore(deps): update JavaScript SDK to v10.72.0 by github-actions in #6634
  • chore(e2e): Bump E2E tests to React Native 0.87.0 by antonis in #6616
  • chore(deps): update CLI to v3.7.0 by github-actions in #6632
  • feat(tracing): Copy app start vitals onto standalone children by buenaflor in #6631
  • chore(deps): update Cocoa SDK to v9.26.1 by github-actions in #6623
  • fix(ios): Force-load the Sentry static archive to keep ObjC category methods by antonis in #6615
  • feat(core): Forward feature flag evaluations to the native SDKs by antonis in #6613
  • chore(deps): update Android SDK to v8.54.0 by github-actions in #6624
  • chore(deps): update Sentry Android Gradle Plugin to v6.20.0 by github-actions in #6627

🤖 This preview updates automatically when you update the PR.

…delayed first navigation

For non-standalone app start tracking, attaching app start to the first
navigation transaction re-anchored its start_timestamp to process init, which
made auto time_to_initial_display/time_to_full_display absorb the
uninstrumented gap before a delayed first navigation (splash / auth / loading).
The later 30s TTID/TTFD cap then right-censored this into a large plateau.

When the gap between app start end and the first navigation start exceeds 5s,
report the app_start_cold/app_start_warm measurement but leave the screen
TTID/TTFD anchored to the navigation start, so they measure the actual screen
render. Genuine cold-start displays (first navigation follows app start
promptly) keep the existing app-start-anchored behavior unchanged.

Fixes #6618

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antonis
antonis force-pushed the fix/launch-screen-ttid-delayed-navigation branch from 6efdac3 to d94d843 Compare August 27, 2026 13:24

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d94d843. Configure here.

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Aug 27, 2026
@sentry

sentry Bot commented Aug 27, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.24.0 (104) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3835.44 ms 1223.17 ms -2612.27 ms
Size 5.08 MiB 6.80 MiB 1.72 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ecf47a2+dirty 3835.20 ms 1222.43 ms -2612.77 ms
3817909+dirty 1183.90 ms 1187.50 ms 3.60 ms
5ee78d6+dirty 3847.52 ms 1224.27 ms -2623.25 ms
890d145+dirty 1223.59 ms 1231.37 ms 7.78 ms
e763471+dirty 3841.16 ms 1218.06 ms -2623.09 ms
3d31fcf+dirty 3838.09 ms 1223.46 ms -2614.63 ms
9210ae6+dirty 3815.93 ms 1214.14 ms -2601.79 ms
26843eb+dirty 3861.60 ms 1238.77 ms -2622.82 ms
7a89652+dirty 3861.46 ms 1229.61 ms -2631.85 ms
9ad4522+dirty 3850.40 ms 1222.40 ms -2628.00 ms

App size

Revision Plain With Sentry Diff
ecf47a2+dirty 4.98 MiB 6.46 MiB 1.49 MiB
3817909+dirty 3.38 MiB 4.73 MiB 1.35 MiB
5ee78d6+dirty 5.15 MiB 6.69 MiB 1.53 MiB
890d145+dirty 3.38 MiB 4.77 MiB 1.38 MiB
e763471+dirty 4.98 MiB 6.51 MiB 1.53 MiB
3d31fcf+dirty 4.98 MiB 6.56 MiB 1.58 MiB
9210ae6+dirty 5.15 MiB 6.68 MiB 1.53 MiB
26843eb+dirty 4.98 MiB 6.53 MiB 1.55 MiB
7a89652+dirty 5.15 MiB 6.70 MiB 1.55 MiB
9ad4522+dirty 4.98 MiB 6.56 MiB 1.58 MiB

Previous results on branch: fix/launch-screen-ttid-delayed-navigation

Startup times

Revision Plain With Sentry Diff
23b101e+dirty 3830.98 ms 1209.45 ms -2621.53 ms
aa36375+dirty 3840.60 ms 1223.73 ms -2616.87 ms

App size

Revision Plain With Sentry Diff
23b101e+dirty 5.08 MiB 6.80 MiB 1.72 MiB
aa36375+dirty 5.08 MiB 6.72 MiB 1.64 MiB

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 454.04 ms 490.22 ms 36.18 ms
Size 49.74 MiB 55.66 MiB 5.91 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
15d4514+dirty 413.63 ms 449.62 ms 35.99 ms
26843eb+dirty 442.02 ms 506.29 ms 64.27 ms
ca9d079+dirty 460.67 ms 512.54 ms 51.87 ms
f9c1ed4+dirty 520.57 ms 594.84 ms 74.27 ms
a0d8cf8+dirty 533.71 ms 564.25 ms 30.54 ms
20fbd51+dirty 594.38 ms 655.35 ms 60.97 ms
0b0f006+dirty 446.31 ms 458.31 ms 12.00 ms
1d3572b+dirty 444.48 ms 478.42 ms 33.94 ms
4953e94+dirty 398.80 ms 431.81 ms 33.01 ms
4e0b819+dirty 599.31 ms 654.31 ms 55.00 ms

App size

Revision Plain With Sentry Diff
15d4514+dirty 48.30 MiB 53.60 MiB 5.30 MiB
26843eb+dirty 49.74 MiB 55.26 MiB 5.52 MiB
ca9d079+dirty 48.30 MiB 53.58 MiB 5.28 MiB
f9c1ed4+dirty 49.74 MiB 54.86 MiB 5.12 MiB
a0d8cf8+dirty 48.30 MiB 53.49 MiB 5.19 MiB
20fbd51+dirty 49.74 MiB 54.81 MiB 5.07 MiB
0b0f006+dirty 49.74 MiB 55.66 MiB 5.91 MiB
1d3572b+dirty 49.74 MiB 55.38 MiB 5.63 MiB
4953e94+dirty 43.94 MiB 48.94 MiB 5.00 MiB
4e0b819+dirty 49.74 MiB 54.81 MiB 5.07 MiB

Previous results on branch: fix/launch-screen-ttid-delayed-navigation

Startup times

Revision Plain With Sentry Diff
23b101e+dirty 654.79 ms 700.42 ms 45.63 ms
aa36375+dirty 422.38 ms 446.45 ms 24.07 ms

App size

Revision Plain With Sentry Diff
23b101e+dirty 49.74 MiB 55.66 MiB 5.91 MiB
aa36375+dirty 49.74 MiB 55.45 MiB 5.71 MiB

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3849.50 ms 1217.70 ms -2631.80 ms
Size 5.08 MiB 6.80 MiB 1.72 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3b6e9f9+dirty 3822.77 ms 1208.00 ms -2614.77 ms
5a23c47+dirty 3843.54 ms 1226.05 ms -2617.50 ms
100ce80+dirty 3843.57 ms 1226.46 ms -2617.12 ms
0bd8916+dirty 3816.17 ms 1215.05 ms -2601.12 ms
a0d8cf8+dirty 3826.15 ms 1213.12 ms -2613.03 ms
0a9e622+dirty 3825.35 ms 1219.04 ms -2606.31 ms
21a1e70+dirty 3826.22 ms 1217.74 ms -2608.47 ms
9ad4522+dirty 3862.28 ms 1226.27 ms -2636.01 ms
88735e9+dirty 3837.80 ms 1216.39 ms -2621.41 ms
d0e3b3e+dirty 3846.64 ms 1226.27 ms -2620.38 ms

App size

Revision Plain With Sentry Diff
3b6e9f9+dirty 5.15 MiB 6.68 MiB 1.53 MiB
5a23c47+dirty 4.98 MiB 6.46 MiB 1.49 MiB
100ce80+dirty 5.15 MiB 6.67 MiB 1.51 MiB
0bd8916+dirty 5.15 MiB 6.69 MiB 1.53 MiB
a0d8cf8+dirty 5.15 MiB 6.67 MiB 1.51 MiB
0a9e622+dirty 4.98 MiB 6.51 MiB 1.53 MiB
21a1e70+dirty 4.98 MiB 6.46 MiB 1.49 MiB
9ad4522+dirty 4.98 MiB 6.56 MiB 1.58 MiB
88735e9+dirty 4.98 MiB 6.46 MiB 1.49 MiB
d0e3b3e+dirty 4.98 MiB 6.51 MiB 1.53 MiB

Previous results on branch: fix/launch-screen-ttid-delayed-navigation

Startup times

Revision Plain With Sentry Diff
23b101e+dirty 3840.21 ms 1220.13 ms -2620.09 ms
aa36375+dirty 3848.71 ms 1213.00 ms -2635.71 ms

App size

Revision Plain With Sentry Diff
23b101e+dirty 5.08 MiB 6.80 MiB 1.72 MiB
aa36375+dirty 5.08 MiB 6.72 MiB 1.64 MiB

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 482.29 ms 532.40 ms 50.11 ms
Size 49.74 MiB 55.66 MiB 5.91 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f9c1ed4+dirty 431.00 ms 466.22 ms 35.22 ms
c2e182c+dirty 471.64 ms 553.59 ms 81.95 ms
41d6254+dirty 424.45 ms 474.34 ms 49.89 ms
af33f3b+dirty 434.90 ms 506.14 ms 71.24 ms
882f8ae+dirty 399.98 ms 427.06 ms 27.08 ms
0b5120f+dirty 503.22 ms 538.60 ms 35.38 ms
774257e+dirty 407.09 ms 447.46 ms 40.37 ms
bf168a4+dirty 418.21 ms 489.74 ms 71.53 ms
5569641+dirty 406.43 ms 428.51 ms 22.08 ms
c151573+dirty 530.34 ms 559.43 ms 29.09 ms

App size

Revision Plain With Sentry Diff
f9c1ed4+dirty 49.74 MiB 54.86 MiB 5.12 MiB
c2e182c+dirty 49.74 MiB 54.85 MiB 5.11 MiB
41d6254+dirty 48.30 MiB 53.60 MiB 5.30 MiB
af33f3b+dirty 49.74 MiB 55.09 MiB 5.35 MiB
882f8ae+dirty 48.30 MiB 53.60 MiB 5.29 MiB
0b5120f+dirty 48.30 MiB 53.58 MiB 5.28 MiB
774257e+dirty 48.30 MiB 53.58 MiB 5.28 MiB
bf168a4+dirty 49.74 MiB 55.09 MiB 5.35 MiB
5569641+dirty 48.30 MiB 53.48 MiB 5.18 MiB
c151573+dirty 48.30 MiB 53.54 MiB 5.24 MiB

Previous results on branch: fix/launch-screen-ttid-delayed-navigation

Startup times

Revision Plain With Sentry Diff
23b101e+dirty 477.43 ms 508.29 ms 30.86 ms
aa36375+dirty 415.10 ms 429.02 ms 13.92 ms

App size

Revision Plain With Sentry Diff
23b101e+dirty 49.74 MiB 55.66 MiB 5.91 MiB
aa36375+dirty 49.74 MiB 55.45 MiB 5.71 MiB

@antonis
antonis marked this pull request as ready for review August 27, 2026 14:29
Comment thread packages/core/src/js/tracing/integrations/appStart.ts Outdated
Comment thread packages/core/src/js/tracing/integrations/appStart.ts Outdated

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@antonis antonis removed the ready-to-merge Triggers the full CI test suite label Sep 2, 2026
@antonis
antonis enabled auto-merge (squash) September 2, 2026 06:46
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against d85a77a

@antonis
antonis merged commit f0d062a into main Sep 2, 2026
45 of 62 checks passed
@antonis
antonis deleted the fix/launch-screen-ttid-delayed-navigation branch September 2, 2026 06:49
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.

Launch-screen TTID/TTFD inflated by pre-navigation time

2 participants