Skip to content

Conversation

@itaybre
Copy link
Contributor

@itaybre itaybre commented Jan 20, 2026

📜 Description

Converted SentryNSDataSwizzling and SentryNSFileManagerSwizzling to Swift, keeping some helper in ObjC for the swizzling.

💡 Motivation and Context

Converts some classes required to unlock other conversions to Swift.

💚 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.

@linear
Copy link

linear bot commented Jan 20, 2026

@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/SentryNSDataSwizzling.m
  • Sources/Sentry/SentryNSFileManagerSwizzling.m

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Metrics

  • Add public API to collect count, distribution and gauge by philprime in #6957
  • Add implementation for metrics envelope item by philprime in #6960
  • Add integration with installation by SDK by philprime in #6956

Other

  • Add metrics flushing support to SentrySDK.flush() by philprime in #7182
  • Add isiOSAppOnVisionOS, isiOSAppOnMac, isMacCatalystApp to device context by philprime in #6939

Bug Fixes 🐛

  • (logs) Use sendDefaultPii and span_id for attributes by philprime in #7055
  • Fix incorrect variable assignment for 'sampled' key by xjshi in #7120
  • Mark dark theme deprecated by noahsmartin in #7114
  • Update raw_description in runtime context for Mac Catalyst App by philprime in #7082
  • Use correct parsing for stackframes by noahsmartin in #6908
  • Transport correctly handling 4xx and 5xx by dfed in #6618

Build / dependencies / internal 🔧

Deps

  • Bump actions/upload-artifact from 5 to 6 by dependabot in #7206
  • Bump actions/setup-node from 6.1.0 to 6.2.0 by dependabot in #7207
  • Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.18.3 to 2.19.0 by dependabot in #7205
  • Bump ruby/setup-ruby from 1.279.0 to 1.281.0 by dependabot in #7160
  • Bump getsentry/craft from 2.18.1 to 2.18.3 by dependabot in #7161
  • Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.18.1 to 2.18.3 by dependabot in #7159
  • Bump ruby/setup-ruby from 1.276.0 to 1.279.0 by dependabot in #7117
  • Bump mikepenz/action-junit-report from 6.0.1 to 6.1.0 by dependabot in #7116
  • Update swiftlint version by github-actions in #7109
  • Bump ruby/setup-ruby from 1.275.0 to 1.276.0 by dependabot in #7103
  • Bump codecov/test-results-action from 1.1.1 to 1.2.1 by itaybre in #7087
  • Bump ruby/setup-ruby from 1.270.0 to 1.275.0 by itaybre in #7088
  • Bump peter-evans/create-pull-request from 7.0.11 to 8.0.0 by dependabot in #7084
  • Bump actions/download-artifact from 6 to 7 by dependabot in #7048
  • Bump aws-sdk-s3 from 1.205.0 to 1.208.0 by dependabot in #7074
  • Bump ruby/setup-ruby from 1.269.0 to 1.270.0 by dependabot in #7049
  • Update clang-format version by github-actions in #7056
  • Bump actions/cache from 4 to 5 by dependabot in #7052
  • Bump actions/upload-artifact from 5 to 6 by dependabot in #7050
  • Bump codecov/codecov-action from 5.5.1 to 5.5.2 by dependabot in #7051

