File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
components-core/src/main/java/com/adyen/checkout/components/core/internal/data/api Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import kotlinx.coroutines.currentCoroutineContext
2525import kotlinx.coroutines.delay
2626import kotlinx.coroutines.flow.Flow
2727import kotlinx.coroutines.flow.debounce
28+ import kotlinx.coroutines.flow.filterNot
2829import kotlinx.coroutines.flow.flow
2930import kotlinx.coroutines.flow.map
3031import kotlinx.coroutines.flow.merge
@@ -33,6 +34,7 @@ import kotlinx.coroutines.flow.receiveAsFlow
3334import kotlinx.coroutines.flow.transform
3435import kotlinx.coroutines.isActive
3536import kotlinx.coroutines.withContext
37+ import java.net.UnknownHostException
3638import kotlin.time.Duration.Companion.milliseconds
3739import kotlin.time.Duration.Companion.seconds
3840import kotlin.time.TimeMark
@@ -79,6 +81,11 @@ class DefaultStatusRepository(
7981 .map {
8082 fetchStatus(it)
8183 }
84+ .filterNot {
85+ // For API >= 35, apps lose connectivity if in background. That results in an UnknownHostException here.
86+ // We do not emit this since connection can be recovered and thus, it's not a payment critical failure.
87+ it.exceptionOrNull() is UnknownHostException
88+ }
8289 .transform { result ->
8390 emit(result)
8491
You can’t perform that action at this time.
0 commit comments