Migrates to kotlin.time.Instant from the stdlib#469
Conversation
| * * For Google subscriptions, productIds are `subscriptionId:basePlanId`. | ||
| * * For Amazon subscriptions, productsIds are `termSku`. | ||
| */ | ||
| @OptIn(ExperimentalTime::class) |
There was a problem hiding this comment.
Maybe it's better to propagate these annotations?
There was a problem hiding this comment.
If we're using types that are experimental, I think that makes sense to me!
There was a problem hiding this comment.
Agreed to propagate these annotations.
| public static final fun getLatestExpirationInstant (Lcom/revenuecat/purchases/kmp/models/CustomerInfo;)Lkotlinx/datetime/Instant; | ||
| public static final fun getOriginalPurchaseInstant (Lcom/revenuecat/purchases/kmp/models/CustomerInfo;)Lkotlinx/datetime/Instant; | ||
| public static final fun getRequestInstant (Lcom/revenuecat/purchases/kmp/models/CustomerInfo;)Lkotlinx/datetime/Instant; | ||
| public static final fun getFirstSeenInstant (Lcom/revenuecat/purchases/kmp/models/CustomerInfo;)Lkotlin/time/Instant; |
There was a problem hiding this comment.
Hmm as you said this is a breaking change. I think it would be ok to do this, as long as devs had to previously OptIn into an experimental flag to be able to use them. If not, I would consider holding using the compatibility library version if possible.
There was a problem hiding this comment.
My main question is that before it seems we were able to use these types in the API tests without opting in to the experimental flag.
There was a problem hiding this comment.
Ugh :( So... I guess we're forced to do a breaking change... I really would love to avoid a major but wondering if we should do it, even if it's due to a dependency...
| * * For Google subscriptions, productIds are `subscriptionId:basePlanId`. | ||
| * * For Amazon subscriptions, productsIds are `termSku`. | ||
| */ | ||
| @OptIn(ExperimentalTime::class) |
There was a problem hiding this comment.
Agreed to propagate these annotations.
|
Closing in favor of #514 |

Description
The
Instant(andClock) types are moving from the kotlinx-datetime library to Kotlin's stdlib. They're available since Kotlin 2.1.20. Concretely this means thatkotlinx.datetime.Instantis deprecated and replaced bykotlin.time.Instant. This PR makes use of the new type, and removes the kotlinx-datetime dependency (because we don't use anything else).This is technically a breaking change, but the kotlinx-datetime library is still experimental in its entirety. This will only affect devs using that experimental library already.
The alternative is to bump the version of the kotlinx-datetime library to 0.7.1, which is a compatibility release still containing the deprecated types, but that's just delays the inevitable. Happy to hear thoughts.
Closes #468