-
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
bug(replays): Fix error where some recordings can not be parsed due to type errors #1765
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.
Overall LGTM.
Left also a small question.
relay-replays/src/recording.rs
Outdated
@@ -313,7 +313,7 @@ struct MetaEvent { | |||
struct CustomEvent { | |||
#[serde(rename = "type")] | |||
ty: u8, | |||
timestamp: f64, | |||
timestamp: Value, |
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.
Would it be better to parse this into proper Timestamp
? Like in the event protocol:
relay/relay-general/src/protocol/event.rs
Line 331 in 7834adb
pub timestamp: Annotated<Timestamp>, |
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.
Or it can be just DateTime
that serde
supports
}, | ||
{ | ||
"type": 5, | ||
"timestamp": 1658770772, |
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.
Did this actually fail to parse as f64
?
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.
@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.
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.
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
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.