Other

  • (dx) Add structured Makefile with usage description by philprime in #7129
  • (release) Switch from action-prepare-release to Craft (minimal) by BYK in #7153
  • Convert SentryNSDataSwizzling and SentryNSFileManagerSwizzling to Swift by itaybre in #7209
  • Use pull_request_target for changelog preview by BYK in #7190
  • Allow whitespaces on Xcode path when executing make init by itaybre in #7193
  • Add temporary macro for Swift migration tracking of types erased by itaybre in #7178
  • Renames SentrySpan class to SentrySpanInternal by itaybre in #7172
  • Convert SentryNetworkTrackingIntegration to Swift by itaybre in #7106
  • Update iOS test destination OS version to 18.5 in fast-pr-checks workflow by itaybre in #7168
  • Fix typos in comments in multiple files v2 by philipphofmann in #7139
  • Run visionOS tests on Cirrus Runners + Boot simulator by itaybre in #7147
  • Skip jobs/steps that require secrets for non contributors by itaybre in #7124
  • Add attributable protocol for typed attribute values by philprime in #7077
  • Allow alpha releases on RNSentry.podspec for Cross Platform Test by itaybre in #7130
  • Remove swift5.9 checks by itaybre in #7098
  • Remove duplicate file in project by itaybre in #7093
  • Convert SentryMetricKitIntegration to Swift by noahsmartin in #7076
  • Removes HybridSDK subspec by itaybre in #7019
  • Move testRemoveImageFromTail to flaky plan by itaybre in #7041
  • Use at least xcode 16 for all jobs by itaybre in #7012
  • Cleanup file filter for required files modified by itaybre in #7031
  • Remove assembly workflow files from UI test filter by itaybre in #7030
  • Bumps macOS-14 runner to macOS-15 by itaybre in #7029
  • Ensure required simulators are loaded for all platforms by itaybre in #7022

Other

  • test: Add Options Documentation Sync Tests by philipphofmann in #7075

🤖 This preview updates automatically when you update the PR.

@itaybre itaybre added the ready-to-merge Use this label to trigger all PR workflows label Jan 20, 2026
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.096%. Comparing base (5ca545a) to head (a148b57).
⚠️ 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     #7209       +/-   ##
=============================================
+ Coverage   85.037%   85.096%   +0.058%     
=============================================
  Files          468       470        +2     
  Lines        28305     28302        -3     
  Branches     12535     12533        -2     
=============================================
+ Hits         24070     24084       +14     
+ Misses        4194      3958      -236     
- Partials        41       260      +219     
Files with missing lines Coverage Δ
Sources/Sentry/SentryCoreDataTrackingIntegration.m 100.000% <ø> (ø)
Sources/Sentry/SentryFileIOTrackingIntegration.m 100.000% <ø> (ø)
Sources/Sentry/SentryNSDataSwizzlingHelper.m 100.000% <100.000%> (ø)
...ources/Sentry/SentryNSFileManagerSwizzlingHelper.m 100.000% <100.000%> (ø)
Sources/Sentry/SentryUIEventTrackingIntegration.m 100.000% <ø> (ø)
...rations/Performance/IO/SentryNSDataSwizzling.swift 100.000% <100.000%> (ø)
.../Performance/IO/SentryNSFileManagerSwizzling.swift 100.000% <100.000%> (ø)

... and 36 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 5ca545a...a148b57. Read the comment docs.

@github-actions
Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1231.69 ms 1259.23 ms 27.54 ms
Size 24.14 KiB 1.06 MiB 1.04 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
21cd5ba 1218.68 ms 1255.54 ms 36.86 ms
adeec82 1220.43 ms 1254.94 ms 34.51 ms
41b4993 1215.15 ms 1248.14 ms 32.99 ms
2f4ddaa 1227.26 ms 1260.04 ms 32.78 ms
d29a425 1209.96 ms 1239.00 ms 29.04 ms
778dadf 1207.69 ms 1246.09 ms 38.40 ms
b87b34f 1203.00 ms 1237.17 ms 34.17 ms
e1e5f3b 1220.60 ms 1241.63 ms 21.04 ms
93ef486 1220.22 ms 1244.96 ms 24.74 ms
3bf0d3f 1202.12 ms 1237.23 ms 35.11 ms

App size

Revision Plain With Sentry Diff
21cd5ba 24.14 KiB 1.04 MiB 1.02 MiB
adeec82 24.14 KiB 1.04 MiB 1.02 MiB
41b4993 24.14 KiB 1.06 MiB 1.04 MiB
2f4ddaa 24.14 KiB 1.04 MiB 1.02 MiB
d29a425 24.14 KiB 1.04 MiB 1.02 MiB
778dadf 24.14 KiB 1.04 MiB 1.02 MiB
b87b34f 24.14 KiB 1.06 MiB 1.04 MiB
e1e5f3b 24.14 KiB 1.06 MiB 1.04 MiB
93ef486 24.14 KiB 1.06 MiB 1.04 MiB
3bf0d3f 24.14 KiB 1.04 MiB 1.02 MiB

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.

2 participants