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

fix(exporter): Ensure that timestamp are in second and not milliseconds #2751

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

thomaspoignant
Copy link
Owner

Description

This PR is adding a conversion check on the feature event date to be sure that what we receive is in seconds not in milliseconds.

Checklist

  • I have tested this code
  • I have added unit test to cover this code
  • I have followed the contributing guide

Copy link

netlify bot commented Dec 4, 2024

Deploy Preview for go-feature-flag-doc-preview ready!

Name Link
🔨 Latest commit 4ef7d0e
🔍 Latest deploy log https://app.netlify.com/sites/go-feature-flag-doc-preview/deploys/675089ec3458860008c69c92
😎 Deploy Preview https://deploy-preview-2751--go-feature-flag-doc-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
// but since it is totally possible to have a timestamp in seconds that is bigger than 9999999999
// we will accept timestamp up to 9999999999 (2286-11-20 18:46:39 +0100 CET)
event.CreationDate, _ = strconv.ParseInt(
strconv.FormatInt(event.CreationDate, 10)[:10], 10, 64)
Copy link
Contributor

Choose a reason for hiding this comment

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

logging some warning would help resolve such issues in the clients. At least it would be visible.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes you are right, let me add a WARN log.

Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.87%. Comparing base (c4059d1) to head (4ef7d0e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2751      +/-   ##
==========================================
+ Coverage   84.84%   84.87%   +0.03%     
==========================================
  Files         111      111              
  Lines        5167     5178      +11     
==========================================
+ Hits         4384     4395      +11     
  Misses        620      620              
  Partials      163      163              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
Copy link

sonarcloud bot commented Dec 4, 2024

@kodiakhq kodiakhq bot merged commit bafe9dc into main Dec 4, 2024
23 checks passed
@kodiakhq kodiakhq bot deleted the fix-timestamp-ms branch December 4, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants