Skip to content

Conversation

noahsmartin
Copy link
Contributor

@noahsmartin noahsmartin commented Sep 23, 2025

Resolves https://linear.app/getsentry/issue/COCOA-702/convert-sentrydispatchfactory-to-swift and https://linear.app/getsentry/issue/COCOA-615/convert-sentrydispatchqueueproviderprotocol-to-swift

#skip-changelog


Note

Migrate dispatch factory and related queue/source provisioning from Objective‑C to Swift, updating wrappers, call sites, headers, and project references.

  • Refactor (Swift):
    • Add Sources/Swift/Tools/SentryDispatchFactory.swift implementing queue/source creation in Swift.
    • Extend SentryDispatchQueueWrapper with init using relativePriority and wire to _SentryDispatchQueueWrapperInternal.
    • Add _SentryDispatchQueueWrapperInternal initializer for relativePriority (with validation).
  • Objective‑C cleanup:
    • Remove SentryDispatchFactory.m/.h and protocols SentryDispatchQueueProviderProtocol.h, SentryDispatchSourceProviderProtocol.h from project and headers.
  • Call‑site updates:
    • Use concrete SentryDispatchFactory where protocols were referenced (e.g., SentrySessionReplayIntegration).
    • Update imports/bridging headers and Xcode project to reference the new Swift sources.
  • Tests:
    • Keep SentryDispatchFactoryTests.m working via Swift/ObjC bridge; project references updated.

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

Copy link

linear bot commented Sep 23, 2025

@noahsmartin noahsmartin force-pushed the convertSentryDispatchFactorySwift branch from 6f71caf to 675ec5b Compare September 29, 2025 17:19
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.811%. Comparing base (0309548) to head (675ec5b).
⚠️ 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     #6250       +/-   ##
=============================================
+ Coverage   86.807%   86.811%   +0.004%     
=============================================
  Files          438       438               
  Lines        37323     37328        +5     
  Branches     17434     17440        +6     
=============================================
+ Hits         32399     32405        +6     
+ Misses        4879      4650      -229     
- Partials        45       273      +228     
Files with missing lines Coverage Δ
Sources/Sentry/SentryDependencyContainer.m 89.723% <ø> (ø)
Sources/Sentry/SentryMetricProfiler.m 97.969% <ø> (ø)
Sources/Sentry/SentrySessionReplayIntegration.m 87.108% <100.000%> (ø)
...urces/Sentry/_SentryDispatchQueueWrapperInternal.m 89.610% <100.000%> (+1.550%) ⬆️
...rces/Swift/Helper/SentryDispatchQueueWrapper.swift 100.000% <100.000%> (ø)
Sources/Swift/Tools/SentryDispatchFactory.swift 100.000% <100.000%> (ø)

... and 39 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 0309548...675ec5b. Read the comment docs.

Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1223.04 ms 1241.62 ms 18.58 ms
Size 23.75 KiB 995.18 KiB 971.43 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e3ebff3 1223.47 ms 1249.27 ms 25.80 ms
5218a05 1236.35 ms 1245.41 ms 9.06 ms
7bb24a2 1229.16 ms 1256.66 ms 27.50 ms
8bb3e37 1235.18 ms 1252.63 ms 17.45 ms
9ec4c56 1222.69 ms 1248.77 ms 26.08 ms
fdea6f5 1216.08 ms 1241.82 ms 25.73 ms
0b5fd21 1237.52 ms 1251.36 ms 13.84 ms
55f739c 1226.06 ms 1248.78 ms 22.71 ms
073562b 1232.63 ms 1259.88 ms 27.24 ms
4a7a005 1229.15 ms 1243.35 ms 14.20 ms

App size

Revision Plain With Sentry Diff
e3ebff3 23.75 KiB 878.48 KiB 854.73 KiB
5218a05 23.75 KiB 984.71 KiB 960.96 KiB
7bb24a2 23.75 KiB 973.68 KiB 949.93 KiB
8bb3e37 23.75 KiB 968.25 KiB 944.50 KiB
9ec4c56 23.75 KiB 921.20 KiB 897.45 KiB
fdea6f5 23.75 KiB 867.15 KiB 843.40 KiB
0b5fd21 23.75 KiB 912.78 KiB 889.03 KiB
55f739c 23.75 KiB 858.73 KiB 834.98 KiB
073562b 23.75 KiB 927.06 KiB 903.31 KiB
4a7a005 23.75 KiB 979.96 KiB 956.22 KiB

@noahsmartin noahsmartin merged commit cbbc82c into main Sep 29, 2025
229 of 239 checks passed
@noahsmartin noahsmartin deleted the convertSentryDispatchFactorySwift branch September 29, 2025 19:53
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.

2 participants