https://kotlinlang.org logo
#ktor
Title
# ktor
k

Kris Wong

09/02/2020, 4:43 PM
is it known that the native mock engine is broken in 1.4?
r

russhwolf

09/02/2020, 5:54 PM
What's broken? It's been working fine for me
k

Kris Wong

09/02/2020, 6:01 PM
it does not function at all on iOS
i am assuming it's because there is no 1.4 version published for the native engine
r

russhwolf

09/02/2020, 6:09 PM
There's no dependency named "-native" anymore (same as every other kotlinx lib with the 1.4 updates) but the native platforms still exist. Just include
ktor-client-mock
from your
commonTest
dependencies and let metadata take care of it
k

Kris Wong

09/02/2020, 6:45 PM
that's what I have done
but interestingly there's still a
jvm
variant
but I guess that makes sense because that's a "concrete" artifact, but native isn't. it would be iosArm64, iosX86, etc...
explains why I don't get build or runtime errors. but the handler is still not receiving any requests (and it worked fine before)
r

russhwolf

09/02/2020, 6:48 PM
Yeah. Single-platform variants still exist. But
native
was actually doing what you want
common
to do so they updated the naming. You could include individual native targets it you wanted to as well like
ktor-client-mock-iosx64
k

Kris Wong

09/02/2020, 6:54 PM
erp, just found the problem
this is coming from Ktor:
kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlinx.coroutines.ChildHandleNode@ece212c8
r

russhwolf

09/02/2020, 6:56 PM
Make sure you're using coroutines
1.3.9-native-mt
k

Kris Wong

09/02/2020, 6:56 PM
hmmm
I was under the impression that wasn't ready for production
r

russhwolf

09/02/2020, 6:57 PM
Ktor is using it internally now
k

Kris Wong

09/02/2020, 6:58 PM
well, let's give it a go I suppose
well, now it fails differently
kotlin.native.concurrent.FreezingException: freezing of InvokeOnCompletion[InvokeOnCompletion@42d53cf8] has failed, first blocker is BlockingCoroutine{Active}@12c10b68
i get the impression i will be switching to my own HTTP implementation instead of Ktor