Skip to content

fix(native): preserve attachments added during crash handling#1687

Merged
tustanivsky merged 4 commits intomasterfrom
fix/native-crash-attachments
Apr 29, 2026
Merged

fix(native): preserve attachments added during crash handling#1687
tustanivsky merged 4 commits intomasterfrom
fix/native-crash-attachments

Conversation

@tustanivsky
Copy link
Copy Markdown
Collaborator

@tustanivsky tustanivsky commented Apr 29, 2026

Attachments registered from on_crash / before_send are not delivered to the daemon under the native backend because the scope-flush path that writes <run>/__sentry-attachments is gated by state->crashed (#1668) once the crash handler runs. As a result, the daemon assembles the envelope from a stale manifest and the attachments are silently dropped.

This PR narrows the gate to cover only the event JSON write. The manifest write is extracted into a helper and runs on both the pre-crash and post-crash paths inside native_backend_flush_scope, so attachments registered during on_crash / before_send propagate through the existing scope-flush hook and reach the daemon.

Related items:

Comment thread src/backends/sentry_backend_native.c
@tustanivsky tustanivsky requested review from jpnurmi and mujacica April 29, 2026 16:59
@tustanivsky tustanivsky merged commit 8198e04 into master Apr 29, 2026
97 of 98 checks passed
@tustanivsky tustanivsky deleted the fix/native-crash-attachments branch April 29, 2026 17:16
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