Bug on Android with Timeout/Interval first trigger #20351
Labels
Platform: Android
Android applications.
Ran Commands
One of our bots successfully processed a command.
Resolution: Locked
This issue was locked by the bot.
Environment
Environment:
OS: macOS High Sierra 10.13.4
Node: 8.11.2
Yarn: 1.6.0
npm: 6.1.0
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 3.1 AI-173.4819257
Packages: (wanted => installed)
react: ^16.3.2 => 16.3.2
react-native: ^0.55.4 => 0.55.4
(I can't upgrade react-native to latest version yet due to babel errors)
Description
On Android, when I set a Timeout or an Interval via setTimeout / setInterval, the first call will be triggered much earlier than the given timeout. The subsequent calls for an Interval are triggered at the right timing.
Reproducible Demo
Here is a minimal code sample. To reproduce : run in debug mode, press the start button and read the console log.
The console log through chrome debugger is:
If I set the interval time parameter to 5000ms, the first duration is ~2790, with 10 000 it becomes ~7800, which is better but for smaller durations it is very problematic.
I am going to try with timer-mixin and react-native-timer later.
The text was updated successfully, but these errors were encountered: