fix: Disable app hang and watchdog termination tracking in Notification Service Extensions#7818
Conversation
📲 Install BuildsiOS
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7818 +/- ##
=============================================
+ Coverage 85.443% 85.471% +0.027%
=============================================
Files 487 487
Lines 29327 29335 +8
Branches 12678 12679 +1
=============================================
+ Hits 25058 25073 +15
+ Misses 4219 4212 -7
Partials 50 50
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Performance metrics 🚀
|
philprime
left a comment
There was a problem hiding this comment.
I believe we have sample notification extensions for all the other cases. Can you create one for this case too?
…-app-hang-watchdog-disabled
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ac8a2d2. Configure here.
philprime
left a comment
There was a problem hiding this comment.
LGTM, tested using the Push Notification Console and a device token on a real device. Sentry is triggered and the event is sent

Summary
notificationService(com.apple.usernotifications.service) toSentryExtensionTypeand to the list of extension types where app hang tracking is disabledSentryWatchdogTerminationTrackingIntegration.init(it was the only integration missing this check)SentryExtensionTypeTests,SentryHangTrackingIntegrationTests, andSentryWatchdogTerminationTrackingIntegrationTestsFixes #7808
Details
Notification Service Extensions have no user-facing run loop, so they should behave like widgets/intents/actions/share extensions and not run app hang or watchdog termination tracking. Two gaps existed:
SentryExtensionDetector.disabledAppHangTypesdid not includecom.apple.usernotifications.service, soSentryHangTrackingIntegrationwould install itself inside an NSE.SentryWatchdogTerminationTrackingIntegrationperformed no extension check at all, unlike every other hang-related integration.Both issues caused Sentry's own internal work (battery-state breadcrumb I/O, JSON serialisation) on the main thread to be flagged as fatal hangs in NSE processes.
How Tested
SentryExtensionTypeTests,SentryHangTrackingIntegrationTests/testInstall_runningInNotificationServiceExtension_shouldNotInstall, and the three newSentryWatchdogTerminationIntegrationTests— all pass.Checklist