Repository navigation
feat!: SentryOptions.ScopeObserver, EnableScopeSync and CrashedLastRun are now internal - #5631
Merged
Merged
Conversation
…astRun` are now internal These options only exist so Sentry SDKs can wire up scope sync and crash detection: the Android, Cocoa and Native integrations here, and the Unity SDK. They were public so Unity could set them, but Unity has InternalsVisibleTo access, so they no longer need to be public API. `EnableScopeSync` can no longer be bound from configuration. Unity sets these options from its platform assemblies too, so those are added to the InternalsVisibleTo list in Sentry.Unity.props. Closes #4529 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version7 #5631 +/- ##
===========================================
Coverage ? 74.76%
===========================================
Files ? 515
Lines ? 18903
Branches ? 3688
===========================================
Hits ? 14133
Misses ? 3892
Partials ? 878 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jamescrosswell
commented
Sep 28, 2026
Collaborator
Author
There was a problem hiding this comment.
@bitsandfoxes double checking if this is OK. Do these properties ever need to be set via configuration bindings? I'm assuming not...
Collaborator
Author
There was a problem hiding this comment.
@bitsandfoxes I'll merge this in (assuming it's unlikely to cause an issue for you guys).
Let us know otherwise and we can revisit/revert if necessary.
ric-oliv
approved these changes
Sep 29, 2026
ric-oliv
left a comment
Member
There was a problem hiding this comment.
We can wait for Stefan, but it LGTM :)
jamescrosswell
added a commit
that referenced
this pull request
Sep 29, 2026
Picks up #5631 (ScopeObserver, EnableScopeSync and CrashedLastRun are now internal), which landed while main was being merged in. Its API snapshot removals and the additions this merge brought from main are in different places, so the snapshots merged cleanly; verified by re-running ApiApprovalTests rather than trusting the textual merge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jamescrosswell
added a commit
that referenced
this pull request
Sep 29, 2026
…t-5245' into feat/no-init-from-logging-mel-5245 Picks up version7 (which now has main merged in) plus #5573 and the NLog and log4net branches. test/Sentry.Extensions.Logging.Tests/SentryLoggingOptionsSetupTests.cs was the only textual conflict, and kept this branch's side: the test asserts only MinimumBreadcrumbLevel and MinimumEventLevel because SentryLoggingOptions no longer derives from SentryOptions, so the core SDK properties the other side binds don't exist on it. version7's only change to that file was #5631 removing three assertions this version never makes. Two things merged cleanly but did not compile, where main's new log entry filters meet this branch's options split: - Main moved the category, EF and filter checks out of ShouldCaptureEvent into their own early return, leaving it level-only, so the runtime warning's gate no longer had a 3-argument overload to call. It now goes through WouldCaptureEvent, which mirrors the real path. - SentryLogger reported a failing filter callback via _options.LogError, which only resolves while SentryLoggingOptions is a SentryOptions. It now reports through the hub's options, matching how the structured logger reads its defaults on this branch. The two tests covering it set the diagnostic logger substitute on the hub's options instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
jamescrosswell
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Oct 13, 2026
) ## DESCRIBE YOUR PR Documents `SentryOptions.OnCrashedLastRun` for the .NET SDK. The [Apple guide's setup snippet](https://docs.sentry.io/platforms/dotnet/guides/apple/#configure) already sets it, but no options page described it. The entry goes in the Hooks section of the shared .NET options page, wrapped in a `PlatformSection` so it only shows for the Apple and MAUI guides. It covers when the callback runs and which event it receives, and notes that it's iOS and Mac Catalyst only. Notes for review: - `SentryOptions.CrashedLastRun` is deliberately left out. It was only public so the Unity SDK could set it, and getsentry/sentry-dotnet#5631 makes it internal in 7.0.0. - The behaviour described comes from the SDK source: the .NET callback wraps the Cocoa SDK's `onCrashedLastRun`. Cocoa only calls that once per run, for a fatal event, after `beforeSend` and event processors. So a crash event dropped by `SampleRate`, `SetBeforeSend` or `Native.SuppressSignalAborts` doesn't trigger it. Regular crash reports are processed on a background queue. - The entry is accurate for both 6.x and 7.0. The API and its wiring are unchanged on `version7`, and both branches use Cocoa 9.30.x. Closes getsentry/sentry-dotnet#5301 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## PRE-MERGE CHECKLIST _Make sure you've checked the following before merging your changes:_ - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Ricardo Colombo Oliveira <github@ricoliv.com>
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
SentryOptions.ScopeObserver,EnableScopeSyncandCrashedLastRuninternal.These options only exist so Sentry SDKs can wire up scope sync and crash detection: the Android, Cocoa and Native integrations here, and the Unity SDK. They were public only so Unity could set them, and Unity now has
InternalsVisibleToaccess instead (discussion).Notes for review
InternalsVisibleTolist is widened. Unity doesn't only set these options fromSentry.Unity. It also sets them fromSentry.Unity.Android,Sentry.Unity.iOSandSentry.Unity.Native, and reads them inSentry.Unity.Android.TestsandSentry.Unity.iOS.Tests. None of those were inSentry.Unity.props, so they're added there to keep Unity compiling.EnableScopeSyncno longer binds from configuration. It's removed fromBindableSentryOptions, so anEnableScopeSynckey inappsettings.jsonis now ignored.IScopeObserverstays public. Unity's publicScopeObserverbase class implements it.Closes #4529
🤖 Generated with Claude Code