-
Notifications
You must be signed in to change notification settings - Fork 165
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
toJson serialization behaves incorrectly for dates on Windows, Linux, and Android #5451
Comments
➤ Jonathan Reams commented: At least on windows, the function that converts a time_t to a |
➤ Nikola Irinchev commented: For prioritization purposes, I'd like to clarify that to_json is not a public API in the dart SDK and we're using it in tests to verify that the data that we pass in from dart matches the data that Core receives. It may be a public API in other SDKs though as I've seen some java tickets relating to it. cc [~[email protected]] |
➤ Christan Melchior commented: Kotlin is just using it internally for testing as well, and only for Credentials, so we are not checking anything around timestamps. |
➤ James Stone commented: [~[email protected]] can we change the format of timestamps printed for json, or is that going to break the E2E tests? |
➤ Tyler Kaye commented: It will affect our fuzz tests only, but we can make a change in how that is decoded fairly easily. This is just the realm2json tool? |
@ironage @nirinchev Are we going to fix this any time soon or can we close this as a non-issue? |
I'd rather that we fix it as that's the most convenient way to verify that the SDK and Core agree on what data is being stored. |
The fix has been reverted |
But now fixed by #6862 |
We're testing round-tripping date properties in the dart SDK and noticed that json serialization behaves inconsistently. For example, the date
-0001-01-01 00:00:00
- I.e. year 1 BCE is encoded as-001-01-01 00:00:00
on Apple platforms, but as empty string on Windows (looks like all dates equal to or below 0000-01-01 00:00:00 get encoded as empty on Windows).The date 0000-01-01 00:00:00 gets encoded as 0000-01-01 00:00:00 on Apple platforms but 0-01-01 00:00:00 (note the lack of leading zeroes) and as 1905-06-06 18:35:44 on Android.
The date
27182104-21 00:00:00 gets encoded as 2016-09-19 11:52:32 on Android, but correctly on Apple platforms.It is possible that there's also a bug in the dart SDK in the way we represent dates on some platforms, but I verified that the reported that it's a serialization bug on windows (Studio correctly visualizes the expected date) and non-negative/zero dates work just fine, so there are strong indications that the bug is in the to_json implementation in Core.
The text was updated successfully, but these errors were encountered: