Skip to content

feat: app hang capture on desktop#2709

Merged
bitsandfoxes merged 29 commits into
mainfrom
feat/native-app-hang
Jun 25, 2026
Merged

feat: app hang capture on desktop#2709
bitsandfoxes merged 29 commits into
mainfrom
feat/native-app-hang

Conversation

@bitsandfoxes

@bitsandfoxes bitsandfoxes commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

With getsentry/sentry-native#1806 sentry-native gained the ability to capture app hangs in-proc for macOS, Linux, and Windows.
The options controlling this feature got added as experimental and default to false right now.
Added the app hang capture to our e2e testing suite.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 01be258

@bitsandfoxes bitsandfoxes changed the title feat: app hang capture on macOS feat: app hang capture on desktop Jun 10, 2026
Comment thread test/Scripts.Integration.Test/Scripts/IntegrationOptionsConfiguration.cs Outdated
@bitsandfoxes bitsandfoxes force-pushed the feat/native-app-hang branch from 0c0c4df to 7355756 Compare June 24, 2026 11:55
@bitsandfoxes bitsandfoxes changed the base branch from main to chore/route-integration-test-symbols June 24, 2026 11:56
@bitsandfoxes bitsandfoxes marked this pull request as ready for review June 24, 2026 12:00

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7355756. Configure here.

Comment thread src/Sentry.Unity.Native/SentryNativeBridge.cs

@JoshuaMoelans JoshuaMoelans 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.

A few comments, but looks good overall! Only softly blocking on the stubs & fixing the changelog :)


In https://github.com/getsentry/sentry-unity/blob/feat/native-app-hang/src/Sentry.Unity.iOS/SentryNativeCocoa.cs#L45-L51 we disable the AnrIntegration if EnableAppHangTracking is true; should we do the same for macOS (it is currently gated behind platform == RuntimePlatform.IPhonePlayer


Do we need stubs for the new sentry_options_set_enable_app_hang_tracking, sentry_options_set_app_hang_timeout, and sentry_app_hang_heartbeat in https://github.com/getsentry/sentry-unity/blob/feat/native-app-hang/package-dev/Plugins/Switch/sentry_native_stubs.c ?

Comment thread CHANGELOG.md Outdated
Comment thread src/Sentry.Unity.Native/SentryNative.cs
Comment thread CHANGELOG.md Outdated
bitsandfoxes and others added 4 commits June 24, 2026 17:21
Co-authored-by: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com>
Co-authored-by: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com>
Base automatically changed from chore/route-integration-test-symbols to main June 24, 2026 15:30
@bitsandfoxes

Copy link
Copy Markdown
Contributor Author

In https://github.com/getsentry/sentry-unity/blob/feat/native-app-hang/src/Sentry.Unity.iOS/SentryNativeCocoa.cs#L45-L51 we disable the AnrIntegration if EnableAppHangTracking is true; should we do the same for macOS (it is currently gated behind platform == RuntimePlatform.IPhonePlayer

When targeting macOS and using Cocoa, then there is no ANR support other than the C# AnrIntegration. But something is brewing over at getsentry/sentry-cocoa#8118 to improve on that. With the sentry-native on macOS, that code in SentryNativeCocoa never gets executed.

@bitsandfoxes

Copy link
Copy Markdown
Contributor Author

Do we need stubs for the new sentry_options_set_enable_app_hang_tracking, sentry_options_set_app_hang_timeout, and sentry_app_hang_heartbeat in https://github.com/getsentry/sentry-unity/blob/feat/native-app-hang/package-dev/Plugins/Switch/sentry_native_stubs.c ?

Great catch! Totally missed that. Thanks!

@JoshuaMoelans JoshuaMoelans 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, thanks for addressing all the comments 🫶

@bitsandfoxes bitsandfoxes merged commit 3e8714c into main Jun 25, 2026
90 checks passed
@bitsandfoxes bitsandfoxes deleted the feat/native-app-hang branch June 25, 2026 10:04
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