Description
I'm running into intermittent cases when using AndroidSchedulers.mainThread()
(which is just a wrapper around AndroidSchedulers.handerThread()
) where the onError
event is not being delivered to the main thread.
I have a gist showing my logs: https://gist.github.com/vinc3m1/dc9232653a22f8f2d900
It seems the onError event is propagated all the way up until .observeOn(AndroidSchedulers.mainThread()
. After which in some (seemingly random) cases it's not delivered. And the cause appears to be that innerSubscription
is reporting itself to be unsubscribed.
So my main questions are:
- Should we even be doing the isUnsubscribed check on
innerSubscription
if we already havehandler.removeCallbacks(runnable)
to handle unsubscribe events? - Should
innerSubscription
be reportingisUnsubscribed == true
when nothing else is unsubscribing from it?
Also, I'm using rather complex combination of map
, flatmap
, and combineLatest
upstream, is it possible that some combinations of these are causing innerSubscription
to be unsubscribed?