-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
What to do when contract is violated #3612
Comments
No. |
I wouldn't fix this for RxJava 1. I would definitely fix this for RxJava 2. FWIW, RxJava is the only version of Rx that does this. To be clear, this is not to say that Observers/Subscribers that are part of some operator's internals can't behave this way. ... but I'd caution that it's probably extremely rare that an operator would want to hand an error back to it's own observer's error handler, but rather it would probably want to send it on down the line to the next observer in the chain. My 2 cents. Perhaps the better answer here is composing Observers that you use to consume at the tail end. Observers, after all, are just as composable as Observables. |
This is also relevant to the discussion.
|
RS Operators still may fail in corner cases such as stack overflow or OOME which currently isn't handled (ie. no It really depends on how well the users of the library is trusted with their Currently, there are around 200 unit test that are non-RS conformant and are thus disabled; these include a bunch of null users and onNext throwers. In addition, there is a policy that no onErrors should get lost, especially those coming after the terminal state of certain operators, so these are routed to Bottom line is that I don't think this is an issue for us. |
I think the goal of differentiating errors (user errors from library errors) lends towards the goal of ease of use and contribution. For instance, the solution may be a write up of what standard behavior should be conformed to if you write a subscriber to be manually lifted (or an Operator). Or writing basic tests that ensure the functionality of conforming operators. These goals are worthwhile as they make it easier for others to contribute. It's nice that we may not have high exposure to these problems (at the moment) but if we continue to gain more and more external contribution it would be a good idea to have some framework (educational or computationally enforced) that provided assurance that operators and subscribers meet some fundamental standard. |
Any more on this or can it be closed? |
I'm closing this issue due to inactivity. If you have further input on the issue, don't hesitate to reopen this issue or post a new one. |
I was looking at a discussion in the RxJS related to what happens when onNext throws an exception. I'll try to summarize with a simple example. Lets say the map operator is implemented like this:
And the not so good implementation of a downstream subscriber is:
The first question to be answered: is this a problem that should be fix? Yes or No please. We'll get into if it is even possible and the how later.
The text was updated successfully, but these errors were encountered: