Skip to content

ref(native): scope application to event#1769

Open
bitsandfoxes wants to merge 6 commits into
masterfrom
fix/native-flush-scope
Open

ref(native): scope application to event#1769
bitsandfoxes wants to merge 6 commits into
masterfrom
fix/native-flush-scope

Conversation

@bitsandfoxes
Copy link
Copy Markdown
Contributor

Enables #1742

This PR does not change the current output at all. For #1742 the daemon needs to be able to create non-crash events (i.e. app hangs).

  • build_native_crash_event -> build_native_event with updated signature. This is what the app hang feature will then also use
  • native_backend_apply_scope is the "source of truth" for all paths (update file & actual event)
  • The way the snapshot that gets applied to events gets updated should be unified. This means the Windows specific duplication gets removed

#skip-changelog

@bitsandfoxes bitsandfoxes requested review from jpnurmi and mujacica May 29, 2026 14:46
Comment thread src/backends/sentry_backend_native.c Outdated
Comment thread src/backends/sentry_backend_native.c Outdated
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.

There are 2 total unresolved issues (including 1 from previous review).

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

Comment thread src/backends/native/sentry_crash_daemon.c
bitsandfoxes and others added 2 commits June 1, 2026 16:40
native_backend_flush_scope runs on every scope mutation (set_tag,
set_context, set_user, ...). Folding breadcrumbs into the flushed base
event re-serialized the entire breadcrumb ring on each of those calls -
prohibitive on a hot path such as a 60fps game main thread.

Give apply_scope a scope-mode argument: the continuous flush now passes
SENTRY_SCOPE_NONE, while the crash handler still passes
SENTRY_SCOPE_BREADCRUMBS to capture them at crash time (the process's
last chance to record them). This matches the pre-existing behavior
before breadcrumbs were added to the shared flush path.

Co-Authored-By: Claude <noreply@anthropic.com>
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