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

Support changing NDK Event's api key in OnErrorCallback #964

Merged
merged 7 commits into from Oct 28, 2020

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Oct 20, 2020

Goal

Adds support for changing the apiKey on events from the NDK layer. #928 added equivalent functionality for JVM events.

Changeset

The changeset consists mainly of five alterations:

  1. Passing the api key to the NDK layer via a StateEvent.Install message
  2. Populating the api key on the bugsnag_event struct, which requires a migration for legacy persisted structs
  3. Adding accessors to the NDK API for altering the API key on an event
  4. Decoding the apiKey from C struct in deliverPendingReports() and pass to the JVM layer along with the deserialized event payload

Testing

Existing unit and integration tests have been updated to match the new assertions. New test cases have also been added for additional coverage and to verify the NDK migration.

Manual testing also covered:

  • Unhandled NDK events are delivered
  • API key can be changed on an Unhandled NDK event
  • Unhandled NDK events using v3 of the bugsnag_event struct are delivered

@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Oct 20, 2020

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1440.18 1361.29
arm64_v8a 369.25 287.33
armeabi 348.76 266.85
armeabi_v7a 332.39 250.47
x86 406.1 328.28
x86_64 389.72 307.81

Generated by 🚫 Danger

@fractalwrench fractalwrench changed the title Allow overring api key on NDK events Allow overriding api key on NDK events Oct 20, 2020
@fractalwrench fractalwrench changed the title Allow overriding api key on NDK events Support changing NDK Event's api key in OnErrorCallback Oct 20, 2020
@fractalwrench fractalwrench marked this pull request as ready for review October 20, 2020 12:14
@fractalwrench
Copy link
Contributor Author

Updated to avoid encoding the apiKey in the NDK filename. Retested by setting the apiKey in an example app and triggering an NDK crash.

Copy link
Contributor

@tomlongridge tomlongridge left a comment

Choose a reason for hiding this comment

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

LGTM.

I think the changeset details in the PR description just need a slight amendment now the NDK file name format has not changed?

@fractalwrench fractalwrench merged commit 747bfb5 into next Oct 28, 2020
@fractalwrench fractalwrench deleted the PLAT-5012/ndk-event-api-key branch October 28, 2020 09:25
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.

None yet

3 participants