-
Notifications
You must be signed in to change notification settings - Fork 93
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(profiling): Expand all Profile items in an envelope #1465
Conversation
@@ -850,27 +850,24 @@ impl EnvelopeProcessor { | |||
|
|||
/// Remove profiles if the feature flag is not enabled | |||
fn process_profiles(&self, state: &mut ProcessEnvelopeState) { | |||
let profiling_enabled = state.project_state.has_feature(Feature::Profiling); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work, even for external Relays, because features
is part of LimitedProjectConfig
.
https://github.com/getsentry/relay/blob/master/relay-server/src/actors/project.rs#L177
relay-server/src/actors/processor.rs
Outdated
envelope.add_item(item); | ||
} | ||
} | ||
Ok(mut payloads) => new_profiles.append(&mut payloads), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the advantage of introducing the intermediate vector new_profiles
here, instead of calling envelope.add_item
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would create an endless loop in the outer loop, since that runs until there's no more profiling item in the envelope.
relay-server/src/actors/processor.rs
Outdated
let context = &state.envelope_context; | ||
let new_profiles: &mut Vec<Vec<u8>> = &mut Vec::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be declared a Vec
directly and use type inference.
* master: fix(profiling): Expand all Profile items in an envelope (#1465)
This fixes the last 2 remaing issues introduced by my recent PRs:
Profile
items if the organization doesn't have profiling enabledProfile
items in an envelope as opposed to jus the first one