Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make admissible ranges the same on all platforms #432

Open
dkhalanskyjb opened this issue Sep 4, 2024 · 0 comments · May be fixed by #453
Open

Make admissible ranges the same on all platforms #432

dkhalanskyjb opened this issue Sep 4, 2024 · 0 comments · May be fixed by #453
Labels
breaking change This could break existing code
Milestone

Comments

@dkhalanskyjb
Copy link
Collaborator

Create a giant local date on a JVM server:

java.time.LocalDate.MAX.toKotlinLocalDate()

Send it over the network to a Native client. Parsing this date will fail.

Why? The reason is that LocalDate, LocalDateTime, and Instant have different platform-specific ranges on different platforms.

It may be surprising that some values produced, then serialized and deserialized purely by the code in our library fail to work on the same version of our library on a different platform.

The proposal: align all platform-specific ranges to be the same.

Cons:

  • Slightly less efficient implementation.
  • The enormous dates and instants are hard to come by: on Native, the range is generous -1000000..1000000 years, enough for all realistic use cases. Java-specific sentinel values are the one exception.
@dkhalanskyjb dkhalanskyjb added this to the 0.7.0 milestone Sep 17, 2024
@dkhalanskyjb dkhalanskyjb added the breaking change This could break existing code label Oct 17, 2024
@dkhalanskyjb dkhalanskyjb linked a pull request Oct 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This could break existing code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant