Skip to content

Conversation

erkasraim
Copy link
Contributor

We’ve encountered the same issue as Issue #687, and upon checking, I noticed that a fix was already in progress in PR #689. However, since there has been no update for over three weeks, I went ahead and implemented a fix on my end in the meantime.

For improved readability and maintainability, I applied the change using a typealias in the following form:
private typealias KotlinInstant = kotlin.time.Instant

@mickael-menu mickael-menu requested a review from Copilot July 25, 2025 06:55
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the kotlinx-datetime dependency from version 0.6.2 to 0.7.1 and resolves breaking changes introduced by the new version. The upgrade addresses the same issue as #687 by handling the API changes in the kotlinx-datetime library.

Key changes:

  • Updates kotlinx-datetime version to 0.7.1 in the version catalog
  • Introduces a typealias KotlinInstant to manage API changes in the kotlinx-datetime library
  • Replaces kotlinx.datetime.Clock import with kotlin.time.Clock and adds required experimental annotations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
gradle/libs.versions.toml Updates kotlinx-datetime version from 0.6.2 to 0.7.1
readium/shared/src/main/java/org/readium/r2/shared/util/Instant.kt Adapts to kotlinx-datetime API changes using typealias and updated imports
Comments suppressed due to low confidence (1)

readium/shared/src/main/java/org/readium/r2/shared/util/Instant.kt:1

  • The kotlin.time.ExperimentalTime annotation was deprecated and removed in recent Kotlin versions. For Kotlin 1.9+ and kotlinx-datetime 0.7.1, this annotation is no longer needed as the time APIs are stable. Consider removing this opt-in annotation.
@file:OptIn(InternalReadiumApi::class, kotlin.time.ExperimentalTime::class)

Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @erkasraim, that's great 👌

@mickael-menu mickael-menu merged commit b2b26e1 into readium:develop Jul 25, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants