-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(stacktrace): Skip serializing some null values in frames interface #944
Conversation
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.
Before merging this, please do a careful audit of Sentry code to ensure that no code expects these attributes to be present. This is effectively a schema change, and thus has the potential to introduce regressions in Sentry, which we do not have E2E tests here.
@@ -93,6 +95,7 @@ pub struct Frame { | |||
pub pre_context: Annotated<Array<String>>, | |||
|
|||
/// Source code of the current line (`lineno`). | |||
#[metastructure(skip_serialization = "empty")] |
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 be null
. We use context_line
in Sentry to check if there is source context, and in theory the context line can be an empty string.
@@ -104,6 +107,7 @@ pub struct Frame { | |||
/// | |||
/// Setting this attribute to `false` causes the frame to be hidden/collapsed by default and | |||
/// mostly ignored during issue grouping. | |||
#[metastructure(skip_serialization = "empty")] |
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.
Empty
for booleans and numbers is always false, so let's use null
in those instances, too.
I've verified that none of those values are required by the frames interface in Sentry nor the Snuba errors processor. |
1bf7239
to
e0d040e
Compare
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.
Approving with my comments considered.
pub context_line: Annotated<String>, | ||
|
||
/// Source code of the lines after `lineno`. | ||
#[metastructure(skip_serialization = "empty")] | ||
#[metastructure(skip_serialization = "null")] |
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.
empty
is fine for the arrays, especially since you only changed it for post_context
but not pre_context
. Let's stick with empty
.
@@ -124,15 +130,18 @@ pub struct Frame { | |||
/// If this is set and a known image is defined in the | |||
/// [Debug Meta Interface]({%- link _documentation/development/sdk-dev/event-payloads/debugmeta.md -%}), | |||
/// then symbolication can take place. | |||
#[metastructure(skip_serialization = "empty")] |
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.
Since these are scalar values, let's use null
here.
Noticed this while reviewing events: We serialize a lot of
null
keys for every frame which are not necessary on all platforms.