Skip to content

ref: Migrate app state manager to Swift - #8733

Merged
philprime merged 4 commits into
mainfrom
philprime/app-state-manager-conversion
Aug 12, 2026
Merged

ref: Migrate app state manager to Swift#8733
philprime merged 4 commits into
mainfrom
philprime/app-state-manager-conversion

Conversation

@philprime

@philprime philprime commented Aug 10, 2026

Copy link
Copy Markdown
Member

📜 Description

Migrates the private app-state lifecycle manager from Objective-C into SentryAppStateManager.

The manager now owns lifecycle notification observation and uses a composed dependency-provider interface for its crash reporter, file manager, sysctl wrapper, dispatch queue, and notification center.

💡 Motivation and Context

The Objective-C helper had a single consumer. Inlining its behavior keeps app-state lifecycle logic together while removing the obsolete private Objective-C header and implementation.

💚 How did you test it?

  • make format
  • make analyze
  • make build-ios FOR_AGENTS=true
  • make test-ios FOR_AGENTS=true ONLY_TESTING=SentryTests/SentryAppStateManagerTests,SentryTests/SentryAppStartTrackerTests,SentryTests/SentryWatchdogTerminationLogicTests,SentryTests/SentryWatchdogTerminationTrackerTests,SentryTests/SentryWatchdogTerminationIntegrationTests

📝 Checklist

  • 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.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper.

Closes #8734

@philprime philprime self-assigned this Aug 10, 2026
@philprime philprime added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Aug 10, 2026
@philprime
philprime marked this pull request as ready for review August 10, 2026 08:27
@philprime
philprime enabled auto-merge (squash) August 10, 2026 08:27
@sentry

sentry Bot commented Aug 10, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.25.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.94 ms 1268.29 ms 42.36 ms
Size 24.14 KiB 1.29 MiB 1.27 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
df67624 1225.12 ms 1259.90 ms 34.78 ms
6e35062 1232.19 ms 1262.91 ms 30.73 ms
220d7ef 1238.77 ms 1267.42 ms 28.65 ms
4b5a1d7 1235.27 ms 1264.49 ms 29.22 ms
9319185 1223.24 ms 1249.98 ms 26.73 ms
d0b52d1 1227.31 ms 1258.32 ms 31.01 ms
b6b0d1d 1236.69 ms 1270.22 ms 33.52 ms
5b1c31e 1221.35 ms 1246.14 ms 24.79 ms
9787f05 1233.67 ms 1269.00 ms 35.33 ms
29d1b7f 1220.58 ms 1254.14 ms 33.56 ms

App size

Revision Plain With Sentry Diff
df67624 24.14 KiB 1.14 MiB 1.12 MiB
6e35062 24.14 KiB 1.22 MiB 1.20 MiB
220d7ef 24.14 KiB 1.17 MiB 1.14 MiB
4b5a1d7 24.14 KiB 1.22 MiB 1.20 MiB
9319185 24.14 KiB 1.16 MiB 1.13 MiB
d0b52d1 24.14 KiB 1.15 MiB 1.13 MiB
b6b0d1d 24.14 KiB 1.18 MiB 1.16 MiB
5b1c31e 24.14 KiB 1.24 MiB 1.22 MiB
9787f05 24.14 KiB 1.18 MiB 1.15 MiB
29d1b7f 24.14 KiB 1.26 MiB 1.23 MiB

Previous results on branch: philprime/app-state-manager-conversion

Startup times

Revision Plain With Sentry Diff
8a6f95f 1214.58 ms 1251.44 ms 36.86 ms

App size

Revision Plain With Sentry Diff
8a6f95f 24.14 KiB 1.27 MiB 1.25 MiB

@NinjaLikesCheez NinjaLikesCheez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, one comment

Comment thread Sources/Swift/AppState/SentryAppStateManager.swift Outdated
Co-authored-by: NinjaLikesCheez <NinjaLikesCheez@users.noreply.github.com>
Comment thread Sources/Swift/AppState/SentryAppStateManager.swift Outdated
Comment thread Sources/Swift/AppState/SentryAppStateManager.swift
@philprime
philprime merged commit b3c4c9d into main Aug 12, 2026
244 of 246 checks passed
@philprime
philprime deleted the philprime/app-state-manager-conversion branch August 12, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ref: Migrate app state manager to Swift

2 participants