rnett
05/24/2021, 9:00 PM2.0.0-eap-132
for 1.5 support (and KT-46340), and it does not seem ktor-serialization
is published. Is there a replacement? It's there up until 2.0.0-eap-106
.marstran
05/25/2021, 11:00 AMHenry
05/26/2021, 12:18 AM// All db calls in this block will be executed within a transaction, on a connection held in the coroutine context
transactional {
...
}
As it stands it requires a call to a static method on application startup to initialise a tx manager which the transactional
call then uses to execute the tx. This is hard to test. I'd instead like to inject a transaction manager into a parent coroutine context so it's available everywhere in the app without needing to initialise it via a static method. I looked at using a feature that intercepts the application pipeline to do this but I don't think it does what I need. Any ideas?ESchouten
05/26/2021, 10:24 PMsamuele794
05/26/2021, 10:54 PMio.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class it.codingbunker.tbs.common.client.discord.model.DiscordOAuth2User
client setting
client.config {
developmentMode = true
install(Logging)
defaultRequest {
host + BASE_API_URL
accept(ContentType.Application.Json)
}
install(JsonFeature) {
serializer = KotlinxSerializer(
kotlinx.serialization.json.Json {
prettyPrint = true
isLenient = true
ignoreUnknownKeys = true
}
)
}
}
and i receive correct headersByFloRedstone
05/27/2021, 7:17 AMCasey Brooks
05/27/2021, 4:09 PMRenaud
05/28/2021, 9:39 AMfor loop
Publication.new { ... }
2. Insert via entity table
Publication.table.batchInsert
1? 2? I’m not sureenleur
05/28/2021, 5:38 PMmboudraa
05/28/2021, 5:49 PMnative-mt
version of coroutines 1.5.0.
I have a very simple test that fails on iOS with a kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.collections.HashMap@1657db08
and I have no idea where it can come from given the simplicity of this test.
If anyone has any lead, it would be very helpfulHexa
05/29/2021, 2:11 AMthanh
05/29/2021, 9:13 AMCLOVIS
05/29/2021, 9:32 AMwithTestApplication
ignore authentication? It accesses an endpoint behind authenticate()
without any specific setupdarkmoon_uk
05/30/2021, 8:10 AMHttpServletRequest.upgrade()
which is not supported in Jetty ☠️
This appears to be a complete blocker for deploying WebSockets as a WAR in Jetty. Disturbing given that it's a very standard configuration for production usage 😱
Is anyone able to suggest a fix or workaround? Reproduction steps added to ticket.Guilherme Delgado
05/31/2021, 12:54 PMactual fun getHttpEngine(): HttpClientEngine = OkHttp.create {
OkHttpConfig().also {
addInterceptor(chuckerInterceptor)
it.config {
readTimeout(60, TimeUnit.SECONDS)
connectTimeout(60, TimeUnit.SECONDS)
}
}
}
but for some reason I’m receiving failed with exception: io.ktor.network.sockets.SocketTimeoutException: Socket timeout has expired [url=..., socket_timeout=unknown] ms
after 10 seconds.
Should I add this timeout settings in HttpClient?
Thanks.edenman
06/01/2021, 3:56 AMJoão Rodrigues
06/01/2021, 9:57 AMRay
06/02/2021, 9:18 PMAnkit Dubey
06/03/2021, 10:13 AMHttpClient()
I came to know, that I can do it using HttpClient(OkHttp) engine, but in KMM project, I’m not allowed to add OkHttp dependency in shared/commonMain module.
It’s saying
Failed building KotlinMPPGradleModel
org.gradle.internal.resolve.ArtifactNotFoundException: Could not find ktor-client-okhttp-1.6.0-samplessources.jar (io.ktor:ktor-client-okhttp:1.6.0).
//Something I’ve achieve yet.
var cert : CertificatePinner = CertificatePinner.Builder()
.add(baseURL, "***************")
.build()
val ktorHttpClient = HttpClient(OkHttp) {
engine {
config {
certificatePinner(cert)
}
}
What I need
val ktorHttpClient = HttpClient() {
engine {
//ADD CERTIFICATE PINNER
//ADD INTERCEPTOR
}
rusmonster
06/03/2021, 11:30 AMI assume currently it exists but I don't know how to do it, can somebody help me please 🙂 ?Also the following doesn't work (unresolved reference eventListener)
val retMessage = httpClient.request<Message> {
eventListener = { event ->
println("${event.bytesSent / event.bytesTotal}% uploaded")
}
}
So is there any support for progress observer introduced in 1.6.0 or not?darkmoon_uk
06/07/2021, 6:16 AMCould not resolve io.ktor:ktor-client-js:1.6.0
error every time at Gradle sync. But...
• The project does build and run ✅
• The artifact name is correct
• I've added <https://repo1.maven.org/maven2/>
repo directly to the using project
• The artifact is there
• All other Ktor artifacts are resolving just fine.
• I've cleared build
and ~/.gradle
folders
I am using js(IR){...}
target, in case this has to do with resolving IR variant(?)
...nearly at a loss.
Is anyone else seeing weird stuck artifact mis-resolution around Ktor?Javier
06/07/2021, 12:56 PMjeggy
06/07/2021, 5:29 PMclass XmlConverter : ContentConverter {
override suspend fun convertForReceive(context: PipelineContext<ApplicationReceiveRequest, ApplicationCall>): Any? {
val request = context.subject
val channel = request.value as? ByteReadChannel ?: return null
val inputStream = channel.toInputStream()
val reader = inputStream.reader(context.call.request.contentCharset() ?: Charsets.UTF_8)
val type = request.type
return convertForReceive(type.javaObjectType, reader::readText)
}
}
Does anyone know why the .toInputStream()
throws this exception?
java.lang.IllegalStateException: Using blocking primitives on this dispatcher is not allowed. Consider using async channel instead or use blocking primitives in withContext(<http://Dispatchers.IO|Dispatchers.IO>) instead.
io.ktor.utils.io.jvm.javaio.BlockingKt.ensureParkingAllowed(Blocking.kt:302)
io.ktor.utils.io.jvm.javaio.BlockingKt.access$ensureParkingAllowed(Blocking.kt:1)
io.ktor.utils.io.jvm.javaio.InputAdapter.<init>(Blocking.kt:30)
io.ktor.utils.io.jvm.javaio.BlockingKt.toInputStream(Blocking.kt:20)
io.ktor.utils.io.jvm.javaio.BlockingKt.toInputStream$default(Blocking.kt:20)
com.apurebase.concur.server.XmlConverter.convertForReceive(XmlConverter.kt:28)
This happened after I upgraded from kotlin 1.3 and ktor 1.1.3 to the latest versions.Antero Duarte
06/08/2021, 10:17 AMNorbert Sziráczki
06/08/2021, 1:48 PM<http://httpClient.post|httpClient.post><LoginResponse> {
url { encodedPath = LOGIN_WITH_INIT_URL }
body = TokenGenerationInput(username, password)
}
Any ideas on what's happening here?Goth
06/09/2021, 4:30 AMnative-mt
version of Ktor? I don't find either the git tag or release for native-mt version of Ktor repo.CLOVIS
06/09/2021, 8:16 AMwilliam
06/09/2021, 7:56 PMTrevor Stone
06/09/2021, 8:12 PMGoth
06/09/2021, 11:19 PMe: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (8, 17): Unresolved reference: file
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (15, 12): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (21, 12): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (21, 43): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (34, 12): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (34, 43): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (37, 13): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (37, 40): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (47, 43): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/NioPath.kt: (50, 15): Unresolved reference: InvalidPathException
e: ktor/ktor-utils/jvm/src/io/ktor/util/Path.kt: (21, 35): Overload resolution ambiguity:
public fun [ERROR : Path].normalizeAndRelativize(): [ERROR : Path] defined in io.ktor.util in file NioPath.kt
public fun File.normalizeAndRelativize(): File defined in io.ktor.util in file Path.kt
e: ktor/ktor-utils/jvm/src/io/ktor/util/cio/FileChannelsAtNioPath.kt: (10, 17): Unresolved reference: file
e: ktor/ktor-utils/jvm/src/io/ktor/util/cio/FileChannelsAtNioPath.kt: (17, 12): Unresolved reference: Path
e: ktor/ktor-utils/jvm/src/io/ktor/util/cio/FileChannelsAtNioPath.kt: (25, 12): Unresolved reference: Path