Skip to content

Conversation

noahsmartin
Copy link
Contributor

@noahsmartin noahsmartin commented Sep 26, 2025

The SentrySpan protocol is already part of the public interface and can therefore be used from Swift. The SentrySpan class is still internal to objc. To make this Swift migration easier I changed it to use the protocol, which seems to compile fine

#skip-changelog

Closes #6299


Note

Switch SentryTimeToDisplayTracker to the SentrySpan protocol (id<SentrySpan>) for span properties and method parameters.

  • Core (time-to-display tracking)
    • Update SentryTimeToDisplayTracker to use id<SentrySpan> instead of SentrySpan for initialDisplaySpan and fullDisplaySpan in Sources/Sentry/SentryTimeToDisplayTracker.m and Sources/Sentry/include/SentryTimeToDisplayTracker.h.
    • Change method signature addTimeToDisplayMeasurement: to accept id<SentrySpan>.
    • Header: replace @class SentrySpan; with @protocol SentrySpan; and adjust property declarations accordingly.

Written by Cursor Bugbot for commit 485088e. This will update automatically on new commits. Configure here.

Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.793%. Comparing base (119ab1c) to head (485088e).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #6298       +/-   ##
=============================================
+ Coverage   86.651%   86.793%   +0.141%     
=============================================
  Files          437       438        +1     
  Lines        37189     37323      +134     
  Branches     17345     17435       +90     
=============================================
+ Hits         32225     32394      +169     
+ Misses        4918      4883       -35     
  Partials        46        46               
Files with missing lines Coverage Δ
Sources/Sentry/SentryTimeToDisplayTracker.m 100.000% <ø> (ø)

... and 27 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 119ab1c...485088e. Read the comment docs.

Copy link
Contributor

github-actions bot commented Sep 26, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1223.02 ms 1241.33 ms 18.31 ms
Size 23.75 KiB 994.71 KiB 970.97 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6502818 1229.08 ms 1245.46 ms 16.37 ms
ed85746 1231.79 ms 1248.55 ms 16.75 ms
daeb716 1215.41 ms 1246.52 ms 31.11 ms
331dad6 1210.40 ms 1242.06 ms 31.67 ms
cda95fc 1231.42 ms 1247.18 ms 15.77 ms
2b02431 1229.63 ms 1248.98 ms 19.35 ms
bc0a04c 1226.83 ms 1255.04 ms 28.21 ms
aa0b738 1236.78 ms 1253.08 ms 16.31 ms
e8da57d 1203.77 ms 1234.85 ms 31.08 ms
3b373bb 1218.19 ms 1250.57 ms 32.38 ms

App size

Revision Plain With Sentry Diff
6502818 23.75 KiB 959.45 KiB 935.70 KiB
ed85746 23.75 KiB 920.83 KiB 897.08 KiB
daeb716 23.75 KiB 928.16 KiB 904.41 KiB
331dad6 23.75 KiB 928.12 KiB 904.37 KiB
cda95fc 23.75 KiB 912.77 KiB 889.02 KiB
2b02431 23.75 KiB 850.73 KiB 826.98 KiB
bc0a04c 23.75 KiB 933.32 KiB 909.57 KiB
aa0b738 23.74 KiB 872.75 KiB 849.00 KiB
e8da57d 23.75 KiB 919.69 KiB 895.94 KiB
3b373bb 23.75 KiB 947.72 KiB 923.97 KiB

Previous results on branch: useSpanProtocol

Startup times

Revision Plain With Sentry Diff
85831ce 1227.78 ms 1261.64 ms 33.86 ms

App size

Revision Plain With Sentry Diff
85831ce 23.75 KiB 993.69 KiB 969.94 KiB

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks

@noahsmartin noahsmartin merged commit 2be5991 into main Sep 29, 2025
230 of 239 checks passed
@noahsmartin noahsmartin deleted the useSpanProtocol branch September 29, 2025 19:25
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.

ref: Use SentrySpan protocol instead of class
2 participants