diff --git a/app/build.gradle b/app/build.gradle index 0e4dbd07..63612923 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { testApplicationId "io.github.tests.wulkanowy" minSdkVersion 15 targetSdkVersion 28 - versionCode 28 - versionName "0.7.2" + versionCode 29 + versionName "0.7.3" multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt b/app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt index 68fc7c64..e427647f 100644 --- a/app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt +++ b/app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt @@ -19,7 +19,11 @@ import io.github.wulkanowy.di.DaggerAppComponent import io.github.wulkanowy.services.sync.SyncWorkerFactory import io.github.wulkanowy.utils.CrashlyticsTree import io.github.wulkanowy.utils.DebugLogTree +import io.reactivex.exceptions.UndeliverableException +import io.reactivex.plugins.RxJavaPlugins import timber.log.Timber +import java.io.IOException +import java.lang.Exception import javax.inject.Inject class WulkanowyApp : DaggerApplication() { @@ -42,6 +46,7 @@ class WulkanowyApp : DaggerApplication() { if (DEBUG) enableDebugLog() AppCompatDelegate.setDefaultNightMode(prefRepository.currentTheme) WorkManager.initialize(this, Configuration.Builder().setWorkerFactory(workerFactory).build()) + RxJavaPlugins.setErrorHandler(::onError) } private fun enableDebugLog() { @@ -56,6 +61,12 @@ class WulkanowyApp : DaggerApplication() { Timber.plant(CrashlyticsTree()) } + private fun onError(t: Throwable) { + if (t is UndeliverableException && t.cause is IOException || t.cause is InterruptedException) { + Timber.e(t.cause, "An undeliverable error occurred") + } else throw t + } + override fun applicationInjector(): AndroidInjector { return DaggerAppComponent.builder().create(this) } diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/SyncWorker.kt b/app/src/main/java/io/github/wulkanowy/services/sync/SyncWorker.kt index 36593966..134fb034 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/SyncWorker.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/SyncWorker.kt @@ -19,7 +19,6 @@ import io.github.wulkanowy.services.sync.channels.DebugChannel import io.github.wulkanowy.services.sync.works.Work import io.github.wulkanowy.utils.getCompatColor import io.reactivex.Completable -import io.reactivex.Flowable import io.reactivex.Single import timber.log.Timber import kotlin.random.Random @@ -42,12 +41,12 @@ class SyncWorker @AssistedInject constructor( .flatMapCompletable { student -> semesterRepository.getCurrentSemester(student, true) .flatMapCompletable { semester -> - Completable.mergeDelayError(Flowable.fromIterable(works.map { work -> + Completable.mergeDelayError(works.map { work -> work.create(student, semester) .doOnSubscribe { Timber.i("${work::class.java.simpleName} is starting") } .doOnError { Timber.i("${work::class.java.simpleName} result: An exception occurred") } .doOnComplete { Timber.i("${work::class.java.simpleName} result: Success") } - }), 3) + }) } } .toSingleDefault(Result.success()) diff --git a/app/src/main/play/release-notes/pl-PL/default.txt b/app/src/main/play/release-notes/pl-PL/default.txt index bdf045f5..6cf59d4b 100644 --- a/app/src/main/play/release-notes/pl-PL/default.txt +++ b/app/src/main/play/release-notes/pl-PL/default.txt @@ -1,6 +1,6 @@ -Naprawiliśmy: -- problemy ze stabilnością podczas przełączania zakładek -- nierówność w nawigacji między dniami w planie lekcji i frekwencji -- zły wygląd odświeżania w szczęśliwym numerku +Wersja 0.7.3 -Pełna lista zmian: https://github.com/wulkanowy/wulkanowy/releases/tag/0.7.2 +Naprawiliśmy: +- naprawiono problemy ze stabilnością podczas odświeżania danych + +Pełna lista zmian: https://github.com/wulkanowy/wulkanowy/releases/tag/0.7.3