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

Enhance time consistency between GitHub, Pingh server, and client #45

Merged
merged 16 commits into from
Oct 10, 2024

Conversation

MykytaPimonovTD
Copy link
Contributor

@MykytaPimonovTD MykytaPimonovTD commented Oct 8, 2024

This changeset introduces several enhancements to ensure time consistency between GitHub, the Pingh server, and the Pingh client:

  1. Time received from GitHub is parsed in ISO 8601 format and stored as a Timestamp in UTC;

  2. When displaying time to the client, the UTC time received from the server is converted to local time, factoring in the system time zone.

@MykytaPimonovTD MykytaPimonovTD self-assigned this Oct 8, 2024
@MykytaPimonovTD MykytaPimonovTD marked this pull request as ready for review October 8, 2024 09:29
Copy link
Contributor

@armiol armiol left a 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:

  1. 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.
  2. Upon receiving the time values from a third-party, such as GitHub API, ensure the time value is in UTC.
  3. 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.

@MykytaPimonovTD MykytaPimonovTD changed the title Convert UTC time to the local time on the client side Enhance time consistency between GitHub, Pingh server, and client Oct 9, 2024
Copy link
Contributor

@armiol armiol left a 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.

Copy link
Contributor

@armiol armiol left a 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.

@MykytaPimonovTD MykytaPimonovTD merged commit df7d44e into master Oct 10, 2024
1 check passed
@MykytaPimonovTD MykytaPimonovTD deleted the improve-time-zones branch October 10, 2024 08:46
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