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

flushOnLaunch() does not cancel previous requests if they timeout, leading to potential duplicate reports #593

Merged
merged 2 commits into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### Bug fixes

* flushOnLaunch() does not cancel previous requests if they timeout, leading to potential duplicate reports
[#593](https://github.com/bugsnag/bugsnag-android/pull/593)

* Alter value collected for device.freeDisk to collect usable space in internal storage,
rather than total space in internal/external storage
[#589](https://github.com/bugsnag/bugsnag-android/pull/589)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ void flushOnLaunch() {
List<File> storedFiles = findStoredFiles();
final List<File> crashReports = findLaunchCrashReports(storedFiles);

// cancel non-launch crash reports
storedFiles.removeAll(crashReports);
cancelQueuedFiles(storedFiles);

if (!crashReports.isEmpty()) {

// Block the main thread for a 2 second interval as the app may crash very soon.
Expand Down Expand Up @@ -102,7 +106,6 @@ public void run() {
}
Logger.info("Continuing with Bugsnag initialisation");
}
cancelQueuedFiles(storedFiles); // cancel all previously found files
}

flushAsync(); // flush any remaining errors async that weren't delivered
Expand Down