bugsnag / bugsnag-android

BugSnag crash monitoring and reporting tool for Android apps
https://www.bugsnag.com/platforms/android/
Other
1.18k stars 205 forks source link

NDK JSON Event Writer #2027

Closed lemnik closed 3 months ago

lemnik commented 3 months ago

Goal

Replace the binary event writer with a signal-safe JSON encoder.

Design

Using the same JSON encoder we use in bugsnag-cocoa our signal handler now dumps the event state directly as JSON, allowing more flexibility in the in-memory event model.

The native events are still written to the native directory since the discardClasses cannot be evaluated during the crash. Instead a new ReportDiscardScanner class will evaluate discardClasses and enabledReleaseStages on delivery, using a JsonReader to allow early-exit when either:

Testing

Relied on existing tests, with a simple unit test to ensure that legacy native events are discarded.

bugsnagbot commented 3 months ago

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1844.42 1668.69
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 :no_entry_sign: Danger