Skip to content

feat: expose attachment types#1700

Merged
jpnurmi merged 12 commits into
masterfrom
jpnurmi/feat/attachment-type
May 12, 2026
Merged

feat: expose attachment types#1700
jpnurmi merged 12 commits into
masterfrom
jpnurmi/feat/attachment-type

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented May 5, 2026

Allow downstream SDKs to attach files and bytes with standard Sentry attachment types, such as event.view_hierarchy or event.minidump.

This is more flexible than sentry_options_add_view_hierarchy() that a) requires a file on the disk, which must be frequently updated in case of view hierarchy, and b) pushes session management to the downstream SDKs, because they don't have access to the .run directory for multi-process support and automatic cleanup.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

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

Generated by 🚫 dangerJS against 0d52d2d

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.

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

Comment thread src/backends/native/sentry_crash_daemon.c Outdated
@limbonaut
Copy link
Copy Markdown
Collaborator

limbonaut commented May 5, 2026

Should we deprecate sentry_options_add_view_hierarchy? It'll be just a shortcut, not a very useful one.

@jpnurmi
Copy link
Copy Markdown
Collaborator Author

jpnurmi commented May 5, 2026

Should we deprecate sentry_options_add_view_hierarchy? It'll be just a shortcut, not a very useful one.

Hmm, yeah, we probably could. Besides sentry-native and its forks and vendored copies, I can only find public references in sentry-godot and sentry-docs.

@jpnurmi
Copy link
Copy Markdown
Collaborator Author

jpnurmi commented May 11, 2026

Will get back to this after #1705, which removes the configure-time attachment limitation on macOS and allows deprecating sentry_options_add_view_hierarchy.

jpnurmi and others added 6 commits May 12, 2026 09:14
Expose attachment type setters together with well-known type constants
so downstream SDKs can mark attachments such as view hierarchy payloads
as "event.view_hierarchy".

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/attachment-type branch from 2755f82 to ebbe27a Compare May 12, 2026 07:17
@jpnurmi jpnurmi marked this pull request as ready for review May 12, 2026 08:58
Comment thread src/sentry_attachment.c Outdated
Keep sentry__attachments_add focused on inserting already-configured
attachments. Configure type and content type in the path helper, and preserve
those fields when cloning attachments.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Copy link
Copy Markdown
Collaborator

@limbonaut limbonaut left a comment

Choose a reason for hiding this comment

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

I'd also add a note to doc comments about content_type side-effect. Looks good otherwise.

Comment thread include/sentry.h
Comment thread src/sentry_attachment.c
@jpnurmi jpnurmi merged commit 3b0f1f0 into master May 12, 2026
96 of 99 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/feat/attachment-type branch May 12, 2026 15:51
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