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 complex types in NDK metadata #1715

Merged
merged 12 commits into from
Jun 29, 2022
Merged

Handle complex types in NDK metadata #1715

merged 12 commits into from
Jun 29, 2022

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Jun 28, 2022

Goal

Report all metadata added in the Java/Kotlin API in NDK events, rather than only types that can be directly manipulated from the C API.

Increase the maximum size of metadata section names and keys in NDK events to 64 bytes (including a null-terminator) instead of 32.

Design

Metadata that cannot be directly represented by the existing C model is now masked as an BSG_METADATA_OPAQUE_VALUE metadata value. These values are pre-encoded as JSON by the NDK plugin before being delivered as a string to the C layer.

The direct effect is:

  • Strings will not be truncated to 63 characters, but will instead become OPAQUE if they are too long
  • Maps and Lists will be included in NDK error reports (including any nested structures)

Testing

New unit tests and modified end-to-end tests ensure that no metadata is lost in a native event. The CXX signal test was modified to test the "clear" APIs within the C on_error handler, which requires async safety.

@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Jun 28, 2022

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1878.61 1629.83
arm64_v8a 659.85 414.09
armeabi_v7a 594.32 348.56
x86 733.56 487.8
x86_64 704.9 459.14

Generated by 🚫 Danger

@lemnik lemnik requested a review from tomlongridge June 28, 2022 09:06
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