-
Notifications
You must be signed in to change notification settings - Fork 70
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
Upgrade to Kotlin 1.3 #185
Conversation
e133304
to
d4c3caf
Compare
@@ -77,6 +77,8 @@ class WorkflowOperatorsTest { | |||
states.cancel() | |||
|
|||
assertThat(subscribeCount).isEqualTo(1) | |||
assertThat(disposeCount).isEqualTo(1) | |||
// For some reason the observable is actually disposed twice. Seems like a coroutines bug, but | |||
// Disposable.dispose() is an idempotent operation so it should be fine. |
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.
Interesting... I assume that's regression, worth filing Kotlin bug?
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.
I believe so. I'll try to isolate and file this week.
@@ -77,6 +78,11 @@ class EventSelectBuilder<E : Any, R : Any> internal constructor( | |||
*/ | |||
@PublishedApi | |||
internal val scope = CoroutineScope(Unconfined + selectionJob) | |||
.apply { | |||
coroutineContext[Job]!!.invokeOnCompletion { cause -> | |||
cause?.printStackTrace() |
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.
Sketchy in production code?
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.
Oops, didn't mean to leave this in.
@@ -113,6 +115,7 @@ fun <S : Any, E : Any, O1 : Any, O2 : Any> Workflow<S, E, O1>.mapResult( | |||
// Propagate cancellation upstream. | |||
transformedResult.invokeOnCompletion { cause -> | |||
if (cause != null) { | |||
@Suppress("DEPRECATION") |
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.
Worth noting why we can't use the un-deprecated path, if there is one.
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.
Filed #188 and added TODOs.
@@ -165,6 +167,7 @@ class ChannelSubscriptionsIntegrationTest { | |||
workflow.testFromStart(true) { host -> | |||
assertFalse(host.hasOutput) | |||
|
|||
@Suppress("DEPRECATION") |
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.
Another spot for a note about why we have to use deprecated.
Some error handling behavior changed which required changes to how the library handles exceptions and cancellation, as well as a few unit test changes. Closes #35.
d4c3caf
to
20ae6c0
Compare
This branch has 2 commits:
This PR targets the
kotlin-13
branch, which is still a bit old. I want to land on that branch first, before merging master, so that I can upgrade the rewritten workflows code separately.Closes #35.