Conversation
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>
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
| "\"filename\":\"%s\"}\n", | ||
| file_size, content_type, filename ? filename : "attachment"); | ||
| file_size, | ||
| attachment_type ? attachment_type : SENTRY_ATTACHMENT_TYPE_GENERIC, |
There was a problem hiding this comment.
Empty attachment_type written for generic attachments in crash daemon
High Severity
When generic attachments lack an attachment_type key in the JSON manifest, sentry_value_as_string() returns "" (empty string, not NULL). The check attachment_type ? attachment_type : SENTRY_ATTACHMENT_TYPE_GENERIC only guards against NULL, so "" passes through, producing "attachment_type":"" in the envelope header instead of "attachment_type":"event.attachment". The same file correctly handles this at line 275 using (attachment_type && *attachment_type), but write_attachment_to_envelope does not dereference to check for empty string.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e4abe3d. Configure here.
|
Should we deprecate |
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. |


Allow downstream SDKs to attach files and bytes with standard Sentry attachment types, such as
event.view_hierarchyorevent.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.