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
TimeoutCancellationException is thrown inconsistently between flatMapConcat and flatMapLatest #3392
Comments
Digging deeper and I'm not sure whether this is an issue or not - or the right issue perhaps. I guess it depends on what TimeoutCancellationException is meant to be treated as - is it meant inherit the semantics of CancellationException which it extends - i.e. "It indicates normal cancellation of a coroutine." or does it override that to be used for "unexpected" cancellation of a coroutine? |
I noticed
It does say in
|
This is not an inconsistency, but rather a semantic difference: see #2964 with an explanation and #2942 with actual rationale. Documentation could've been better here though.
It is the former, but it should be the latter: #1374. Right now it's just our design mistake that is really tough to fix |
I appreciate the clarification, thanks very much |
In the code below, the TimeoutCancellationException thrown by
withTimeout
is propagated as expected when usingflatMapConcat
, but not propagated when usingflatMapLatest
.If
withTimeout
is replaced withcheck(false)
, the exception is propagated as expected in both.Produces:
The text was updated successfully, but these errors were encountered: