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

Configure Instant wasm polyfill to use monotonic time #2935

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Dec 13, 2023

With the inaccurate feature, this polyfill uses Date.now() to emulate Instant, which is not monotonic, causing problems like element-hq/element-web#26416. Without it, it uses Performance.now(), which is monotonic.

I'm not really sure why we were using inaccurate in the first place. It was added in #414, but that doesn't seem to be giving any clues.

One other point of note: instant generally doesn't seem to be very well maintained (cf sebcrozet/instant#52), and maybe we should use web-time as that issue suggests.

With the `inaccurate` feature, this polyfill uses `Date.now()` to emulate
`Instant`, which is not monotonic, causing problems like
element-hq/element-web#26416.
@richvdh richvdh requested a review from a team as a code owner December 13, 2023 12:13
@richvdh richvdh requested review from jplatte and removed request for a team December 13, 2023 12:13
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d764fca) 82.77% compared to head (5701cea) 82.74%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2935      +/-   ##
==========================================
- Coverage   82.77%   82.74%   -0.03%     
==========================================
  Files         220      220              
  Lines       22468    22468              
==========================================
- Hits        18597    18592       -5     
- Misses       3871     3876       +5     

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

Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Agree with the PR. Agree to use a better crate in the future. Can you open an issue to track this work please?

@Hywan Hywan merged commit 18b6387 into main Dec 13, 2023
35 checks passed
@Hywan Hywan deleted the rav/fix_nonmonotonic_panic branch December 13, 2023 14:57
@richvdh
Copy link
Member Author

richvdh commented Dec 13, 2023

Can you open an issue to track this work please?

#2937

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