Skip to content

feat: SentryOptions.ScopeObserver, EnableScopeSync and CrashedLastRun are obsolete - #5629

Closed
jamescrosswell wants to merge 1 commit into
mainfrom
obsolete-internal-options
Closed

jamescrosswell wants to merge 1 commit into
mainfrom
obsolete-internal-options

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Marks SentryOptions.ScopeObserver, EnableScopeSync and CrashedLastRun as [Obsolete]. They'll become internal in 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 InternalsVisibleTo access, so they don't need to be public API (discussion).

The names stay the same, so 7.0.0 only has to change public to internal, and the Unity SDK keeps compiling against them without changes.

Scope now reads a single internal SentryOptions.SyncedScopeObserver (EnableScopeSync ? ScopeObserver : null) instead of checking both options at each of its ~10 call sites. This also keeps obsolete-warning suppressions out of Scope. The remaining SDK call sites that set or read the options are wrapped in #pragma warning disable CS0618.

Notes for review

  • Unity will start seeing CS0618 wherever it sets these options (SentryNativeCocoa, SentryNativeAndroid, SentryNative, SentryNativeSwitch, SentryWebGL, and some tests) until it suppresses them. No code change is needed there beyond that.
  • EnableScopeSync still binds from configuration.
  • IScopeObserver stays public. Unity's public ScopeObserver base class implements it, so whether it should also go internal in 7.0.0 is a separate question.

Closes #4529

🤖 Generated with Claude Code

…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>
@jamescrosswell

Copy link
Copy Markdown
Collaborator Author

Closing in favour of making these internal on the version7 branch rather than obsoleting them on main.

@jamescrosswell
jamescrosswell deleted the obsolete-internal-options branch September 27, 2026 23:46
@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.89%. Comparing base (a1a092a) to head (e22f2d0).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

The CrashedLastRun, EnableScopeSync and ScopeObserver options should all be internal

1 participant