ionic-framework: Bug/Problem with setTimeout function

Ionic version: [ ] 1.x [ ] 2.x [x] 3.x

I’m submitting a [x] bug report [ ] feature request [ ] support request

Current behavior: setTimeout() always wait for about an extra second despite what ever time I set.

Expected behavior: The function to only wait the duration I set or at least close enough to it.

Steps to reproduce: 1- Create a blank app. 2- Use setTimeout() with any time less than 1 second -to notice the problem easier.

Related code:

console.log('Timer Start');
let timeOutHandler = setTimeout(
    ()=>{
        console.log('Timer End');
    },
    100
);

Other information:

  • I am using setTimeout() to keep track of some user events -like scroll ending-, which worked as expected (executed a function after a set time of milliseconds).

  • A few days ago I updated my device WebView to the latest version. Immediately after the function stopped working correctly. (tested on 60.0.3112.107 & 60.0.3112.116)

  • Didn’t get the same issue with a blank Cordova app.

  • I tested the function in different parts/pages of the app.

  • I tested on 3 android devices with the same results.

  • The problem only appears in the latest WebView update (maybe slightly earlier updates too).

  • The tests where done in blank apps.

  • Of course the code above was written by JavaScript for the cordova app.

My post on the forums with more info + screenshots

Ionic info: (For the blank app):

cli packages:

    @ionic/cli-utils  : 1.6.0 (C:\Users\iaboelsuod\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils)
    ionic (Ionic CLI) : 3.6.0 (C:\Users\iaboelsuod\AppData\Roaming\npm\node_modules\ionic)

System:

    Android SDK Tools : 26.0.2
    Node              : v6.11.0
    OS                : Windows 10
    npm               : 3.10.10

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

@mohabshihab - if you could provide a sample app via GitHub I will test with it as well, though first I have to get one of my older Android devices to connect properly (doesn’t occur with @ibrahimAboelsuod’s demo app on a newer device).

I’ll re-open this to also retest when v4 is ready since performance is a large part of the focus for v4.

Dears, I have this problem appeared also in my application after WebView update.

I have some data appears as a gear animation in my application and this was working before the update, but after WebView update it became very slow and stuttering bad.

I also tested it on browser and it’s still working fine

it seams it’s related to ionic as I tested it with cordova and it works fine

thanks for usual useful ionic support