Skip to content

feat: introduce sentry-native on macOS as experimental backend#2687

Open
bitsandfoxes wants to merge 12 commits into
mainfrom
feat/macos-native
Open

feat: introduce sentry-native on macOS as experimental backend#2687
bitsandfoxes wants to merge 12 commits into
mainfrom
feat/macos-native

Conversation

@bitsandfoxes
Copy link
Copy Markdown
Contributor

@bitsandfoxes bitsandfoxes commented May 20, 2026

This PR adds an sentry-native as an experimental opt-in as backend when building for macOS.
This has two effects:

  • Crashes get sent immediately and do not require a relaunch of the game
  • The AppHangTracking we're working on will require sentry-native as native SDK to provide access to the native crash handler

I'm going the experimental route since this allows us to later change the default value in a release. Without it users that were already on a version that had support would need to manually change it since options are always serialized to disk (in the Editor)

@bitsandfoxes bitsandfoxes changed the title feta: use sentry-native on macos feta: use sentry-native on macOS May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

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

Generated by 🚫 dangerJS against cc6cb37

@bitsandfoxes bitsandfoxes changed the title feta: use sentry-native on macOS feat: introduce sentry-native on macOS as experimental backend May 22, 2026
@bitsandfoxes bitsandfoxes requested a review from a team May 22, 2026 14:04
@bitsandfoxes bitsandfoxes marked this pull request as ready for review May 22, 2026 14:04
Comment thread package-dev/Runtime/SentryInitialization.cs Outdated
Comment thread package-dev/Runtime/SentryInitialization.cs
Comment thread src/Sentry.Unity.Editor/Native/BuildPostProcess.cs
Comment thread package-dev/Runtime/SentryInitialization.cs
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 cc6cb37. Configure here.


var shutdownTimeoutMs = (ulong)Math.Max(0, options.ShutdownTimeout.TotalMilliseconds);
Logger?.LogDebug("Setting ShutdownTimeout: {0}ms", shutdownTimeoutMs);
sentry_options_set_shutdown_timeout(cOptions, shutdownTimeoutMs);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Native macOS shutdown timeout too short

Medium Severity

With Experimental.MacosBackend set to Native on macOS, SentryNativeBridge.Init forwards options.ShutdownTimeout to sentry_options_set_shutdown_timeout, but the default remains 2000 ms. The sample only raises this in OptionsConfiguration, so typical Editor setups can cut native out-of-process crash upload short on exit.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cc6cb37. Configure here.

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