Skip to content

Commit

Permalink
fix: avoid attempting to flush unhandled error reports in same session
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Jul 15, 2020
1 parent e6d6890 commit a65addf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## TBD

* Avoid attempting to flush unhandled error reports in same session
[#902](https://github.com/bugsnag/bugsnag-android/pull/902)

## 5.0.0 (2020-04-22)

__This version contains many breaking changes__. It is part of an effort to unify our notifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,23 @@ void deliver(@NonNull Event event) {
}

if (event.isUnhandled()) {
cacheEvent(event, true);
cacheEvent(event, isAnr(event));
} else {
deliverPayloadAsync(event, eventPayload);
}
}

private boolean isAnr(@NonNull Event event) {
List<Error> errors = event.getErrors();
String errorClass = null;

if (!errors.isEmpty()) {
Error error = errors.get(0);
errorClass = error.getErrorClass();
}
return "ANR".equals(errorClass);
}

private void deliverPayloadAsync(@NonNull Event event, EventPayload eventPayload) {
final EventPayload finalEventPayload = eventPayload;
final Event finalEvent = event;
Expand Down

0 comments on commit a65addf

Please sign in to comment.