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

Upgrade to Kotlin 1.3 #185

Merged
merged 2 commits into from
Mar 18, 2019
Merged

Upgrade to Kotlin 1.3 #185

merged 2 commits into from
Mar 18, 2019

Conversation

zach-klippenstein
Copy link
Collaborator

This branch has 2 commits:

  1. Upgrade the actual dep, fix the imports, and then fix bugs due to changes in error handling behavior.
  2. Fix experimental and deprecation warnings (mostly by just suppressing them).

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.

@zach-klippenstein zach-klippenstein requested a review from rjrjr March 17, 2019 21:36
@zach-klippenstein zach-klippenstein marked this pull request as ready for review March 17, 2019 22:02
@@ -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.

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?

Copy link
Collaborator Author

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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sketchy in production code?

Copy link
Collaborator Author

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")
Copy link
Contributor

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.

Copy link
Collaborator Author

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")
Copy link
Contributor

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.
@zach-klippenstein zach-klippenstein merged commit 073ba0e into kotlin-13 Mar 18, 2019
@zach-klippenstein zach-klippenstein deleted the zachklipp/kotlin13 branch March 18, 2019 18:07
@zach-klippenstein zach-klippenstein added the kotlin Affects the Kotlin library. label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kotlin Affects the Kotlin library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants