Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Exception in side effect with multiple side effects will crash process #22

Open
vincentbrison opened this issue Nov 5, 2018 · 6 comments
Labels
bug Something isn't working

Comments

@vincentbrison
Copy link

When having multiple side effects for a rxredux stream, if an exception occurs during the execution of the stream, the process will crash. The process wont crash if there is only one side effect for the given rxredux.

You can recreate the issue launching the Android app from https://github.com/vincentbrison/rxredux-sideeffect-issue

The full test case can be find in the ReduxTestError.kt file.

The excepted behavior should be the process does not crash if a side effect throw an error?

@sockeqwe
Copy link
Contributor

sockeqwe commented Nov 5, 2018

Thanks for reporting this issue and providing a sample that reproduces this issue.

Indeed, this seems to be a bug. It should not crash (unless you specify your own RxJava crash handler) but rather call the onError callback in both cases.

@sockeqwe sockeqwe added the bug Something isn't working label Nov 5, 2018
@vincentbrison
Copy link
Author

Hello, is this something you may address in the futur? Thanks!

@sockeqwe
Copy link
Contributor

We didn't have time to look into this in detail yet, but yes, we should fix that. In case you would like to look deeper in it, we would appreciate it. Otherwise, we are going to work on it at the first week of December.

@vincentbrison
Copy link
Author

Thanks for your quick response, that is good to know!

I did take a look, but I have limited knowledge in implementing custom Observable, so I am not sure to find something useful yet.

@sockeqwe
Copy link
Contributor

We are definitely looking into it but most likely we can't do it in November.

@vincentbrison
Copy link
Author

Thanks for giving this feedback :). This is not a blocking issue, since we could avoid it using error handling operators on side effects.

From what I see, the issue may come from

actionsSubject.onError(error) // Error in SideEffect causes whole stream to fail

All sides effects are subscribed to actionsSubject. More than one side effect will result in more than one actionsSubject.onError(error) for a given error (sort of a loop of error in the stream).

A solution (a hack?) could be to replace L161 actionsSubject.onError(error) by storeObserver.onError(error) to avoid to resend the error into actionsSubject stream and then avoid re trigger onError from other side effects.

Again, my understanding of custom observable is limited so it is just a guess ;).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants