Skip to content

Converts SentryWatchdogTerminationLogic and SentryWatchdogTerminationTracker to Swift#7118

Merged
itaybre merged 9 commits intomainfrom
ref/watchdog-logic-tracker-to-swift
Jan 13, 2026
Merged

Converts SentryWatchdogTerminationLogic and SentryWatchdogTerminationTracker to Swift#7118
itaybre merged 9 commits intomainfrom
ref/watchdog-logic-tracker-to-swift

Conversation

@itaybre
Copy link
Contributor

@itaybre itaybre commented Jan 5, 2026

📜 Description

Changes:

  • Added SentryWatchdogTerminationLogic.swift with @objc support
  • Added SentryWatchdogTerminationTracker.swift with @objc support
  • Deleted old Objective-C implementations (.m and .h files)
  • Updated imports in Integration and other files to use Swift versions via
    SentrySwift.h
  • Updated test data to reference Swift class properties

💡 Motivation and Context

These changes are needed to convert SentryWatchdogTerminationIntegration 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.

No public changes, #skip-changelog

Closes #7127

…tionTracker to Swift

Migrate the Logic and Tracker classes from Objective-C to Swift while keeping
the Integration in Objective-C for now. The Swift classes are marked with @objc
and @_spi(Private) to maintain compatibility with the existing Objective-C Integration.

Changes:
- Add SentryWatchdogTerminationLogic.swift with @objc support
- Add SentryWatchdogTerminationTracker.swift with @objc support
- Remove old Objective-C implementations
- Update imports in Integration and other files to use Swift versions
- Update test data to reference Swift class properties
- Update bridging header to remove obsolete imports
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 91.48936% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.802%. Comparing base (8440c54) to head (f662616).
⚠️ Report is 21 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
Sources/Swift/AppState/SentryAppStateManager.swift 45.454% 11 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #7118       +/-   ##
=============================================
+ Coverage   84.710%   84.802%   +0.091%     
=============================================
  Files          459       461        +2     
  Lines        27490     27859      +369     
  Branches     12117     12321      +204     
=============================================
+ Hits         23287     23625      +338     
- Misses        4162      4193       +31     
  Partials        41        41               
Files with missing lines Coverage Δ
Sources/Sentry/SentryClient.m 97.426% <100.000%> (ø)
Sources/Sentry/SentryCrashIntegration.m 100.000% <ø> (ø)
...rces/Sentry/SentryCrashIntegrationSessionHandler.m 100.000% <ø> (ø)
...try/SentryWatchdogTerminationTrackingIntegration.m 89.655% <ø> (ø)
...gTerminations/SentryWatchdogTerminationLogic.swift 100.000% <100.000%> (ø)
...erminations/SentryWatchdogTerminationTracker.swift 100.000% <100.000%> (ø)
Sources/Swift/AppState/SentryAppStateManager.swift 81.818% <45.454%> (-18.182%) ⬇️

... and 13 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 8440c54...f662616. Read the comment docs.

@itaybre itaybre added the ready-to-merge Use this label to trigger all PR workflows label Jan 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1210.94 ms 1238.52 ms 27.58 ms
Size 24.14 KiB 1.04 MiB 1.02 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
013fd4d 1216.02 ms 1242.16 ms 26.14 ms
d29a425 1209.96 ms 1239.00 ms 29.04 ms
9f7ef2b 1213.53 ms 1250.23 ms 36.70 ms

App size

Revision Plain With Sentry Diff
013fd4d 24.14 KiB 1.04 MiB 1.02 MiB
d29a425 24.14 KiB 1.04 MiB 1.02 MiB
9f7ef2b 24.14 KiB 1.04 MiB 1.02 MiB

Previous results on branch: ref/watchdog-logic-tracker-to-swift

Startup times

Revision Plain With Sentry Diff
3027f40 1220.11 ms 1265.87 ms 45.76 ms

App size

Revision Plain With Sentry Diff
3027f40 24.14 KiB 1.03 MiB 1.01 MiB

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.

Good progress, left some comments to discuss

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

@itaybre itaybre merged commit 50e7b3e into main Jan 13, 2026
231 of 238 checks passed
@itaybre itaybre deleted the ref/watchdog-logic-tracker-to-swift branch January 13, 2026 16:00
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.

Converts SentryWatchdogTerminationLogic and SentryWatchdogTerminationTracker to Swift

2 participants