-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Innocent observable found dead! Programmer shocked: "but.. I thought that onErrorReturn implementation would keep him safe!" #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't see what this has to do with RxAndroid in particular, since Regardless, I think it's a misunderstanding with how Every What |
|
moral of the story, before you teach a class, make sure you understand the basics of the Rx contract :-) |
Looks like there is no any issues with rxAndroid or rxJava - it was just a misunderstanding on how @headinthebox What I meant was a java class. I am aware that my rx knowledge is too limited to teach. |
The event happened in his class on June 5h, 2015. After an intensive crime scene investigation, it is believed that PublishSubject was used to create an observable/observer, in order to create a search mechanism:
Fields:
Callback called on user's text input change
Code from the "initialize" method, which is called first
The critical point happened when error (mock network error) was returned upon requesting search results from the API:
"the 'onErrorReturn' was invoked, it returned default empty array to the onNext, and even thought I expected that the error was completely swallowed, the searchQuerySubject was killed in the process." - said the witness, who wanted to stay anonymous.
"The user desperately kept inputting letters into the search field, which kept triggering the
searchQuerySubject.onNext(query), but unfortunately, the searchQuerySubject just stopped responding to anything."
The question remains: isn't onErrorReturn implementation meant to swallow all the errors and keep the subject alive, even when network errors happen?
Related cases: ReactiveX/RxJava#1633
The text was updated successfully, but these errors were encountered: