Skip to content

Commit

Permalink
Merge pull request #593 from bugsnag/cancel-queued-files
Browse files Browse the repository at this point in the history
flushOnLaunch() does not cancel previous requests if they timeout, leading to potential duplicate reports
  • Loading branch information
fractalwrench authored Sep 23, 2019
2 parents b0c6897 + 4694ad8 commit 7d84452
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit 7d84452

Please sign in to comment.