Skip to content

[6.0] Return timestamp of latest unit for file in seconds not nanoseconds #191

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

Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Apr 16, 2024

  • Explanation: We were incorrectly returning a timestamp as nanoseconds instead of seconds in indexstoredb_timestamp_of_latest_unit_for_file
  • Scope: The indexstoredb_timestamp_of_latest_unit_for_file function introduced a few weeks ago that doesn’t have any users yet
  • Risk: Very low, the function hasn’t been used so far
  • Testing: Tested that this fixes an issue I was seeing in SourceKit-LSP
  • Issue: n/a
  • Reviewer: @bnbarham on Return timestamp of latest unit for file in seconds not nanoseconds #190

The doc comment said that the timestamp was in seconds, but we were returning a timestamp in nanoseconds.
@akyrtzi
Copy link
Contributor

akyrtzi commented Apr 16, 2024

Why not use a more precise timestamp than only up-to-second fidelity?

@ahoppen
Copy link
Member Author

ahoppen commented Apr 16, 2024

It’s returning a double, so it does have sub-second fidelity.

@akyrtzi
Copy link
Contributor

akyrtzi commented Apr 16, 2024

Ah thanks for clarifying!

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

Given I had the exact same question, let's change this API to return a 64 bit int and nanoseconds instead. But we can take the fix to unblock things for now 👍

@ahoppen
Copy link
Member Author

ahoppen commented Apr 17, 2024

Agreed to change the API to return nanoseconds in a follow-up PR.

@ahoppen ahoppen merged commit 91c51ad into swiftlang:release/6.0 Apr 17, 2024
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.

3 participants