Skip to content

Conversation

noahsmartin
Copy link
Contributor

Creates a Swift wrapper for SentrySession, and updates all callosities to using the wrapper (by changing the name of the ObjC type so it's now just an implementation detail)

This is because I'm trying to write a runloop observer feature all in Swift, and it requires SentryFileManager, which is blocked from being used in Swift APIs by SentrySession according to the latest ObjC to Swift conversion dependency tree: https://github.com/getsentry/sentry-cocoa/actions/runs/16677150074/job/47206480213

#skip-changelog

Copy link

codecov bot commented Aug 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.761%. Comparing base (3279d4e) to head (047b92d).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #5785       +/-   ##
=============================================
+ Coverage   86.704%   86.761%   +0.057%     
=============================================
  Files          425       426        +1     
  Lines        36748     36831       +83     
  Branches     17363     17407       +44     
=============================================
+ Hits         31862     31955       +93     
+ Misses        4839      4830        -9     
+ Partials        47        46        -1     
Files with missing lines Coverage Δ
SentryTestUtils/TestClient.swift 82.677% <ø> (ø)
SentryTestUtils/TestTransportAdapter.swift 84.210% <ø> (ø)
Sources/Sentry/SentryClient.m 98.940% <ø> (ø)
...rces/Sentry/SentryCrashIntegrationSessionHandler.m 100.000% <ø> (ø)
Sources/Sentry/SentryEnvelope.m 88.839% <ø> (ø)
Sources/Sentry/SentryHub.m 98.086% <ø> (ø)
Sources/Sentry/SentryMigrateSessionInit.m 94.117% <ø> (ø)
Sources/Sentry/SentryScope.m 97.091% <ø> (ø)
Sources/Sentry/SentrySerialization.m 98.905% <ø> (ø)
Sources/Sentry/SentrySessionInternal.m 99.512% <100.000%> (ø)
... and 1 more

... and 5 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 3279d4e...047b92d. Read the comment docs.

@noahsmartin noahsmartin force-pushed the sentrySessionSwiftWrapper branch 3 times, most recently from 2597c21 to 0ad6d79 Compare August 1, 2025 18:20
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.

I found one potential issue. Apart from that LGTM.

@noahsmartin noahsmartin force-pushed the sentrySessionSwiftWrapper branch from 796513f to ef9b5ba Compare August 4, 2025 19:28
Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

LGTM

@noahsmartin noahsmartin force-pushed the sentrySessionSwiftWrapper branch from 127c559 to 714b1d4 Compare August 28, 2025 20:00
Copy link
Contributor

github-actions bot commented Aug 28, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1223.02 ms 1255.29 ms 32.27 ms
Size 23.75 KiB 944.16 KiB 920.41 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6cb4338 1238.47 ms 1256.96 ms 18.49 ms
55f739c 1226.06 ms 1248.78 ms 22.71 ms
ae7be93 1236.24 ms 1258.18 ms 21.94 ms
2675d3c 1218.94 ms 1239.36 ms 20.42 ms
3c86ff3 1227.82 ms 1239.73 ms 11.91 ms
7eafbde 1212.16 ms 1243.64 ms 31.48 ms
01faa71 1238.81 ms 1263.98 ms 25.17 ms
2a6f451 1212.89 ms 1237.45 ms 24.56 ms
fac4ca3 1222.81 ms 1235.83 ms 13.02 ms
5cfc768 1220.74 ms 1245.06 ms 24.32 ms

App size

Revision Plain With Sentry Diff
6cb4338 23.75 KiB 913.63 KiB 889.88 KiB
55f739c 23.75 KiB 858.73 KiB 834.98 KiB
ae7be93 23.75 KiB 879.24 KiB 855.49 KiB
2675d3c 23.75 KiB 928.16 KiB 904.41 KiB
3c86ff3 23.75 KiB 919.69 KiB 895.94 KiB
7eafbde 23.75 KiB 927.53 KiB 903.78 KiB
01faa71 23.75 KiB 926.77 KiB 903.02 KiB
2a6f451 23.75 KiB 913.13 KiB 889.38 KiB
fac4ca3 23.75 KiB 902.01 KiB 878.27 KiB
5cfc768 23.75 KiB 850.73 KiB 826.98 KiB

Previous results on branch: sentrySessionSwiftWrapper

Startup times

Revision Plain With Sentry Diff
ae623da 1246.94 ms 1275.14 ms 28.20 ms
71746be 1219.73 ms 1245.02 ms 25.29 ms

App size

Revision Plain With Sentry Diff
ae623da 23.75 KiB 940.19 KiB 916.44 KiB
71746be 23.75 KiB 932.41 KiB 908.66 KiB

@noahsmartin noahsmartin force-pushed the sentrySessionSwiftWrapper branch from 714b1d4 to 343cdb3 Compare September 2, 2025 19:46
@noahsmartin noahsmartin force-pushed the sentrySessionSwiftWrapper branch from 343cdb3 to 047b92d Compare September 3, 2025 02:39
Copy link
Contributor

github-actions bot commented Sep 3, 2025

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentrySerialization.m

@noahsmartin noahsmartin merged commit 93c76b0 into main Sep 3, 2025
179 of 181 checks passed
@noahsmartin noahsmartin deleted the sentrySessionSwiftWrapper branch September 3, 2025 20:47
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.

3 participants