Skip to content
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

RxWorkflowNode causes CancellationException #350

Open
CherryPerry opened this issue Jan 25, 2022 · 2 comments · May be fixed by #353
Open

RxWorkflowNode causes CancellationException #350

CherryPerry opened this issue Jan 25, 2022 · 2 comments · May be fixed by #353
Assignees
Labels
bug Something isn't working

Comments

@CherryPerry
Copy link
Collaborator

CherryPerry commented Jan 25, 2022

  1. Setup proper exception handling (either real app or RxError JUnit rule)
  2. Subscribe to waitForChildAttached when child is not and and won't be attached
  3. Do not unsubscribe
  4. Invoke onDestroy of the node
  5. See CancellationException

Single should not use takeUntil for disposing subscription, it triggers CancellationException because Single is forced to send either item or error.

@CherryPerry CherryPerry added the bug Something isn't working label Jan 25, 2022
@CherryPerry CherryPerry self-assigned this Jan 25, 2022
@CherryPerry
Copy link
Collaborator Author

@zsoltk Actually, what behaviour do we want? If we silently dispose subscription when one of the nodes in the workflow becomes unavailable then it might be unexpected, especially when you are treating workflow as Completable which leads to onComplete callback when it was canceled. If we throw error, then it should be handled by a client (at least swallowed with empty onError block).

Would prefer error with better description.

@zsoltk
Copy link
Contributor

zsoltk commented Jan 29, 2022

We can offer two similarly named methods for the two use cases. One for "If this child attaches, I'll want to do something with it; if it doesn't, I don't care", one for "I expect this child to be attached; if it doesn't, it's an issue".

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

Successfully merging a pull request may close this issue.

2 participants