Skip to content

Conversation

tustanivsky
Copy link
Collaborator

@tustanivsky tustanivsky commented May 26, 2025

This PR adopts the local scope implementation changes for sentry-native discussed in getsentry/sentry-native#1226.

Instead of applying scope data to each outgoing event via the before_send handler, the SDK now uses a write-only sentry_scope_t instance which is then passed to the new sentry_capture_event_with_scope function. Also, with this approach global scope can be modified directly via native's API (tags, level, etc.) which addresses the issue with missing context values for fast-fail crashes.

Breaking changes:

  • Dist and Environment properties are now set during the SDK initialization via options, no more corresponding set/get functions in Scope class.
  • Since Hub & Scope refactoring docs suggest deprecating ConfigureScope function and it's a no-op on Win/Linux anyway it was removed from USentrySubsystem.

Note: adding breadcrumbs via sentry_add_breadcrumb to global scope unblocks further work on getsentry/sentry-native#1166 as custom handling for the corresponding event in Unreal plugin is no longer required.

Docs update - getsentry/sentry-docs#13872

Copy link
Contributor

github-actions bot commented May 26, 2025

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

Generated by 🚫 dangerJS against d676b55

@hulla-bulla
Copy link

Awesome Stuff! (Non helpful but hopefully encouraging comment)

Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

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

looking promising, almost better than i had expected without the getters! 👍

tustanivsky added a commit to getsentry/sentry-docs that referenced this pull request Jun 2, 2025
This PR updates the Unreal Engine SDK docs to reflect recent changes
that were made in getsentry/sentry-unreal#928.

Specifically, `ConfigureScope` function was removed so now users can
modify scope either via dedicated methods of `SentrySubsystem` class
(for global scope) or by using a corresponding callback parameter that
is available for all `capture` methods to add data for one specific
event (local scope).
Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

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

I'm a bit nervous about the API changes but the sentry-native related changes LGTM 👍

CHANGELOG.md Outdated
Comment on lines 7 to 8
- `Environment` and `Dist` get/set functions were removed from the `Scope` class and now these properties have to be set in plugin settings instead.
- `ConfigureScope` function was removed from `SentrySubsystem` class.
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is probably ok without deprecating first because it hasn't reached 1.0.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, given the scope of the changes in this PR it seems like an appropriate time to remove these APIs ahead of the major version bump.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Summarizing the reason with a few words and perhaps linking to https://develop.sentry.dev/sdk/miscellaneous/hub_and_scope_refactoring/ could make the breaking change easier to accept for those who'll be affected 😉

antonpirker pushed a commit to getsentry/sentry-docs that referenced this pull request Jun 6, 2025
This PR updates the Unreal Engine SDK docs to reflect recent changes
that were made in getsentry/sentry-unreal#928.

Specifically, `ConfigureScope` function was removed so now users can
modify scope either via dedicated methods of `SentrySubsystem` class
(for global scope) or by using a corresponding callback parameter that
is available for all `capture` methods to add data for one specific
event (local scope).
@tustanivsky tustanivsky merged commit efd668c into main Jun 6, 2025
13 checks passed
@tustanivsky tustanivsky deleted the feat/local-scope-desktop branch June 6, 2025 08:36
bitsandfoxes pushed a commit to getsentry/sentry-docs that referenced this pull request Jul 3, 2025
This PR updates the Unreal Engine SDK docs to reflect recent changes
that were made in getsentry/sentry-unreal#928.

Specifically, `ConfigureScope` function was removed so now users can
modify scope either via dedicated methods of `SentrySubsystem` class
(for global scope) or by using a corresponding callback parameter that
is available for all `capture` methods to add data for one specific
event (local scope).
tustanivsky added a commit to getsentry/sentry-docs that referenced this pull request Aug 12, 2025
Key Changes:

- Updated some C++ examples to use `FSentryVariant` type instead of
string (getsentry/sentry-unreal#971)
- Added notice about using local scopes on Windows/Linux
(getsentry/sentry-unreal#928)
- Fixed supported platforms for screenshot feature
tustanivsky added a commit to getsentry/sentry-docs that referenced this pull request Aug 29, 2025
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.

3 participants