Skip to content

ref: End standalone app start at didFinishLaunching#7941

Merged
itaybre merged 4 commits into
mainfrom
itaybrenner/cocoa-6883-standalone-didfinishlaunching-clean
May 27, 2026
Merged

ref: End standalone app start at didFinishLaunching#7941
itaybre merged 4 commits into
mainfrom
itaybrenner/cocoa-6883-standalone-didfinishlaunching-clean

Conversation

@itaybre

@itaybre itaybre commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Standalone app start transactions now end when UIApplication.didFinishLaunchingNotification is posted instead of waiting for the first frame render
  • The "Initial Frame Render" child span is no longer emitted for standalone transactions since it does not apply
  • Non-standalone (attach-to-transaction) behavior is unchanged

Decided to do this change on standalone app starts since it is still experimental and thus we can make "breaking changes"

Fixes #6883

Test plan

  • All existing AppStartReportingStrategyTests, SentryAppStartTrackerTests, and SentryBuildAppStartSpansTests updated and passing
  • Test with sample app: enable enable-standalone-app-start-tracing, verify app start transaction ends at didFinishLaunching and has no "Initial Frame Render" span

#skip-changelog

itaybre added 2 commits May 22, 2026 17:09
Standalone app start transactions now end when
UIApplication.didFinishLaunchingNotification is posted instead of
waiting for the first frame render. This is a more universally
understood endpoint and avoids edge cases with background launches.

The "Initial Frame Render" child span is no longer emitted for
standalone transactions since it does not apply. Non-standalone
(attach-to-transaction) behavior is unchanged.

Refs: #6886
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.588%. Comparing base (d4b3feb) to head (5a3d015).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #7941       +/-   ##
=============================================
- Coverage   86.138%   85.588%   -0.550%     
=============================================
  Files          489       489               
  Lines        29954     29963        +9     
  Branches     12986     12973       -13     
=============================================
- Hits         25802     25645      -157     
- Misses        4101      4268      +167     
+ Partials        51        50        -1     
Files with missing lines Coverage Δ
Sources/Sentry/SentryBuildAppStartSpans.m 100.000% <100.000%> (ø)
...tions/AppStartTracking/SentryAppStartTracker.swift 94.413% <100.000%> (+0.330%) ⬆️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4b3feb...5a3d015. Read the comment docs.

@itaybre itaybre added the ready-to-merge Use this label to trigger all PR workflows label May 25, 2026
@sentry

sentry Bot commented May 25, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.14.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1238.71 ms 1266.55 ms 27.83 ms
Size 24.14 KiB 1.16 MiB 1.14 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6c524d8 1217.83 ms 1254.02 ms 36.20 ms
5a9c804 1220.29 ms 1255.17 ms 34.88 ms
75eb224 1215.57 ms 1244.74 ms 29.17 ms
49cc12d 1227.33 ms 1263.21 ms 35.89 ms
e337271 1234.71 ms 1270.10 ms 35.40 ms
f331b01 1231.40 ms 1256.22 ms 24.82 ms
3f6f54f 1219.13 ms 1249.20 ms 30.07 ms
85ee155 1227.40 ms 1251.52 ms 24.12 ms
bd2b6d3 1213.78 ms 1253.83 ms 40.06 ms
787537a 1218.35 ms 1251.72 ms 33.38 ms

App size

Revision Plain With Sentry Diff
6c524d8 24.14 KiB 1.15 MiB 1.12 MiB
5a9c804 24.14 KiB 1.15 MiB 1.13 MiB
75eb224 24.14 KiB 1.16 MiB 1.13 MiB
49cc12d 24.14 KiB 1.16 MiB 1.13 MiB
e337271 24.14 KiB 1.16 MiB 1.13 MiB
f331b01 24.14 KiB 1.15 MiB 1.13 MiB
3f6f54f 24.14 KiB 1.16 MiB 1.13 MiB
85ee155 24.14 KiB 1.16 MiB 1.13 MiB
bd2b6d3 24.14 KiB 1.17 MiB 1.14 MiB
787537a 24.14 KiB 1.15 MiB 1.12 MiB

Previous results on branch: itaybrenner/cocoa-6883-standalone-didfinishlaunching-clean

Startup times

Revision Plain With Sentry Diff
380a615 1226.58 ms 1254.14 ms 27.56 ms

App size

Revision Plain With Sentry Diff
380a615 24.14 KiB 1.17 MiB 1.14 MiB

When the SDK is initialized after didFinishLaunchingNotification
has already been posted, standalone app starts produce no
measurement. There is no reliable way to detect this at runtime
since UIApplication.applicationState may already be .active in
SwiftUI apps during App.init().
@itaybre
itaybre marked this pull request as ready for review May 26, 2026 03:53

@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 5a3d015. Configure here.

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Almost LGTM

Comment thread Sources/Sentry/SentryBuildAppStartSpans.m

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@itaybre
itaybre merged commit c4d02bd into main May 27, 2026
231 of 234 checks passed
@itaybre
itaybre deleted the itaybrenner/cocoa-6883-standalone-didfinishlaunching-clean branch May 27, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Send standalone app start transactions

2 participants