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

Handle double precision in playState #288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johannesodland
Copy link
Contributor

Double precision errors can prevent playState from becoming "finished",
which in turn prevents the finished promise from resolving.

This is caused by precision loss due to floating point computations. For instance, converting an internal holdTime of 100000 to CSSNumberish and back can cause currentTime to become 99999.99999999999.

When the imprecise currentTime is compared against the effectEnd() with a regular >= operator the comparison will fail. This PR introduces an epsilon check to address this and ensure that the playState can become "finished".

Copy link

@porfirioribeiro porfirioribeiro left a comment

Choose a reason for hiding this comment

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

This may be the reason why sometimes my timelines never finish!

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