Merge branch '0.7.x'

This commit is contained in:
Mikołaj Pich 2019-03-26 21:22:17 +01:00
commit 1ebc296bfe
No known key found for this signature in database
GPG Key ID: F62B26E36D4C4BAA
4 changed files with 20 additions and 10 deletions

View File

@ -16,8 +16,8 @@ android {
testApplicationId "io.github.tests.wulkanowy" testApplicationId "io.github.tests.wulkanowy"
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 28 targetSdkVersion 28
versionCode 28 versionCode 29
versionName "0.7.2" versionName "0.7.3"
multiDexEnabled true multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true

View File

@ -19,7 +19,11 @@ import io.github.wulkanowy.di.DaggerAppComponent
import io.github.wulkanowy.services.sync.SyncWorkerFactory import io.github.wulkanowy.services.sync.SyncWorkerFactory
import io.github.wulkanowy.utils.CrashlyticsTree import io.github.wulkanowy.utils.CrashlyticsTree
import io.github.wulkanowy.utils.DebugLogTree import io.github.wulkanowy.utils.DebugLogTree
import io.reactivex.exceptions.UndeliverableException
import io.reactivex.plugins.RxJavaPlugins
import timber.log.Timber import timber.log.Timber
import java.io.IOException
import java.lang.Exception
import javax.inject.Inject import javax.inject.Inject
class WulkanowyApp : DaggerApplication() { class WulkanowyApp : DaggerApplication() {
@ -42,6 +46,7 @@ class WulkanowyApp : DaggerApplication() {
if (DEBUG) enableDebugLog() if (DEBUG) enableDebugLog()
AppCompatDelegate.setDefaultNightMode(prefRepository.currentTheme) AppCompatDelegate.setDefaultNightMode(prefRepository.currentTheme)
WorkManager.initialize(this, Configuration.Builder().setWorkerFactory(workerFactory).build()) WorkManager.initialize(this, Configuration.Builder().setWorkerFactory(workerFactory).build())
RxJavaPlugins.setErrorHandler(::onError)
} }
private fun enableDebugLog() { private fun enableDebugLog() {
@ -56,6 +61,12 @@ class WulkanowyApp : DaggerApplication() {
Timber.plant(CrashlyticsTree()) 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<out DaggerApplication> { override fun applicationInjector(): AndroidInjector<out DaggerApplication> {
return DaggerAppComponent.builder().create(this) return DaggerAppComponent.builder().create(this)
} }

View File

@ -19,7 +19,6 @@ import io.github.wulkanowy.services.sync.channels.DebugChannel
import io.github.wulkanowy.services.sync.works.Work import io.github.wulkanowy.services.sync.works.Work
import io.github.wulkanowy.utils.getCompatColor import io.github.wulkanowy.utils.getCompatColor
import io.reactivex.Completable import io.reactivex.Completable
import io.reactivex.Flowable
import io.reactivex.Single import io.reactivex.Single
import timber.log.Timber import timber.log.Timber
import kotlin.random.Random import kotlin.random.Random
@ -42,12 +41,12 @@ class SyncWorker @AssistedInject constructor(
.flatMapCompletable { student -> .flatMapCompletable { student ->
semesterRepository.getCurrentSemester(student, true) semesterRepository.getCurrentSemester(student, true)
.flatMapCompletable { semester -> .flatMapCompletable { semester ->
Completable.mergeDelayError(Flowable.fromIterable(works.map { work -> Completable.mergeDelayError(works.map { work ->
work.create(student, semester) work.create(student, semester)
.doOnSubscribe { Timber.i("${work::class.java.simpleName} is starting") } .doOnSubscribe { Timber.i("${work::class.java.simpleName} is starting") }
.doOnError { Timber.i("${work::class.java.simpleName} result: An exception occurred") } .doOnError { Timber.i("${work::class.java.simpleName} result: An exception occurred") }
.doOnComplete { Timber.i("${work::class.java.simpleName} result: Success") } .doOnComplete { Timber.i("${work::class.java.simpleName} result: Success") }
}), 3) })
} }
} }
.toSingleDefault(Result.success()) .toSingleDefault(Result.success())

View File

@ -1,6 +1,6 @@
Naprawiliśmy: Wersja 0.7.3
- 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
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