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(animationFrameScheduler): some tasks are never flushed and sometimes it breaks completely #7444

Open
wants to merge 4 commits into
base: 7.x
Choose a base branch
from

Conversation

pmoleri
Copy link

@pmoleri pmoleri commented Feb 20, 2024

animationFrameScheduler has a few issues that makes it miss tasks and even start accumulating tasks that never get flushed.

  • It's clearing the _scheduled in every flush, but some of the flushes are not for the next scheduled frame, they're regular async timeouts.
  • because it might be picking the incorrect flushId it may flush tasks before the next frame
  • after flushing and recycling the id it's clearing the _scheduled even though current id might be a different one.

Related issues:

Failing tests are included in a independent commit and then fixed.

Note:
The changes could also be ported to AsapScheduler for consistency (also I think it's more clear).
However, I couldn't reproduce the issues there because:

  • AsapScheduler already contains one of the fixes
  • In AsapScheduler I couldn't schedule a task to happen before the _scheduled one.

@pmoleri
Copy link
Author

pmoleri commented Feb 29, 2024

Hi @benlesh. I noticed that you fixed 7196 for asapScheduler, but animationFrameScheduler has similar issue, and worse even (reason explained in this PR description).
Any chance that you can review this PR? It also includes tests that make it fail without the fix.

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.

None yet

1 participant