-
Notifications
You must be signed in to change notification settings - Fork 129
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
Kotlin-Module: Cancel Multi subscription in case of cancelled coroutine context #734
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heubeck
commented
Oct 24, 2021
Codecov Report
@@ Coverage Diff @@
## main #734 +/- ##
============================================
+ Coverage 89.83% 90.05% +0.22%
- Complexity 2986 2994 +8
============================================
Files 374 374
Lines 11790 11797 +7
Branches 1478 1484 +6
============================================
+ Hits 10591 10624 +33
+ Misses 616 598 -18
+ Partials 583 575 -8
|
…ne context Investivated and fixed due to issue 733: A Kotlin Flow 'first()' aborts the Flow, this was not propagated to the MultiSubscriber. Only after the complete Multi was produced, the Flow terminated. It affected not every Multi, could reproduce it with a Multi.fromEmitter, but not with a Multi.fromTicks. Signed-off-by: Florian Heubeck <[email protected]>
heubeck
force-pushed
the
fix/issue733-BlockingKotlinFlow
branch
from
October 25, 2021 07:08
cc9c64d
to
07dadab
Compare
jponge
approved these changes
Oct 25, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, you can merge! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Investivated and fixed due to issue #733:
A Kotlin Flow 'first()' aborts the Flow, this was not propagated to the
MultiSubscriber. Only after the complete Multi was produced, the Flow
terminated. It affected not every Multi, could reproduce it with a
Multi.fromEmitter, but not with a Multi.fromTicks.
Not absolutely sure, if it fixes #733, but I could reproduce a similar behavior (see the newly added tests).
Remember, we've discussed the meaning of the
CancellationException
, and decided to completely suppress it, as it's (also) a side effect of a coroutine context cancellation, Julien? Feeling a bit stupid now, to not have tested the simple case of aFlow.first()
...