Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

Fixes #3540

@bitsandfoxes bitsandfoxes mentioned this pull request Aug 16, 2024
6 tasks
@bitsandfoxes bitsandfoxes changed the title fix: Reading ProcessorFrequency fix: FormatException when reading ProcessorFrequency Aug 16, 2024
Copy link
Collaborator

@jamescrosswell jamescrosswell left a 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.

// 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");
Copy link
Collaborator

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)?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Member

@bruno-garcia bruno-garcia left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] FormatException when reading "processor_frequency"

4 participants