You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Case 2: Connected to network (Wifi/Mobile Data is ON and the network has INTERNET SERVICE)
onError (error ->) is called when response was failed such as 404, etc.
onSuccess (result ->) is called when response was success
All Good! BUT due to unknown circumstances sometimes I got A/INTERCEPT: FALLBACK TO CACHE CANCELED
from the Interceptor and when this happen I don't receive any callbacks neither onError nor onSuccess thus the UI for loading never ends.
Case 3: Connected to network (Wifi/Mobile Data is ON but the network has NO INTERNET SERVICE)
Interceptor : A/INTERCEPT: FALLBACK TO CACHE Unable to resolve host "some.host.com": No address associated with hostname
onError (error ->) is not called
onSuccess (result ->) is not called
As you can see, my Interceptor log here is just the same in our first case yet no callback has been return even a cache is available thus the UI for loading never ends again.
dependencies
implementation 'com.squareup.moshi:moshi-kotlin:1.11.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
// (see https://github.com/ReactiveX/RxJava/releases for latest 3.x.x version)
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
The text was updated successfully, but these errors were encountered:
ArcherEmiya05
changed the title
Interceptor not returning callbacks of RxJava
Interceptor occasionally not returning callbacks of RxJava
Apr 28, 2021
I am having trouble with Interceptor as it does not call
onError
noronSuccess
on specific scenarioThis is my interface class
Fetching it with this
Case 1: No network (Wifi/Mobile Data is OFF)
Interceptor :
A/INTERCEPT: FALLBACK TO CACHE Unable to resolve host "some.host.com": No address associated with hostname
onError (error ->) is called if no cache
onSuccess (result ->) is called if cache is available
All Good! We show error UI to user during offline mode if no cache exist else we show the list if cache is at least available.
========================================================================
Case 2: Connected to network (Wifi/Mobile Data is ON and the network has INTERNET SERVICE)
onError (error ->) is called when response was failed such as 404, etc.
onSuccess (result ->) is called when response was success
All Good! BUT due to unknown circumstances sometimes I got
A/INTERCEPT: FALLBACK TO CACHE CANCELED
from the
Interceptor
and when this happen I don't receive any callbacks neither onError nor onSuccess thus the UI for loading never ends.========================================================================
Case 3: Connected to network (Wifi/Mobile Data is ON but the network has NO INTERNET SERVICE)
Interceptor :
A/INTERCEPT: FALLBACK TO CACHE Unable to resolve host "some.host.com": No address associated with hostname
onError (error ->) is not called
onSuccess (result ->) is not called
As you can see, my
Interceptor
log here is just the same in our first case yet no callback has been return even a cache is available thus the UI for loading never ends again.dependencies
The text was updated successfully, but these errors were encountered: