Hey all. I'm getting a `JsonDecodingException` (fr...
# ktor
Hey all. I'm getting a
(from kotlinx.serialization) which I believe is being caused by the source string being cut off after decoding it to a String from a
with the util extension function on
Copy code
Unexpected JSON token at offset 195068: EOF JSON input: .....text !","field":0.0,"te
This particular error can only be thrown if the current position when iterating over the source string is >= the last index of the string, and my JSON is not being fully parsed, so I am assuming that the String is being truncated somehow before parsing.
Copy code
.onSuccess { it: HttpResponse ->
    val receiveString = it.content.toByteArray().decodeToString()
    return json.decodeFromString(receiveString) //cast to my return type T
Does anyone have any insight as to why this might be happening? Am I receiving my
incorrectly? Note: I'm not using the kotlinx
, using it separately. My only idea right now is that it is failing to allocate the entire string due to OOM and this is just the first place exposing it, but I'm pretty sure this would fail with a different exception if that was the case.
is experimental but it was working as intended until very recently. I upgraded to Ktor 1.5.3 recently, but can't confirm that the version upgrade is what triggered it as I can't repro it locally, just see it in a crash report. It happens very infrequently, like ~.001% of all requests.
Hi, Can you please create issue in YT with reproducer? Another thing is using
is discouraged, because it gives you raw data, that wasn’t processed by any features. If you want to get
, please use
, or
in your case