-
-
Notifications
You must be signed in to change notification settings - Fork 206
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: FormatException
when reading ProcessorFrequency
#3541
Conversation
ProcessorFrequency
FormatException
when reading ProcessorFrequency
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.
LGTM but would be good to update our unit tests to match as well.
src/Sentry/Protocol/Device.cs
Outdated
// The Java SDK reports the processorFrequency as `double` | ||
// Java https://github.com/getsentry/sentry-java/blob/9762f09afa51944b40a9b77e116a55e54636e6c5/sentry/src/main/java/io/sentry/protocol/Device.java#L130 | ||
int? processorFrequency = null; | ||
var processorFrequencyProperty = json.GetPropertyOrNull("processor_frequency"); |
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.
Should we change one of our tests as well (to make sure it works when deserialising a double)?
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.
AFAIK, we don't have any tests for Device
as it's not doing anything. But the type-mismatch is obvious from looking at the Java code.
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.
I don't want to argue against writing tests. I've added it to #3542
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.
Just missing some tests that cover cases int, double and something invalid like string.
Fixes #3540