feat: SentryOptions.ScopeObserver, EnableScopeSync and CrashedLastRun are obsolete - #5629
Closed
jamescrosswell wants to merge 1 commit into
Closed
jamescrosswell wants to merge 1 commit into
jamescrosswell wants to merge 1 commit into
Conversation
…stRun` are obsolete These options exist so that Sentry SDKs (the platform integrations here, and the Unity SDK) can wire up scope sync and crash detection. They were public so Unity could set them, but Unity now has InternalsVisibleTo access, so they no longer need to be public API. Mark them obsolete now and make them internal in 7.0.0. The names are kept so that the 7.0.0 change is only a visibility change, and Unity keeps compiling against them unchanged. Scope now reads a single internal `SyncedScopeObserver` accessor rather than checking `EnableScopeSync` and `ScopeObserver` at each call site. Closes #4529 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Closing in favour of making these internal on the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5629 +/- ##
==========================================
+ Coverage 74.84% 74.89% +0.04%
==========================================
Files 515 515
Lines 18962 18952 -10
Branches 3694 3686 -8
==========================================
+ Hits 14193 14194 +1
+ Misses 3892 3890 -2
+ Partials 877 868 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Marks
SentryOptions.ScopeObserver,EnableScopeSyncandCrashedLastRunas[Obsolete]. They'll becomeinternalin 7.0.0.These options exist so that Sentry SDKs can wire up scope sync and crash detection: the Android, Cocoa and Native integrations here, plus the Unity SDK. They were public only so Unity could set them. Unity now has
InternalsVisibleToaccess, so they don't need to be public API (discussion).The names stay the same, so 7.0.0 only has to change
publictointernal, and the Unity SDK keeps compiling against them without changes.Scopenow reads a single internalSentryOptions.SyncedScopeObserver(EnableScopeSync ? ScopeObserver : null) instead of checking both options at each of its ~10 call sites. This also keeps obsolete-warning suppressions out ofScope. The remaining SDK call sites that set or read the options are wrapped in#pragma warning disable CS0618.Notes for review
SentryNativeCocoa,SentryNativeAndroid,SentryNative,SentryNativeSwitch,SentryWebGL, and some tests) until it suppresses them. No code change is needed there beyond that.EnableScopeSyncstill binds from configuration.IScopeObserverstays public. Unity's publicScopeObserverbase class implements it, so whether it should also go internal in 7.0.0 is a separate question.Closes #4529
🤖 Generated with Claude Code