Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- Use dedicated secret to sign upload URLs. ([#6132](https://github.com/getsentry/relay/pull/6132))
- Inline small attachments instead of uploading to objectstore. ([#6165](https://github.com/getsentry/relay/pull/6165))
- Retry 500 responses from objectstore. ([#6162](https://github.com/getsentry/relay/pull/6162))
- Implement Managed::zip function. ([#6174](https://github.com/getsentry/relay/pull/6174))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can remove the changelog now, added the skip-changelog label

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay I did fix the pipeline. What is the standard here? So I can do it right next time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rule of thumb, If it has customer observable impact -> Fix/Feature, if it has any visible impact -> Internal. If it is a non trivial refactor which should not have any impact -> Internal, everything else -> No Changelog.


## 26.6.0

Expand Down
9 changes: 4 additions & 5 deletions relay-server/src/endpoints/minidump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,11 @@ fn envelope(
meta: RequestMeta,
managed_err: Managed<(DataCategory, usize)>,
) -> Result<Managed<Box<Envelope>>, BadStoreRequest> {
let event_id = common::event_id_from_items(&items)
.reject2(&items, &managed_err)?
let merged = Managed::zip(managed_err, items);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can be simplified to:

    Managed::zip(managed_err, items).try_map(|(_, items), _| {
        let event_id = common::event_id_from_items(&items)?.unwrap_or_default();
        let envelope = Envelope::from_request(Some(event_id), meta).with_items(items);
        Ok::<_, BadStoreRequest>(Box::new(envelope))
    })

Which then we might as well inline and we can drop the helper.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

By dropping the helper, are you referring to the map function? or zip?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I meant the fn envelope helper function, with zip + try_map I feel like we can inline it without having to go through that function.

let event_id = common::event_id_from_items(&merged.as_ref().1)
.reject(&merged)?
.unwrap_or_else(EventId::new);
let envelope = items.map(|items, records| {
managed_err.accept(|_| ()); // There will be an envelope with (DataCategory::Error, 1) now
records.modify_by(DataCategory::Error, 1);
let envelope = merged.map(|(_, items), _| {
Box::new(Envelope::from_request(Some(event_id), meta).with_items(items))
});
Ok(envelope)
Comment thread
Dav1dde marked this conversation as resolved.
Expand Down
9 changes: 4 additions & 5 deletions relay-server/src/endpoints/playstation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,11 @@ fn envelope(
meta: RequestMeta,
managed_err: Managed<(DataCategory, usize)>,
) -> Result<Managed<Box<Envelope>>, BadStoreRequest> {
let event_id = common::event_id_from_items(&items)
.reject2(&items, &managed_err)?
let merged = Managed::zip(managed_err, items);
let event_id = common::event_id_from_items(&merged.as_ref().1)
.reject(&merged)?
.unwrap_or_else(EventId::new);
let envelope = items.map(|items, records| {
managed_err.accept(|_| ()); // There will be an envelope with (DataCategory::Error, 1) now
records.modify_by(DataCategory::Error, 1);
let envelope = merged.map(|(_, items), _| {
let envelope = Envelope::from_request(Some(event_id), meta)
.with_items(items)
.with_required_feature(Feature::PlaystationIngestion);
Expand Down
Loading