Skip to content

chore: Remove SentryNetworkTracker singleton#7107

Closed
itaybre wants to merge 6 commits intomainfrom
itay/remove_networktracker_singleton
Closed

chore: Remove SentryNetworkTracker singleton#7107
itaybre wants to merge 6 commits intomainfrom
itay/remove_networktracker_singleton

Conversation

@itaybre
Copy link
Contributor

@itaybre itaybre commented Dec 30, 2025

📜 Description

Follow up to remove SentryNetworkTracking singleton.
After testing this more, I noticed that at least some kind of singleton is needed because of the swizzling + closing and enabling again the SDK.

I found another way to implement this.
But I am not sure this is the way to go, because in the end I traded one singleton for another.

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the 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.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.746%. Comparing base (406b0d4) to head (a39c44a).
⚠️ Report is 34 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #7107       +/-   ##
=============================================
+ Coverage   84.714%   84.746%   +0.032%     
=============================================
  Files          459       459               
  Lines        27496     27508       +12     
  Branches     12121     12125        +4     
=============================================
+ Hits         23293     23312       +19     
+ Misses        4160      4155        -5     
+ Partials        43        41        -2     
Files with missing lines Coverage Δ
SentryTestUtils/Sources/ClearTestState.swift 82.926% <ø> (-0.407%) ⬇️
Sources/Sentry/SentryNetworkTracker.m 100.000% <ø> (ø)
Sources/Sentry/SentrySDKInternal.m 84.583% <100.000%> (-0.064%) ⬇️
Sources/Sentry/SentrySwizzleWrapperHelper.m 100.000% <100.000%> (ø)
Sources/Swift/Core/Integrations/Integrations.swift 100.000% <100.000%> (ø)
...nce/Network/SentryNetworkTrackingIntegration.swift 100.000% <100.000%> (ø)

... 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 406b0d4...a39c44a. Read the comment docs.

…nm-in-swift' of github.com:getsentry/sentry-cocoa into itay/remove_networktracker_singleton
@itaybre itaybre added the ready-to-merge Use this label to trigger all PR workflows label Dec 30, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1222.81 ms 1247.62 ms 24.82 ms
Size 24.14 KiB 1.03 MiB 1.00 MiB

Baseline results on branch: itay/cocoa-993-refactor-sentrynetworktrackingintegrationm-in-swift

Startup times

Revision Plain With Sentry Diff
3ad0bf4 1224.53 ms 1243.49 ms 18.96 ms

App size

Revision Plain With Sentry Diff
3ad0bf4 24.14 KiB 1.03 MiB 1.00 MiB

Previous results on branch: itay/remove_networktracker_singleton

Startup times

Revision Plain With Sentry Diff
23ba5b4 1221.09 ms 1246.98 ms 25.89 ms

App size

Revision Plain With Sentry Diff
23ba5b4 24.14 KiB 1.03 MiB 1.00 MiB

@github-actions
Copy link
Contributor

🚨 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/SentryNetworkTracker.m

Base automatically changed from itay/cocoa-993-refactor-sentrynetworktrackingintegrationm-in-swift to main January 15, 2026 19:56
@itaybre itaybre closed this Jan 16, 2026
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.

1 participant