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

Add unhandled_events field to native payload #445

Merged
merged 8 commits into from
Mar 21, 2019

Conversation

fractalwrench
Copy link
Contributor

Goal

ANR detection delivered in #442 means that the number of unhandled events is no longer necessarily 1 in the latest version of the plugin. This requires a migration of existing payloads to fit the new struct, which adds an explicit unhandled_events field, rather than hardcoding 1.

Changeset

  • Added a NOTIFY_UNHANDLED message to the native bridge, which is invoked whenever an unhandled event occurs, and ultimately increments report->unhandled_events
  • Added unhandled_events field to bugsnag_report, which is serialised rather than '1'
  • Created copy of existing struct in bugsnag_report_v1
  • When reading a report, check the header. If it is v1, read into bugsnag_report_v1, then copy the fields over to bugsnag_report.

Tests

  • Added test for session JSON serialisation in native reports
  • Added test for payload migration
  • Manually tested in an example app by:
    • Triggering a native crash with v4.12.0 and delivering a report
    • Triggering a native crash with v4.12.0, upgrading to a locally installed artefact, and then delivering the v1 report
    • Triggering a native crash with a local artefact to test the v2 report

@fractalwrench fractalwrench changed the base branch from master to android-anr-detection March 19, 2019 15:01
@fractalwrench fractalwrench changed the base branch from android-anr-detection to anr-detection March 19, 2019 15:01
@fractalwrench fractalwrench merged commit d3cfcb6 into anr-detection Mar 21, 2019
@fractalwrench fractalwrench deleted the anr-detection-ndk branch March 21, 2019 21:41
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.

2 participants