Skip to content
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

bug(replays): Fix error where some recordings can not be parsed due to type errors #1765

Merged
merged 4 commits into from
Jan 20, 2023

Conversation

cmanallen
Copy link
Member

@cmanallen cmanallen commented Jan 19, 2023

closes: https://github.com/getsentry/replay-backend/issues/258

Sentry event timestamps can be float or integer type. Additionally id fields can be negative so we're using i32 now.

@cmanallen cmanallen requested review from a team and JoshFerge January 19, 2023 23:50
Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

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

Overall LGTM.
Left also a small question.

@@ -313,7 +313,7 @@ struct MetaEvent {
struct CustomEvent {
#[serde(rename = "type")]
ty: u8,
timestamp: f64,
timestamp: Value,
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to parse this into proper Timestamp? Like in the event protocol:

pub timestamp: Annotated<Timestamp>,

Copy link
Contributor

@olksdr olksdr Jan 20, 2023

Choose a reason for hiding this comment

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

Or it can be just DateTime that serde supports

},
{
"type": 5,
"timestamp": 1658770772,
Copy link
Member

Choose a reason for hiding this comment

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

Did this actually fail to parse as f64?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jjbayer You're right. I had test coverage that was failing but 1658770772.0 (instead of 1658770772) should be reasonably parse-able by the UI. I think its okay to leave this as f64.

Copy link
Member

Choose a reason for hiding this comment

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

assert-json-diff seems to have a more lenient compare mode, with which you might be able to keep the test cases:

https://docs.rs/assert-json-diff/latest/assert_json_diff/enum.NumericMode.html#variant.AssumeFloat

@cmanallen cmanallen merged commit b091d55 into master Jan 20, 2023
@cmanallen cmanallen deleted the replays-add-looser-type-requirements branch January 20, 2023 20:32
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants