-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
requestAnimationFrame callback order is nondeterministic #48005
Comments
Tip Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.76.3. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
Tip Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
The issue is present on the newest version. The problem is that the GitHub issue template forces me to output the result of running |
cc @rubennorte @sammy-SC i believe you both worked in this area, is this a known issue? breaking this expectation can lead to very subtle mistakes in app code (in our case, this led to a lightbox being permanently stuck and requiring an app restart.) |
Thanks for reporting this, @gaearon! Honestly, we need to rewrite the entire implementation for I don't know why the order isn't respected, but if this is happening for I'll add it to our backlog to prioritize it. If you'd like to contribute a fix in the meantime, please feel free to submit a PR :) Edit: it looks like the problem is that we only sort by time, but not also by timer ID in both platforms (see Android and iOS). |
Description
In my experience, the order of rAF callbacks is always deterministic on web. It seems like it's deterministic per spec. In other words, this:
should produce
That is the case on the web, but it's not in React Native.
Instead, on React Native, it's seemingly non-deterministic
Steps to reproduce
See this snack: https://snack.expo.dev/PsXPlo457DmfjCIEzRIsp?platform=ios
Expected:
Actual:
I believe this is the case for:
React Native Version
0.76.0
Affected Platforms
Runtime - Android, Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/vZ6_gSpj6iB6z0tpgDnsw?platform=android
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: