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

Handle NaN & Infinity values in serialization #1958

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Dec 15, 2023

Goal

Avoid creating invalid / incomplete event payloads when metadata includes non-finite values (typically via ReactNative).

Design

The non-finite double values (NaN, -Infinity and +Infinity) are now omitted (along with any associated keys) instead of throwing an IllegalArgumentException

Testing

Adjusted the existing unit tests.

@lemnik lemnik requested review from tomlongridge and a user December 15, 2023 14:07
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Dec 15, 2023

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1842.7 1668.32
arm64_v8a 626.95 450.82
armeabi_v7a 561.42 385.29
x86 700.66 524.53
x86_64 671.99 495.86

Generated by 🚫 Danger

…a`, `breadcrumbs`, and `featureFlags` to be missing from the marshalled JSON without causing a deserialization failure
@lemnik lemnik force-pushed the PLAT-11342/handle-nan-infinity-values branch from 14a006d to dcb3b12 Compare January 26, 2024 09:13
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM

@lemnik lemnik merged commit 59adb78 into next Jan 26, 2024
27 checks passed
@lemnik lemnik deleted the PLAT-11342/handle-nan-infinity-values branch January 26, 2024 17:20
@ghost ghost mentioned this pull request Feb 8, 2024
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.

3 participants