Give upstream a chance to create new elements in collectLatest - #4493
Open
dkhalanskyjb wants to merge 1 commit into
Open
Give upstream a chance to create new elements in collectLatest#4493dkhalanskyjb wants to merge 1 commit into
dkhalanskyjb wants to merge 1 commit into
Conversation
murfel
added a commit
that referenced
this pull request
Aug 8, 2025
… change them in #4493) + reformat
qwwdfsad
approved these changes
Sep 14, 2025
qwwdfsad
left a comment
Member
There was a problem hiding this comment.
The change itself looks good, but that's a breaking change that potentially affects every other coroutine user (i.e. observable and probably heavily dependent on).
Please handle it as a proper breaking change -- evaluation stage (ktor, ultimate, kotlinx-rpc etc.), a dedicated section in the changelog, emphasized on RC/Beta stage etc.
Collaborator
Author
|
The idea was to join this change together with #4489, since they both concern |
murfel
reviewed
Feb 17, 2026
Comment on lines
+79
to
+80
| 9 -> expect(3) | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| 9 -> expect(3) | |
| } | |
| 9 -> expect(3) | |
| else -> expectUnreached() | |
| } |
| /** Tests that if new values appear immediately, they cancel processing the old value. */ | ||
| @Test | ||
| fun testNoSuspension() = runTest { | ||
| flowOf(3, 2, 1).collectLatest { value -> |
Contributor
There was a problem hiding this comment.
Suggested change
| flowOf(3, 2, 1).collectLatest { value -> | |
| flowOf(99, 98, 1).collectLatest { value -> |
murfel
approved these changes
Feb 17, 2026
This file contains hidden or 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
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.
Fixes #3109
Fixes #3679
We will need to combine this with a fix for #4383 (which also affects the dispatching behavior of
*Latest) and evaluate both on large existing codebases before publishing a release.