diff --git a/changelog.d/3086.bugfix b/changelog.d/3086.bugfix new file mode 100644 index 0000000000..da39ba616f --- /dev/null +++ b/changelog.d/3086.bugfix @@ -0,0 +1 @@ +Make sure we don't use the main dispatcher while closing the bug report request, as it can lead to crashes in strict mode. diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/reporter/DefaultBugReporter.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/reporter/DefaultBugReporter.kt index 9e89ff9a76..f9f8d7e5b9 100755 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/reporter/DefaultBugReporter.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/reporter/DefaultBugReporter.kt @@ -282,11 +282,13 @@ class DefaultBugReporter @Inject constructor( listener.onUploadFailed(serverError) } } finally { - // delete the generated files when the bug report process has finished - for (file in bugReportFiles) { - file.safeDelete() + withContext(coroutineDispatchers.io) { + // delete the generated files when the bug report process has finished + for (file in bugReportFiles) { + file.safeDelete() + } + response?.close() } - response?.close() } }