-
Notifications
You must be signed in to change notification settings - Fork 0
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
Enhance time consistency between GitHub, Pingh server, and client #45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MykytaPimonovTD we have discussed using the Spine Time
utility which provides the time values.
What you should have done:
- For both server- and client-side set a custom time provider, which would return the values in UTC with the respect to the JVM-local time zone. Use
Time
utility to obtain the current time. - Upon receiving the time values from a third-party, such as GitHub API, ensure the time value is in UTC.
- Once any absolute time values are displayed in UI (and honestly, I am not sure whether we do that at all), they should be converted to the time zone local to the JVM in which the application runs.
There isn't much point in doing the conversion just on the client side, as we see done in this changeset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MykytaPimonovTD as discussed vocally, let's remove the redundant code and the Gradle module. And have more tests for the introduced conversion functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MykytaPimonovTD LGTM with a comment to address.
This changeset introduces several enhancements to ensure time consistency between GitHub, the Pingh server, and the Pingh client:
Time received from GitHub is parsed in ISO 8601 format and stored as a
Timestamp
in UTC;When displaying time to the client, the UTC time received from the server is converted to local time, factoring in the system time zone.