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

Draft: replace std::time:SystemTime with web_time::SystemTime #279

Conversation

karpfediem
Copy link
Contributor

Would fix #278
Allows consistent usage of SystemTime between targets (including WASM).

I replaced all uses of std::time::SystemTime with web_time::SystemTime, and removed the overloaded duration_since_unix_epoch method for the WASM target.

I haven't vetted the web_time library for other uses, but it seems to be working fine.
So this is just a proposal and might need more discussion/research before including as dependency.

Allows consistent usage of SystemTime between targets (including WASM)
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (da8e406) 81.67% compared to head (b7109ff) 81.67%.

❗ Current head b7109ff differs from pull request most recent head bfee0f7. Consider uploading reports for the commit bfee0f7 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #279   +/-   ##
=======================================
  Coverage   81.67%   81.67%           
=======================================
  Files          16       16           
  Lines        3836     3836           
=======================================
  Hits         3133     3133           
  Misses        703      703           

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

@ChristopherRabotin
Copy link
Member

Thanks for the pull request that rapidly address the bug you found.

I think that the crate needs to be marked as optional and enabled only when the std feature is enabled. Then, I think the tests will pass.

@karpfediem
Copy link
Contributor Author

Thanks for the pull request that rapidly address the bug you found.

I think that the crate needs to be marked as optional and enabled only when the std feature is enabled. Then, I think the tests will pass.

Oh i see now, thanks for the heads-up.
And it's a simple fix, happy to help :)

@ChristopherRabotin ChristopherRabotin merged commit 822c0a0 into nyx-space:master Jan 15, 2024
29 checks passed
@karpfediem karpfediem deleted the hotfix/replace_system_time_web_time branch January 20, 2024 14:03
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.

Epoch::now() is returning faulty time (wasm/web-sys)
2 participants