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
1.x async Singles crashes for Exceptions thrown in onSuccess #5237
Comments
Looks like the lambda-subscriber on Single.java:1777 needs some catch clauses. Would you like to submit a PR? |
I just compared this to the
Is it ok to call |
No. The protocol states |
When implementing the bugfix I think that a Can you give me insights why a |
Because nobody has written it.
|
Which kind of makes sense since onSuccess | onError are terminal events and should be treated equally, otherwise an exception in onSuccess would call onError but one in onError would crash. |
Ah, I see |
Closing this as won't fix. We discussed in #5710 that changing this would have to prevent synchronous exceptions being thrown that could be relied upon by existing code. |
Since 1.2.2 tested with
1.2.9
Single
doesn't wrap theSingleSubscriber
automatically in aSafeSubscriber
. This leads to problems when anExceptions
is thrown ononSuccess
. It will not be propagated toonError
for async Singles.From the changelog 1.2.2 I can see this has performance reasons. But the problem is that async Singles now behave differently than sync Singles, or Observables sync or async.
After thinking about this case 1 is the one which is buggy. The synchronous
Single
should crash like the asyncSingle
case. Analog to the implementation in rx2The text was updated successfully, but these errors were encountered: