Trying out new kotlinx-datetime `0.6.0-RC` version...
# apollo-kotlin
j
Trying out new kotlinx-datetime
0.6.0-RC
version and getting what looks like crash in apollo on iOS.....more in thread
👀 1
Copy code
Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Function 'parse' can not be called: No function found for symbol 'kotlinx.datetime/LocalDateTime.Companion.parse|parse(kotlin.String){}[0]'
    at 0   Confetti                            0x101188ecb        kfun:kotlin.Throwable#<init>(kotlin.String?){} + 119 
    at 1   Confetti                            0x101182037        kfun:kotlin.Error#<init>(kotlin.String?){} + 115 
    at 2   Confetti                            0x1011beed3        kfun:kotlin.native.internal.IrLinkageError#<init>(kotlin.String?){} + 115 
    at 3   Confetti                            0x1011bef8b        kfun:kotlin.native.internal#ThrowIrLinkageError(kotlin.String?){}kotlin.Nothing + 163 
    at 4   Confetti                            0x1014c62df        kfun:com.apollographql.apollo3.adapter.KotlinxLocalDateTimeAdapter#fromJson(com.apollographql.apollo3.api.json.JsonReader;com.apollographql.apollo3.api.CustomScalarAdapters){}kotlinx.datetime.LocalDateTime + 235
this is confetti project which is currently using
4.0.0-beta.4
of apollo
b
looks like this change which is probably source but not abi compatible
s
Aha, does it not figure out to use the default parameter somehow when you do not pass it in? 🫣
b
default parameters are 'unfolded' at compile time
and AK was compiled with the old signature that only expect one argument 😅
I guess datetime could have kept the old signature and make it call the new one, to make this a non breaking change
s
They probably do want to do this though no? If you report this bug and ask them to add this function (possibly as a deprecated/hidden one) for these compatibility reasons and then make a patch release?
b
Could be an interesting one yes!
Since it's still in 0.x versions maybe they don't care too much on API stability yet? Not sure 🙂
s
Still worth a file, I can do it with a link to this chat if you’re busy 😊
b
go for it 🙂
s
Please do correct me if I wrote something wrong, the terminology (mainly around ABI compatibility) around this is not something I am 100% familiar with
b
Looks all good 🙂
j
looks like fix already in the works! https://github.com/Kotlin/kotlinx-datetime/pull/357
🚀 1
s
We’re probably about to witness a lightning fast bug found to reported to fixed turnaround 😅
John, I see that you were working on Confetti when you encountered this bug. Do you have a branch with this change pushed which you could possibly show to them so that they can reproduce it themselves too? Because I imagine doing it the other way around, somehow building their library with that fix would be more work in comparison. I am not sure how I would even do that really, clone it locally, build it and publish to maven local, import it and so on? I don’t actually know 🫣
d
git clone <https://github.com/Kotlin/kotlinx-datetime>
git checkout restore-native-bincompat
./gradlew publishToMavenLocal
; Add the
mavenLocal()
repository to your build.gradle; Depend on
0.6.0-RC-SNAPSHOT
.
1
b
had to do this yesterday with Ktor for some obscure reason 😅
s
Ah okay so it was just that, thanks 😊. John if you got the confetti code pushed I could perhaps give it a try later today, if you are busy to try this yourself
j
Tried it just now and confirmed it fixed the issue
🎉 1
🌟 1
and using new formatting apis now as well 🙂
😍 1
s
That’s awesome, I’m waiting to see the PR to see those formatting APIs in action, I’ve only read the docs for now and they look very nice to use
j
yeah, will create PR with changes once version is available with that fix