Raymond Chan
07/15/2022, 3:03 AMStrings.kt line 296
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
We drilled down the logs on crashlytics a bit, and found that the app crashed during when our class AnalyticsTracker
was initializing. However, AnalyticsTracker
didn’t contain any Ktor related code, we are only accessing some constants defined in KMM.
And what we found interesting is that we found stacktrace for com.apple.main-thread
comes in with a little bit variation. You may check the attached stacktrace.
Kotlin version: 1.5.31, Ktor version: 1.6.0
Stacktrace for Thread #1
Crashed: Thread
0 9Gag 0x55f634 kfun:kotlinx.cinterop#<get-cstr>__at__kotlin.String(){}kotlinx.cinterop.CValues<kotlinx.cinterop.ByteVarOf<kotlin.Byte>> + 296 (Strings.kt:296)
1 9Gag 0x6e595c kfun:io.ktor.utils.io.charsets.CharsetImpl.<init>#internal + 26 (CharsetNative.kt:26)
2 9Gag 0x6e5788 kfun:io.ktor.utils.io.charsets.Charsets#<init>(){} + 383 (CharsetNative.kt:383)
3 9Gag 0xa698ec InitSingletonStrict + 4325644524
4 9Gag 0x947104 __unnamed_2910 + 4324454660
5 9Gag 0xa74630 Kotlin_initRuntimeIfNeeded + 4325688880
6 9Gag 0xa7698c (anonymous namespace)::workerRoutine(void*) + 4325697932
7 ??? 0x18251c2c0 (Missing)
8 ??? 0x18251c220 (Missing)
9 ??? 0x18251fcdc (Missing)
Omer Amiel
07/15/2022, 5:05 AMGson
in the ContentNegotiation
block?
This doesn’t work:
val gsonInstance: Gson = ...
install(ContentNegotiation) {
gson {
gsonInstance
setPrettyPrinting()
setLenient()
}
}
John O'Reilly
07/15/2022, 10:15 AMHttpClient
and wondering if there should be way of specifying what version of TLS you want to use?Hamza GATTAL
07/15/2022, 5:09 PMJan
07/15/2022, 5:50 PMget("/") {
call.respondText(ContentType.Text.Html) {
"""
<!DOCTYPE html>
<html lang="en">
<head>
<title>Supabase In App Authentication</title>
</head>
<body>
<script>
const pairs = location.hash.substring(1).split("&").map(pair => pair.split("="))
</script>
</body>
</html>
""".trimIndent()
}
}
Is there a good way without using templates or something?Mikhail
07/17/2022, 6:11 PMtext/event-stream
?Helio
07/18/2022, 7:25 AM/**
* Size of the queue to store [ApplicationCall] instances that cannot be immediately processed
*/
public var requestQueueLimit: Int = 16
/**
* Number of concurrently running requests from the same http pipeline
*/
public var runningLimit: Int = 32
I would like to know if you have any suggestion regarding what’s the best approach to test / update these parameters? We are currently running Ktor 2.0.3
.
Thanks for your help.Hamza Maqsood
07/18/2022, 9:14 PMJúlio Santos
07/18/2022, 9:33 PMDean Djermanović
07/19/2022, 10:28 AMHttpClient(Android)
and HttpClient(OkHttp)
with regards to ktor-client
?Andrew Steinmetz
07/20/2022, 12:16 AMOmer Amiel
07/20/2022, 9:26 AMCIO
client, and able to use it against the server. issue is I can’t see any logs of those req in Charles/Network inspector, I guess it’s bcs I didn’t configure TLS for the engine. I followed this, but not sure how to provide the keystore
file. is that the issue? any idea how to solve it?
EDIT: I actually think it’s bcs I didn’t config proxy, but having issues there:
I added this:
engine {
...
proxy = ProxyBuilder.http(URLBuilder(host = hostName, protocol = URLProtocol.HTTPS, port = 8080 ).build())
...
}
the req is triggered, but getting t/o, what am I doing wrong?Alexander Sysoev
07/20/2022, 2:35 PMIsaacMart
07/20/2022, 10:54 PMIsaacMart
07/20/2022, 10:56 PM@Serializable
sealed class Resource<T>(
val data: T? = null,
val message: String? = null,
val token: String? = null
) {
class Success<T>(data: T?, message: String, token: String? = null) :
Resource<T>(data, message, token)
class Error<T>(message: String, data: T? = null, token: String? = null) :
Resource<T>(data, message, token)
}
Javier
07/21/2022, 12:37 PMMockEngine
with Json
, but the same exact logic is working when fetching from remote, more info in 🧵Lidonis Calhau
07/22/2022, 8:32 AMeenriquelopez
07/22/2022, 9:41 AMHttpClient(CIO)
, and my client speaks with a server that delivers a chunked JSON. I have been trying to change headers, response model, etc… But it does not seem to help. I am receiving the following error:
NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class com.my.class
I have seen this when trying ktor cannot serialize something in the data class, but right now I am using an empty class, which should be “serializable”Joe Altidore
07/25/2022, 10:00 AMimplementation("io.insert-koin:koin-core:3.2")
implementation("io.insert-koin:koin-ktor:3.2")
This block is having an error
install(Koin) {
/*logic here**/
}
Unresolved reference: KoinPiotr Krzemiński
07/25/2022, 10:38 AMharry248
07/25/2022, 1:31 PMMJegorovas
07/25/2022, 2:45 PM@Serializable
@Resource("test/{id}.pdf")
class GetPDF(val parent: Timestamp = Timestamp(), val id: String)
The path parameter doesn't get filled and you get a request like ...test/{id}.pdf?id=1
instead of .../test/1.pdf
Michael Waitt
07/25/2022, 6:17 PMcreateApplicationPlugin
API. More info in 🧵.paw
07/25/2022, 6:18 PM+
in query parameters, which I understand is the general convention. However, the API I have to work with is not particularly well-designed, and so it only accepts %20
as a space, even in query parameters. Is there any way I can tell Ktor to always encode spaces as %20
no matter the context?
The only solution I’ve found so far is .encodeURLParameter(spaceToPlus = false)
, but that doesn’t seem to be able to apply to globally apply that property in the ktor instance, as one might do with a user agent, it has to be done manually every time. Is there a better way?Susmitha Gudapati
07/26/2022, 9:14 PMParametersBuilder
to build params from JsonObject and I see that double quotes are added to my query params’ values. Can someone help me in correcting or handling this ?hikamaeng
07/27/2022, 7:06 AMDidier Villevalois
07/28/2022, 3:36 PMSlackbot
07/28/2022, 4:33 PMAndrew Steinmetz
07/28/2022, 4:50 PMHttpReceivePipeline.After
to be able update this old plugin to Ktor 2.0? Looking at the old and new versions of Ktor, it looks as if context.request
is no longer accessible since the type on the receive pipeline is now Unit instead of HttpClientCall
?napperley
08/01/2022, 1:12 AM