fix(kotlin)!: migrate timestamps to kotlin.time.Instant - #2556
Open
Garzas wants to merge 1 commit into
Open
Conversation
typfel
reviewed
Sep 9, 2026
| import kotlin.test.assertEquals | ||
| import kotlin.time.Instant | ||
|
|
||
| class TimestampTest { |
Member
There was a problem hiding this comment.
Can this live in shared/src/commonTest instead?
Member
|
@Garzas what do you mean by this?
|
istankovic
reviewed
Sep 9, 2026
|
|
||
| class TimestampTest { | ||
| @Test | ||
| fun timestampPreservesNanosecondsAcrossFfiConversion() { |
Member
There was a problem hiding this comment.
What is the purpose of this test?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core Crypto's Kotlin bindings still use kotlinx-datetime 0.6.1 and expose kotlinx.datetime.Instant. This keeps consumers such as Kalium dependent on the 0.6.x compatibility artifact when moving to kotlinx-datetime 0.7.1.
Update kotlinx-datetime to 0.7.1 and migrate the UniFFI timestamp mappings to kotlin.time.Instant and the standard library's Java conversion functions. Add a JVM regression test that verifies the generated Timestamp type accepts kotlin.time.Instant and preserves nanosecond precision through FFI serialization.
Breaking API change: the generated JVM and Android Timestamp alias now resolves to kotlin.time.Instant. This affects certificate validity fields such as notBefore and notAfter. Consumers must rebuild and migrate any uses of kotlinx.datetime.Instant at this boundary.
Validation: generated JVM and Android bindings successfully, passed all 62 JVM tests, and compiled Android Kotlin sources. Full Android packaging and runtime validation remain unverified because native Android .so libraries were unavailable; the native-library preparation step was skipped for the Kotlin compilation check.