From 9c926fd6e2a07a9b6ada9b959b8b40178d703042 Mon Sep 17 00:00:00 2001 From: Josh Skeen Date: Tue, 26 Jul 2022 14:52:43 -0400 Subject: [PATCH] Event delivery with an event.isUnhandled = true should behave similarly to ExceptionHandler.uncaughtException's delivery In the case where client.notify is called and the event is modified to be treated as unhandled: ```java client.notify(throwable, new OnErrorCallback() { @Override public boolean onError(@NonNull Event event) { event.setUnhandled(true); ... } }); ``` we should cache the event, similar to how it is done for an unhandled exception. With an unhandled exception, the app's availability will cease - and if we are marking an event as unhandled, we are indicating this will be the case. --- .../src/main/java/com/bugsnag/android/DeliveryDelegate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bugsnag-android-core/src/main/java/com/bugsnag/android/DeliveryDelegate.java b/bugsnag-android-core/src/main/java/com/bugsnag/android/DeliveryDelegate.java index d9dd1aa168..dbf938ec27 100644 --- a/bugsnag-android-core/src/main/java/com/bugsnag/android/DeliveryDelegate.java +++ b/bugsnag-android-core/src/main/java/com/bugsnag/android/DeliveryDelegate.java @@ -50,7 +50,7 @@ void deliver(@NonNull Event event) { } } - if (event.getImpl().getOriginalUnhandled()) { + if (event.isUnhandled() || event.getImpl().getOriginalUnhandled()) { // should only send unhandled errors if they don't terminate the process (i.e. ANRs) String severityReasonType = event.getImpl().getSeverityReasonType(); boolean promiseRejection = REASON_PROMISE_REJECTION.equals(severityReasonType);