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

Attempt delivery on crash if configured #1749

Merged

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Sep 30, 2022

Goal

Attempt to deliver crashes when they happen if configured.

Design

The DeliveryDelegate.cacheEvent flag for attemptSent now attempts immediate delivery of just that single event

Testing

A new test scenario was introduced to test that a crash can be delivered without a fixture restart.

@lemnik lemnik requested a review from kstenerud September 30, 2022 16:22
@lemnik lemnik marked this pull request as ready for review September 30, 2022 16:22
@lemnik lemnik force-pushed the PLAT-8969/attempt-delivery-on-crash branch from e8554c5 to f1da738 Compare September 30, 2022 16:23
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Sep 30, 2022

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1868.8 1616.38
arm64_v8a 655.76 405.9
armeabi_v7a 590.23 340.37
x86 729.47 479.61
x86_64 700.8 450.95

Generated by 🚫 Danger

@lemnik lemnik force-pushed the PLAT-8969/attempt-delivery-on-crash branch 3 times, most recently from 2129dac to 0ec3bf5 Compare October 3, 2022 13:57
@@ -55,7 +56,11 @@ void deliver(@NonNull Event event) {
String severityReasonType = event.getImpl().getSeverityReasonType();
boolean promiseRejection = REASON_PROMISE_REJECTION.equals(severityReasonType);
boolean anr = event.getImpl().isAnr(event);
cacheEvent(event, anr || promiseRejection);
if (immutableConfig.getAttemptDeliveryOnCrash()) {
cacheAndSendSynchronously(event);
Copy link
Contributor

Choose a reason for hiding this comment

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

DeliveryDelegate.deliver gets called for all kinds of higher level errors, including ANRs and handled errors (via Client.populateAndNotifyAndroidEvent). I don't think we should be blocking the thread for ANRs and non-fatal events.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree on ANRs and such. I'll modify the order of these if checks to only act on unhandled errors that were not previously attemptSend.

@lemnik lemnik force-pushed the PLAT-8969/attempt-delivery-on-crash branch from 0ec3bf5 to 709819a Compare October 4, 2022 15:33
@lemnik lemnik requested a review from kstenerud October 4, 2022 15:34
… `ImmutableConfig` and allow a 3 second timeout during crash to attempt delivery
@lemnik lemnik force-pushed the PLAT-8969/attempt-delivery-on-crash branch from 709819a to bf249d7 Compare October 4, 2022 15:41
@lemnik lemnik merged commit 631e7dd into integration/deliver-on-crash Oct 5, 2022
@lemnik lemnik deleted the PLAT-8969/attempt-delivery-on-crash branch October 5, 2022 08:51
@lemnik lemnik mentioned this pull request Oct 6, 2022
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