Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(envelope): Detect attachments that create events #609

Merged
merged 3 commits into from
Jun 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions relay-server/src/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,18 @@ impl Item {

// Attachments are only event items if they are crash reports.
ItemType::Attachment => match self.attachment_type().unwrap_or_default() {
AttachmentType::AppleCrashReport | AttachmentType::Minidump => true,
_ => false,
AttachmentType::AppleCrashReport
| AttachmentType::Minidump
| AttachmentType::EventPayload
| AttachmentType::Breadcrumbs => true,
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about this one

Copy link
Member Author

Choose a reason for hiding this comment

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

Breadcrumbs alone can also create an event payload in this code path:

return Ok(Self::event_from_attachments(
&self.config,
attachment_item,
breadcrumbs_item1,
breadcrumbs_item2,
)?);

AttachmentType::Attachment
| AttachmentType::UnrealContext
| AttachmentType::UnrealLogs => false,
},

// Form data items may contain partial event payloads, but those are only ever valid if they
// occur together with an explicit event item, such as a minidump or apple crash report. For
// this reason, FormData alone does not constitute an event item.
// Form data items may contain partial event payloads, but those are only ever valid if
// they occur together with an explicit event item, such as a minidump or apple crash
// report. For this reason, FormData alone does not constitute an event item.
ItemType::FormData => false,

// The remaining item types cannot carry event payloads.
Expand Down